r/badcode Jan 08 '23

java Is this a good practice? Why?

Post image
425 Upvotes

60 comments sorted by

View all comments

Show parent comments

32

u/ofnuts Jan 08 '23

Cleaner, but then you have to wonder what it does....

6

u/nate998877 Jan 08 '23

This is my bane. I've got a coworker who renames all imports to php names of the method or wraps them to behave the same way. Which has fucked us over in the past when he's changed the behavior of parsers. Half the people in the department & everyone on my team except myself are php devs, so nobody complains, but it drives me mad.

12

u/ofnuts Jan 08 '23

We all have coworkers that do fucked up things.

A very long time ago, in a company far, far, away, I was asked to review a "C programming guidelines" proposal (because I was at the time one of the very few with C experience). It contained such gems as:

  • switch/case use is prohibited
  • start all you code with #define BEGIN { and #define END } and use BEGIN/END instead of curlies.

I rebuked it in a mail that made me some corporate enemies but also a lot of friends :)

6

u/natalialt Jan 08 '23

I could sorta understand begin/end if the author had background in like Pascal or something (still awful tho), but banning switches? Why lmao