Slashdot Mirror


Learning Computer Science via Assembly Language

johnnyb writes " A new book was just released which is based on a new concept - teaching computer science through assembly language (Linux x86 assembly language, to be exact). This book teaches how the machine itself operates, rather than just the language. I've found that the key difference between mediocre and excellent programmers is whether or not they know assembly language. Those that do tend to understand computers themselves at a much deeper level. Although unheard of today, this concept isn't really all that new -- there used to not be much choice in years past. Apple computers came with only BASIC and assembly language, and there were books available on assembly language for kids. This is why the old-timers are often viewed as 'wizards': they had to know assembly language programming. Perhaps this current obsession with learning using 'easy' languages is the wrong way to do things. High-level languages are great, but learning them will never teach you about computers. Perhaps it's time that computer science curriculums start teaching assembly language first."

4 of 1,328 comments (clear)

  1. Re:Assembly Language by Valar · · Score: 0, Redundant

    That's a low ID? Youngins'

  2. Re:Actually, they DON'T. by be-fan · · Score: 0, Redundant

    There was an interesting study done comparing the performance and productivity of C++ vs Lisp vs Java programmers. Results are here.

    One very interesting thing they found was that while the best C++ programs were faster, the average Lisp program was faster. Programmer experience could not account for this, since the C++ programmers were much more experienced than the Lisp ones.

    In retrospect, its easy to see why. When you write clean, straight-forward code like you would in a production environment, its much easier for the compiler to optimize high-level code than low-level code. Compilers for languages like Lisp/Scheme/Haskell/etc do all sorts of optimizations that existing C/C++/Java compilers either don't do (forgotten technology) or can't do (pointers cause lots of problems).

    My point is that programming at a higher level, in general, allows the compiler to do more optimization than programming at a lower level. Given infinite time, an asm programmer will always be able to crank out faster code than a C++ programmer, who will always be able to crank out faster code than a Lisp programmer. However, in the real world, it may very well be the case that giving the optimizer more meat to work on will result in a program that is ultimately faster over all.

    --
    A deep unwavering belief is a sure sign you're missing something...
  3. Re:4-bit Full Adder Using Relays or Vacuum Tubes by Bitmanhome · · Score: 0, Redundant

    Sure, here ya go. As a bonus, this code uses my patented Relay Acceleration Technology (RAT) that performs many times more adds then a normal relay network can handle.

    You're welcome.

    int timer=0;
    byte add(byte a, byte b) {
    if(++timer > 100000) {
    clickSomeRelays();
    timer = 0;
    }
    return (a+b)
    }

    --
    Not that this wasn't entirely predictable.
  4. Re:in reality... by shadowbearer · · Score: 0, Redundant

    Ow. My head hurts :)

    Thanks. I just wrote assembly on the damned things...circuit design I failed at, miserably.

    This is going to haunt my dreams for a week. Thanks a lot :)

    SB

    --
    It's old. The more humans I meet, the more I like my cats. At least they are honest.