I’ve been programming for around… 6->8 years, and I’ve begun to realize that I don’t really know what really happens at the low-ish level when I do something like
int i = j%348
The thing is, I know what j%348 does, it divides j by 348 and finds the remainder. What I don’t know is HOW the computer does this.
Similarly, I know that
try
{
blah();
}catch(Exception e){
blah2();
}
will invoke blah and if blah throws, it will invoke blah2… however, I have no idea how the computer does this instead of err… crashing or ending execution.
And I figure that in order for me to get “better” at programming, I should probably know what my code is really doing. [This would probably also help me optimize and… err… not do stupid things]
I figure that what I’m asking for is probably something huge taught in universities or something, but to be honest, if I could learn a little, I would be happy.
The point of the question is:
What topic/computer-science-course am I asking about? Because in all honesty, I don’t know.
Since I don’t know what the topic is called, I’m unable to actually find a book or online resource to learn about the topic, so I’m sort of stuck. I’d be eternally thankful if someone helped me =/
You should look into assembly first, and then get into compiler design. If you don’t know assembly you’ll be completely lost with compiler design. I’m personally just starting with assembly, for the exact reason you are – I want to understand what my code is doing at a lower level.
I found this resource, which is very cool: http://en.wikibooks.org/wiki/X86_Disassembly
Basically it’s an assembly book that explains some of the concepts of how higher level code is executed in assembly, and has some examples where it shows how functions etc might be generated in assembly by a compiler.