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
-
@bad-frog not if condition is too long. Actually for brievety i suplemented from my case 'condition1' with something along of lines:
(toAdd.String() == hardcodedNoGo && fromAdd.String() ==hardcodedNoGo)
Lets just not get into details -
I'm not sure if I'm getting this right.
Is the OR / double pipe at the end a logical condition operator or a end of line seperator?
End of line seperator would truly disturb me. -
@ostream
Well, not in golang, golang has some of weird syntax rules.
If line looks like it might be like end of statement than its parsed as end of statement, so if you dont add OR before \n , "if condition" is valid statement.
Edit:
I find logical operators of bigger if significantly more readable on begining of a line, when they are aligned etc, but that may be personal thing -
@bad-frog I was about to say this, I cant stand either of them OCD-wise 😅
But real question though, Go doesn't allow OR operator at start?
Related Rants
-
xorith19HTML: Hate This Meaningless Life CSS: Can't Style Shit JS: Just Shit Java: Just another vicious asshole PH...
-
ObiSwagKenobi6> Receive sudden phone call in the middle of the night > Check caller, unknown number > "Either something ba...
-
Papi23Started learning Go It's very interesting language
μRant
Normal languages for longer ifs:
if ( (condition1)
|| (condition2)
|| (condition3))
Go:
if (condition1) ||
(condition2) ||
(condition3)
That OR at the *end* of line deeply disturbs me
rant
go