[LPT] When you’re starting out, don’t get too bogged down on “doing it right”, just do it then learn how it could be better
I see a lot of posts on here with people who have a problem and a potential solution, but get bogged down with “doing it right”. A lot of people say “I hear this is bad but I don’t know why” – and that’s a good thing, it’s good to see people questioning their code. The thing is, much like the saying “there’s always someone better”, there’s almost certainly a better way to code something.
A lot of the time, the problem you’re facing isn’t a simple one, it’s a larger issue with the overall design of your project rather than a specific bit. However, nobody starting off is going to know how to engineer a well designed system from scratch, that comes with time and usually comes from experience working with those poorly designed systems.
So don’t sweat it – write some code. It might not be the most elegant code, it might not be the fastest and it might even use some bad practices but that’s ok, learn from it. Complete the task, then look over your code and see what does and doesn’t work. What was painful to do? What was easy to do? If you look at your code and decide the easiest way to make it better is to write it from scratch again, then guess what – you’re becoming a developer and there’s not a single experienced person out there who hasn’t looked at their own code and thought the same.
As you get more experienced with the syntax of your language of choice, then you can start to learn the various design patterns – factories, singletons, interfaces, etc. Terms you might have seen or heard of but had no idea what they meant or when you’d use them. Then on top of those patterns, you’ll learn overall project designs and where the patterns fit in.
Think of it like Lego – you’re starting off with a few bricks and piecing them together. The colours aren’t always going to match and you might have to use your imagination a little to see that it’s a plane or a car, but by god that IS a plane or a car and the next time you build it, you’ll build it better.
Submitted April 18, 2016 at 06:43AM by neoKushan
via reddit http://www.reddit.com/r/learnprogramming/comments/4fb96u/lpt_when_youre_starting_out_dont_get_too_bogged/