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
-
C0D4669025yAtleast they got one variable right, myJunk 😅
Are you sure it's the same dev? Cause god help us if it was.
But then if it wasn't, that's also scary why so close code looks so radically different. -
@C0D4 I can only guess. There was no versioning system before I came by to upgrade PHP.
And rant, of course. That's free, so great. -
@M1sf3t I understand when code style evolves, but you mentioned exactly what's lacking: if someone changed code just above the "wrong one", update the rest of it too!
IDEs are great on that: you configure a code style, press a shortcut, and magically all the file gets formatted.
Also, linters exist for a reason: it's important to keep your style consistent if you ever plan to get outsider help. And even if you don't, practise it. -
Can we please just point out the redundant cancer that is ^([ ]+) in this code?
Why are there so many spaces in a "one of" search and why didn't they just use \s ? -
@stonestorm lol, surprise surprise. That's a space AND A TAB!
I only noticed it after the screenshot, so I couldn't add, but thanks for pointing it out. -
@igorsantos07 But but... Does that even work? I've never been mad enough to try.
-
@stonestorm I guess so. In the end, \t and an actual tab are the same, right?
I wouldn't suggest anyone to try, tho - unless you want to make someone else mad. -
If the code is that bad, just use a linter to format all the code in the repo (php cs fixer 😉)
-
Wow. That's not legacy, that's.... Unusable.
for with count...
unnecessary variable init for list
ereg
error propagation seems very wrong...
list with missing check if empty for users...
There is only one line I find appropriate in this whole code.
Find it. XD -
Dozak55yWhat is that crossed equals sign in the last if statement? Is it something IDE replaces, like != ?
Related Rants
Mystery of the day: why some developers can't decide on a code style. Let's count:
- two types of brace placements
- three types of assignment spacing (with, without spaces, and aligned with extra space)
- two types of clause spacing
- mixed case in the first char of a variable for no apparent reason(?)
- bonus: unneeded parentheses
At least in ONE thing the person was consistent: no space between parameters!
WHY GOD.
rant
legacy
ugly code
code style
code upgrade
code standards
legacy code
php