3 ms·
I cannot stress this enough: learn refactoring, http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672 http://www.amazon.com/Refactoring
by InclinedPlane 16y ago
I cannot stress this enough: learn refactoring, http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672 http://www.amazon.com/Refactoring-Improving-Design-Existing-...
You will simultaneously learn:
- terminology and models relevant to software design and construction at every level
- principles of good coding and how to tell good code from bad
- the ability to redesign code as needed
- the experience and knowledge necessary to approach coding with confidence
All of these are the most critical tools you need to transform yourself from someone who sorta-kinda knows a few principles of coding to someone who groks software construction.
If I had to choose between a co-worker who truly groked the principles of re-factoring and a co-worker who had a PhD in Computer Science I would choose the former every time. It's really that important.
- jng 16y agoI don't think that's good advice for a newbie. To the OP: practice, practice and practice. It will take a long time. Months to start getting it, years to go anywhere. 10+ years to be good. If it's too hard, choose another profession. 99% of folks out there would hate programming.
- InclinedPlane 16y agoI could not disagree more, refactoring is perfect for a newbie. It's not an advanced technique, it's fundamentals. Any beginner who can write a method can extract a method. But more than that, refactoring provides the mental models and the vocabulary to talk about, reason about, and understand code. It provides well-worn expert advice about the characteristics that make good code good and bad code bad, heuristics to be able to recognize good and bad code, and basic techniques to transform bad good into good safely and effectively. There may be some advanced techniques in the book itself which won't be useful to beginners, but that's true of any programming book, and that's easy enough to skip over and return to later (especially with the organization of the canonical refactoring book specifically). A beginning programmer who has learned even the simplest of refactoring techniques (extract method, insert/remove cached value, etc.) will be able to look at a piece of code and see the ways it can be changed, and will also have a reasonable idea about which changes are more likely to improve the code. They will also have the mental models and vocabulary to talk about, reason about, and understand the code, even if only to themselves. These tools are hugely important for beginners. They can transform coding from a task filled with uncertainty, fear, and irregular advancement born from experimentation to a task filled with confidence, knowledge, and curiosity. Certainly practice a lot, but don't just blindly stumble about on your own, there's lots of good material out there, learn the techniques and then practice applying them, build up your toolkit a bit at a time until you feel more and more comfortable with coding.