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
-
The dangling else.
While I don't like the syntax (<?php }else {} ?> would have been preferred ) it can be pretty useful to show intent, and makes the code easier to read. Its good practice to stick a comment in the dangling else.
For example:
if(model.isValid)
{
....
}else{
//model passed validation, continue.
}
We actively practice this, I too was like "wtf" at first, but it's actually pretty useful. -
smtlk456yMixing PHP and HTML what year is this?? Your boss should be ashamed to call himself a developer. Tell him I hate him just from looking at his disgusting code and please get him a calendar so he can see it’s not 1999 anymore.
Its code like this that cements PHPs terrible reputation. Judging from that snippet you got bigger problems than just dangling else statements. -
ZioCain27116y@smtlk he's not a developer, he just learnt by himself playing around with wordpress and similar stuff
BTW I also mix PHP & HTML and I kinda feel ashamed, too, but sometimes it's just so useful and easy...
Related Rants
I'll never ever understand how my boss always ends up doing this kind of bullshit
This is production code, there won't ever be anything in there, NEVER
rant
else
empty
php
html