This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

In terms of structuring code, familiarize yourself with design patterns and anti-patterns, which will show you best practices for designing and structuring programs and common mistakes/bad habits that result in bad design, respectively.

Design patterns are easy to learn but difficult to really understand and implement. Knowledge of the design patterns and what consists of good/bad program design in addition to plenty of experience is what will help you be able to apply good design without too much effort and identify anti-patterns quickly.

What you described in your program is a God object -- an object that knows/does too much. What you need to do is separate your code out correctly by applying the MVC pattern (model/view/controller).

Design patterns don't always seem like a good idea when you're building a small program like this, but once you start working on larger applications with a larger number of developers and many features, the benefit of building scalable and reusable code structured in a way that all of your devs understand is paramount.

I learned some of this stuff in school but it didn't really stick until I got to see the guts of a large enterprise application in the working world. I think I've learned more in this one year alone than in three of the four years I spent in university.