I am currently trying to break through the intermediate coder stage to advanced and needless to say it's been tough.

I have been working through several books with example code. I have felt lately that taking the example code, changing it to fit my own similar project, breaking it, and fixing it, is more effective for learning than simply re-coding line after line of example work.

Does anyone else similar or contrasting opinions? Will this method pay off in the long term?

Thoughts on this method of learning?


closed as off-topic by durron597, jwenting, gnat, user40980, GlenH7 May 14 '15 at 2:24

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking career or education advice are off topic here. They are only meaningful to the asker and do not generate lasting value for the broader community. Furthermore, in most cases, any answer is going to be a subjective opinion that may not take into account all the nuances of a (your) particular circumstance." – durron597, jwenting, gnat, Community, GlenH7
If this question can be reworded to fit the rules in the help center, please edit the question.

  • I never noticed any well-defined line between 'intermediate' and 'advanced'... – tdammers Apr 26 '13 at 10:54
  • @tdammers: Intermediate is when you think you know most things about the language / environment. Advanced is when you realize you know next to nothing about the language / environment, but you can still produce applications. :-) – Gilbert Le Blanc Apr 26 '13 at 16:23

I think you need a proper project: Find a problem to be solved, and solve it.

Doing something real (rather than hacking examples) will drill into your head all kinds of lessons: things that you have been taught that are good, things that don't work so well.

The biggest difficulty in a real project is not so much writing code, its knowing what code to write. That is, how to break up and structure the problem space. Get that wrong and the nicest code in the world is still a lousy solution.

  • 1
    +1: Indeed, the vast majority of that transition from intermediate to advanced is not in writing code, but designing programs - jumping from being able to hack together something decent to really intuitively designing something solid from the start and understanding why that design is preferable to others. – Telastyn Apr 26 '13 at 3:03

Reading other peoples code all the time is a sure shot way of improving your skills on the project. No doubt about it.

It also helps to be the dumbest guy in the team - by that I mean to say that if all the other programmers in the team are way above you in terms of programming skills it will automatically lift your level too - as long as you have the maturity to accept your limitations and ask for help. So leveraging skills of other team-mates is also important.

Reading code - apart from reading other people's code and asking them to explain their approach, pair programming is another good tool. Just sitting with a peer and observing their way of tackling a problem can set off light bulbs in you. Also make it a habit to always review your own code - old code from time to time. I recall many times when I have visited a 100+ lines of code I wrote myself 2 months back and thought it was shit and refactored it much better.

  • Learning from others is crucial. Working with and bug fixing an existing code set is a great way to not only get into a solution but under the skin of the structure. Ask how things are done and why they are done if its a new approach. – DazManCat Apr 26 '13 at 10:29

I think the most important aspect of learning is failure. When you attempt to adapt example code or implement something new and it doesn't work, you have to figure out why it doesn't work.

This is when your brain will be put to work attempting to solve the problem you have come across. And when you finally have that 'aha!' moment, what you have learned from the initial failure will stick in your mind.

It's this process that is vital to becoming a better programmer. Good programmers are good at figuring out how systems work, why they don't do what they should and how to fix them. And the only way to get good at this is to practice solving problems when something fails to work.

If you do nothing but copy code from a book and run it it will always work (assuming no typos by yourself or the book) and you miss out on the vital experience of figuring stuff out for yourself.

  • 1
    Totally! many people are scared of failure and fail to see how vital it is. How many times I have been working on a problem going round in circles then I stumble on a small error or gem of advice. I tend to remember those situations clearly. – DazManCat Apr 26 '13 at 10:27

I guess both are useful, but your coding on your own will be better.. Other's code will help, you will get to learn some things you couldn't have thought of but at that transition, it's how you think that matters.

It would be better if you take a few problems and solve them. Use other People's help when there are any problems that you can't get around. That way you will learn a lot more than by fiddling around with other's code.

When doing it all from scratch, you can understand every little thing of the code. Also, you will also learn from your mistakes(everyone makes them, and so will you).

When you type code, it's usually not what you type, but how you think of what to type, the logical analysis of the problem (and the inference/derivation of the solution) is what matters.


Absolute majority of programming work is done in a team and involves code base that already exists for some time and needs to be continuously adjusted for new requirements and features. You won't ever learn that from text book, you have to try it.

Working with other people's code is also great way to get experience how various idioms work in practice. You won't normally try to solve problem in all possible ways to see which one works better and you won't come up with that many ways yourself anyway. By reading existing code you will see various approaches to solving problems and learn what advantages which has in practice, so you can easily pick one when you need to design something yourself.

Lately there are many open source projects out there, so it should be easy to pick one that is interesting for you and contribute to it. You can start by fixing bugs or doing some small feature you think of. That's currently easiest way to get experience with some real programming work. You can even get grant for it from Google.

Not the answer you're looking for? Browse other questions tagged or ask your own question.