I am glad I was let go and they kept the Full Stack

A huge benefit of programming is automating manual labor - make the computer do the work for you. If you can make a computer generate a range of strings following a pattern instead of a programmer copy-pasting and manually editing every single string you'll save a lot of time and make your code much more maintainable.

Take the screenshot as an example. Maybe you wanted to show a report for 24 months. You could either copy-paste and edit another 12 months (which would work), but as you can see any modification you'd want to do increases the amount of manual labor required because you're not utilizing the tools the programming language provides to you.

A simple improvement to this code could be a for loop, where you'd use an incrementing month number in the strings. The resulting code would amount to maybe 10 lines, and you'd be able to control the month range with a single variable. It would take less time to write and be much more flexible and maintainable.

Making code work and making code look pretty usually aren't mutually exclusive.

/r/badcode Thread Parent Link - i.redd.it