Ask HN: What is the worst code you have seen at work?

2 points by Flex247A ↗ HN
I wrote a simple game for CS project last year, and it was pretty bad. All logic was opaque, and there were tonnes of global variables!

5 comments

[ 2.6 ms ] story [ 26.2 ms ] thread
The code you wrote five years ago.
5 years ago I was just starting out :)
Trust me, in 2026, you'll be more embarrassed by the code you wrote in 2021 than in 2016. True for everyone.
There were 2 function's called something like convert2Upper and Convert2lower (Don't remember the exact names) in Java that took a string broke it into characters and for each char did the following:

If (InputStr[$i] == 'a') InputStr[$i] = 'A'; If (InputStr[$i] == 'b') InputStr[$i] = 'B'; .. .. If (InputStr[$i] == 'z') InputStr[$i] = 'Z';

Written by someone with over 5 years 'experience'.

- Suramya