Women in Technology

Hear us Roar



Article:
  Why Learning Assembly Language Is Still a Good Idea
Subject:   Modern Programmers Should Write Code in Assembly
Date:   2004-05-11 08:44:23
From:   dscotson
Response to: Modern Programmers Should Write Code in Assembly

"Don't just make your application "work and work now", make it work "better, faster, cheaper"."


I think most programmers have trouble 'just' making their applications work and the conventional wisdom seems to be that "Premature optimization is the root of all evil in programming", as originally stated by C.A.R Hoare long before we had the plentiful supplies of memory, processsor cycles and network bandwidth we enjoy today.


Where did this movement for assembler fundamentalism spring from?

Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • Modern Programmers Should Write Code in Assembly
    2004-05-12 09:24:28  kain [View]

    "Where did this movement for assembler fundamentalism spring from?"

    Are you sure the fundamentalism is from the assembly/HLL crowd who are willing to try new and different approaches or from the HLL-only crowd who are unwilling to consider change?

    • Modern Programmers Should Write Code in Assembly
      2004-05-12 14:30:49  maiku41 [View]

      I think it's a matter of perspective, with a perhaps a bit of C-programmer conceit thrown in.

      C's strong point was primarily that it was a 'high level assembler language'. It let one manipulate the underlying hardware while not having to bother with some of the details of a native assembler and not being tied to a particular instruction set. Understanding the hardware is, indeed, an important part of writing in assember or other languages which map closely to a particular hardware instruction set.

      One still needs to understand the constraints of the execution environment in higher level languages. These days, however, that is often a virtual machine rather than a physical one.

      Java programmers, for instance, have little need to understand the hardware they're running on, but can benefit from knowledge of the Java Runtime Environment. The JRE is to Java what the hardware is to C.

      Programmers using a functional language have almost no need to understand the underlying hardware except in general terms.

      Most commercial quality compilers are quite good optimizing code for their target, whether virtual or real. As long as the code is reasonable well structured, the compiler will take care of best use of the target resources (e.g. register vs. memory ops on hardware, load/store sequencing, etc). Modern CISC processors will also reorder instructions in the pipeline.

      So... I guess the point of all this is to say that, yes, it can be helpful to understand your target environment when using certain languages, but it's more important to understand the problem at hand and the tools (languages, algorithms, non-computer solutions) available to solve it.

      And yes, Premature Optimization is t3h 3vil ;)