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
-
For me depends on the language you if it is PHP, C#, C++. Him if it is JS.
Also if it is an if just to check something and if that is true I'll use;
if (check)
return; -
Allman style all the way. F**k vertical space!
But seriously, if I'm working with more people I respect the commonly used style whatever it is, same as with spaces vs tabs. If it's my own code, my preference is always Allman style. It looks cleaner to me, it's more readable for me at a glance and offers a clear and proper separation of the code block from the block statement (or lack thereof). -
WylieYYYY366yif(check) goto jmp;
//something
:jmp
//statement
goto end;
:jmp0
//other statement
goto end;
:end -
musician6656y@RicoNijeboer for me thats fine for return statements but why not just on one line? Makes it much clearer what your intention was. Also less likely to get bugs cause someone added a line
-
@Alice You mean the one with the instant return or the one where the {} are on their own line?
-
@Alice Hello, I am new here. Thanks for pointing it out. Ill correct it from next rant.
-
ODXT32836yAs long as it's consistent within the project, either is fine...
But I prefer the first one.
ME:
if
{
//statements
}
HIM:
if {
//statements
}
rant
#wk112