Studying Source Code
Hi! I''m always reading where people are recommending studying source code when learning to program. I think I know what they mean by this (read it, reproduce it, find out why it ticks) but is there a "method" or procedure for doing this? I want to know how to best benefit from this. Thanks!
I found it a great help when i was learning programming. Back in the days when you still started with lowlevel languages and worked your way up. Rather than walking the way down, as most people do now.
I remember having tons of assembler code on disks, printed on miles of tractor paper. Anyhoo, I always took a piece of code that was somehow a bit comprehensive and compiled it. Changed an value here and there and watched what happened. Then i decided that if they could make a square bounce around, I want to make two. So i modified the code until I got what I wanted.
I think the most important thing is to know what you want as a result before you start changing stuff. Nowdays there is internet and you can get whole game sourcecodes etc. But fool around with small snippets and try to modify, merge them. There is no way a beginner will be able to download the whole quake 2 engine and fool around with it. Its way too big, and takes way too much work to do stuff. Keep small goals on your way to the big one.
Also when you study code, do not try to understand the coolest effects etc. Understand whats behind it. Effects are usually small algorithms and stuff youll understand eventually. At the start, study the windows code, how they build arrays, how they set up palettes etc.
- Zorak - Neat Fella.
I remember having tons of assembler code on disks, printed on miles of tractor paper. Anyhoo, I always took a piece of code that was somehow a bit comprehensive and compiled it. Changed an value here and there and watched what happened. Then i decided that if they could make a square bounce around, I want to make two. So i modified the code until I got what I wanted.
I think the most important thing is to know what you want as a result before you start changing stuff. Nowdays there is internet and you can get whole game sourcecodes etc. But fool around with small snippets and try to modify, merge them. There is no way a beginner will be able to download the whole quake 2 engine and fool around with it. Its way too big, and takes way too much work to do stuff. Keep small goals on your way to the big one.
Also when you study code, do not try to understand the coolest effects etc. Understand whats behind it. Effects are usually small algorithms and stuff youll understand eventually. At the start, study the windows code, how they build arrays, how they set up palettes etc.
- Zorak - Neat Fella.
Domine non secundum peccata nostra facias nobis
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement