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
-
Geoxion9036y@ItsNotMyFault Nope, he was serious. Even showed me how to change the code to be more to his liking and he did that.
He also said he would do it in a completely different way, but still he preferred the nesting over some else ifs -
🤢🤮 „team lead“ means „dude who is dumb enough to tube for mean boss decisions“ not „lead a team“. So you better ignore him as much as you could. Ask him for internet source that proves his crap as „widely accepted“ in the dev community. 😉
-
Geoxion9036yOh, and I must say, generally I agree with his comments. But this one really stood out XD
-
Omnisus3446yHow the fuck, it mixes layers. You have one layer of questions like it is apple? No maybe it is orange? Oh maybe then melon? No? So something else, ok then. After you know which fruit it is yku could ask about color or something and put it in next layer. Also it make that 1 layer switch of 6 cases will be 6 times nested if and a lot of nesting is bad for readibility...
-
tuc0w3106y@BlazinDevilify the most impressive thing about that are those closing parentheses 😂
-
@BlazinDevilify That's awesome. Found this gem in the comments.
Some dude writes:
'It checks this.isFirefox twice.'
Other dude replies:
'Gotta be sure.'
:'D -
Omnisus3446y"dupa" on the shitcode site is visible for everyone or just regional thing? 😃 I remember my first atempt to some kind of debugging with that "dopa" error message 😃
-
Omnisus3446y@BlazinDevilify thanks 😃 It means ass, but is use to express failure, too 😃 soft fuck
-
junners4986yYou shouldn’t leave the if else statement without an else. From my experience you can
If
Else if
Else if
Else
If its a method return, set values instead
X =4;
If something
Set value
Return x -
@junners It seems like a cargo cult in programming to me to mutate a variable in a huge if else statement only to enforce one return statement per method.
I rather would use early returns and avoid writing else statements altogether.
If (cond) { return "Foo"}
If (cond1) { return "Bar"}
return "Default"
Or in this very case a switch statement.
Related Rants
-
Santaclauze23!geek girlfriend Me and my partner are in the car driving. We drive by a young girl who is on her scooter. I ...
-
DZetko14Told client my hourly rate. He agreed but only gave me 20 minutes to do the work...😀
-
Milenchy13Chrome wants to open 454 tabs at once. That's literally the software version of suicide.
So my team lead told me in a code review that you shouldn't use 'else if' in code.
Instead you should best them like:
if
else
if
else
if
else
Apparently that would improve readability...
Am I crazy, or what?
rant
else
if
crazy