3 ms·
But don't do what one memorably awful project I had to maintain did - to use that example they would have done: country_code==FIFTY_FIVE and day_of_week==ONE
by arethuza 7y ago
But don't do what one memorably awful project I had to maintain did - to use that example they would have done:
country_code==FIFTY_FIVE and day_of_week==ONE
- deleted 7y ago[deleted]
- spuz 7y agoBut what if the definition of 55 changes? You'll be glad to have your table of constants then.
- arethuza 7y agoThe project also defined HTTP, COLON, SLASH, WWW and DOT so that you would have: string url = HTTP + COLON + SLASH + SLASH + WWW + DOT ... I swear I'm not making this up....
- rpmisms 7y agoSounds like a PHP codebase I'm currently working in. I shit you not, $LI = '<li>' is in the functions file, along with $LI_END.
- arethuza 7y agoIt was a very enterprisey Java codebase from the bad old days of J2EE - it had somewhere over 30 layers of abstractions between the code in a JSP and a web service call. [NB 30 isn't an exaggeration - I think the vast team who wrote it were paid by the abstraction or something].
- chessturk 7y agoReminds me of http://pk.org/rutgers/notes/pikestyle.html http://pk.org/rutgers/notes/pikestyle.html > "There is a famously bad comment style: ... Don't laugh now, wait until you see it in real life."
- snovv_crash 7y agoWell at least a typo sould give a compile time error for some subset of typos. But in the trade-off in code readability was probably the cause of many other mistakes, so probably ended up further behind.
- nitrogen 7y agoBut how else will your compiler tell you that you mistyped 55? /s