When Fortran was introduced in the 1950's, a common criticism was that machine code generated by a Fortran compiler could never be as optimized as hand-coded assembly language. Ultimately the claim was debunked, of course; today, it would be challenging for a programmer to produce better low-level code than a modern optimizing compiler. So why should anyone bother learning about code optimization (unless one is creating the code-generators in the compilers themselves)?

The answer is that there are times that the compiler still "needs help" in transforming your program into an optimized executable. In such instances, it is good to understand what the compiler is trying to do on your behalf. Moreover, you are more likely to use high-performance software libraries in a better way if you know a little about what they do behind the scenes.

This topic is not going to guide you in the fine art of writing hand-coded assembly routines. Most of us don't have time for that, anyway. By using a high-level language like Fortran, C, or C++, you reduce the number of programming statements by a factor of 20 or more compared to assembly, and you end up with a program that is far easier to understand. Happily for us, programming no longer consists of entering low-level commands at the operating console of a computer like the IBM 704 (pictured below), the system that Fortran was originally developed for.

IBM 704 Mainframe Console
IBM 704 Mainframe Console (image source)
 
©  |   Cornell University    |   Center for Advanced Computing    |   Copyright Statement    |   Inclusivity Statement