View Single Post
Old May 31st, 2007, 8:48 PM   #5
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,007
Rep Power: 5 lectricpharaoh will become famous soon enough
Learning assembly can give you an idea of how things work at the machine level, which may help you understand why certain practices are better than others. That said, don't try optimizing your code by rewriting it in assembly unless a) you are an excellent assembly-language programmer, b) you don't mind tying it to a specific architecture, and/or c) your compiler is too brain-dead to perform advanced optimizations (this is not true of mainstream C/C++ compilers these days, which optimize the fuck out of your code if you give them the chance).

If you're thinking of writing an entire program in asm, it's probably a waste of time unless a) it's strictly a learning exercise, or b) you have hard constraints on the size of your program.

Having said all that, I'd like to refer you to this excellent article on code optimization. Read it, bookmark it, and read it again. Some of the more technical stuff is a tad dated, but the principles are as true today as they were when it was written.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote