Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Unai4916yYeah, that is a very bad programming practice. Code should be as self explanatory as you can
-
thealex11176yI'm so happy I've never seen anyone do that. That person probably wouldn't exist anymore. If I ever saw a comment inside a conditional I'd flip my shit
-
I hope no one does this:
if(bla.boolean(/* convert to boolean */) /*Check if that thing is true*/){
} -
I do it sometimes to explain my overall purpose, not the condition. It also somehow does good with nested conditions.
-
@illegaldisease Why would you do that... there is enough space to the right of your code
-
@HTMLspecialist I think i misunderstood when you said brackets. I thought you were talking about curly brackets and i was wondering what is wrong with that.
I do this :
if(bla.bla()){ //Blabla does blabla
}
Not this ugly shit
if(bla.bla()/*Blabla does blabla*/){
} -
I prefer guard syntax for including comments in branch logic:
f n
| n == 0 = 0 -- comment
| n == 1 = 1 -- comment
| True = f (n-1) + f (n-2)
(have you heard about my lord and savior haskell?)
Related Rants
This is an example if statement:
if(bla.boolean()){
}
Bill does NOT put comments into the condition brackets.
Be like bill.
Please.
rant
statement
bill
if
be like bill