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
(inspired by another rant I read here)
Last semester we were learning Java in the Programming Fundamentals class and a friend of mine asked for help with an assignment.
The objective was to make a virtual store (as a console app) in which the user would be able to select a few products, customize some of them and then the program would print out a receipt, with a list of all products, their prices, and the total cost.
Simple enough I thought, but there was a catch: you were not allowed to use arrays because the teacher hadn't taught that to the class yet. So I was like "how the fuck are you supposed to do this then?". Turns out the way to do it was to just append text to a string in order to generate the receipt. This is stupidly simple, so stupid that it didn't even cross my mind.
It's just that it's an awful way to architecture your code, it's just plain shit. Sure, if you're learning programming that's completely ok, but using that code on production is just completely unfeasible and I think that's why it didn't even cross my mind to do it this way. I'm just constantly worrying about performance and good code architecture and organization that the simplest of all solutions slipped my mind. When I finally discovered the way the teacher wanted us to do it I just wanted to kill myself...
rant