Programming Philosophy Question
I’ve completed the course up to the RPN Calculator, and currently watching the RPN walkthrough. Throughout this course, when tackling large complex codes, I find myself writing code that works and completes the Rspec, but the code during the walkthroughs tend to be slightly (or in the case of the RPN calculator largely) different. Sometimes I look at it and think “Oh hey, that’s a smart way to do this”, and in others I think “Well, mine gets the job done, I don’t see a major difference in the two different methods”.
This may sound more philosophical than anything but my question comes down to:
Is there such thing as incorrect code? Or is there only “Good” and “Bad” code?
And what would be considered bad coding vs good coding? The problem is solved in two different ways, so what is the deciding factor for which of the two would rather be used in the real world?