Besides reading a book (or two), the way I learned the most was actually doing it... and I don't mean "Hello World" or variants
there of. Something challenging. This will cause you to have to research how to do things because you need to understand it. Another
great source of knowledge is looking at other peoples code. Especially if you are working on a project, look to see how other people
have tackled similar problems, BUT don't just copy other peoples code! Figure out how and why of their code and them implement your
own version. You will also find that if you look at more than one persons code you will see one person may have implemented a better
approach, see if you can figure out which way is better and why.
C and C++ allow all kinds of "side effects". This can be good and bad. Sometimes you can make very effiecent code this way and
sometimes it's more trouble than it's worth. However it you decide to use "tricks" to implement your code, be sure to document it
VERY WELL! I have burned myself by using these "tricks", yes the code was short and very fast (the good parts), however 6 months
later when I had to modify my own code, it took me 3 days to figure out how what I had done works in the first place! After than I
explained how and WHY (part of documentation and comments that are commonly left out) it worked so I didn't have the problem in the
future.
When I was learning programming I worked for a very large company and started off by maintaining existing software products. After
doing that I could see what was easy to maintain verse what was not and how effective commenting really is. There were several paces
of code by certain programmers that I swore I would never do that kind of work. I think maintaining someone elses code is good
experience and should be a requirement before someone programs any major projects.
Just my thoughts.
Dennis
z@y.co.uk wrote:
I'm doing a computer course at college and one of the modules is
programming with c++. The teacher is not very good and i have
learned almost nothing.
What is the best way to teach myself?