What Web Developers Can Learn from Assembly

300px-Half-adder.svgLearning assembly can provide a significant benefit for web developers. I recently began learning and programming assembly for the x86 processors. This is more of a refresher, since I had learned some assembly on the university VAX.  I consider learning to program in assembly some of the most important knowledge I have learned. Assembly programming taught me about how programs are processed, how memory allocated and used, and better understanding of modern computer architecture. These skills may not be directly applicable in high level languages, but it does allow us to understand the big picture.

Programming in assembly requires you to think in bits and bytes. You must allocate your own memory. You have to move data into registers and directly perform arithmetic and logical operations on bits and bytes of data, rather than just defining a for each loop and iterating through objects. Using assembly is in effect directly telling the processor which instructions to execute on which data. You learn how to do the heavy lifting rather than having a high level language do it for you.

Assembly programming can help shore up your knowledge of existing languages. One area where assembly is very effective is understanding memory management. Even though memory management is now handled by modern language with garbage collectors. In assembly we have to explicitly define how much memory we need. We may define 64 bytes for an array, rather than just defining a variable for a list and initializing the object without ever knowing how big that list is. Understanding how memory is allocated can help us minimize the overall foot print of all of our applications and be more efficient.

Beyond this experience with assembly allows you to experience how processing happens. How expensive it is to move things to and from memory and processor. How expensive and slow accessing non memory data such as disk or network resources. It gives you a better feel for bottlenecks in applications. This knowledge becomes extremely valuable when optimizing applications, and understanding how and when to make time and space trade offs.

Overall assembly programming showed me the whole picture of programming from typing in code, compiling the code, and finally running an executable.  This solidified many of the concepts I had learned, how algorithms work and why some are orders of magnitude more efficient, and how data structures are allocated and processed.  These higher level concepts directly improved my knowledge of programming in high level languages, and allowed me to make wiser technical decisions because of it.

Post a Comment

Your email is never shared. Required fields are marked *

*
*
Profile Picture

About Ian Lintner


I am a software developer, mostly web,  in Des Moines, Iowa. I take a very opinionated stand concerning development, you will never regret a simple design or architecture. My education was at Drake University in Biology and Computer Science. Offline I am recently married to my wife Heather. I try my hand at many hobbies currently I am gardening till the snow comes in.



My Current Projects


Des Moines Twitter Trends