Re: Programming languages for the very young

From: Michael D. Ober (obermd-._at_.-alum-mit-edu-nospam)
Date: 01/28/04

  • Next message: Soren Kuula: "Re: Writing Unicode-16 to a text file"
    Date: Wed, 28 Jan 2004 15:56:54 -0700
    
    

    "Ray Dillinger" <bear@sonic.net> wrote in message
    news:4018234F.E0A1ACEB@sonic.net...
    > abstraction.
    >
    > Before you tell me that assembly has subroutine calls, note that I am
    > talking about machine code here; I know that there are assemblers which
    > package up subroutine patterns as macros, but I'm not talking about a
    > macro assembler language, I'm talking about machine code, or equivalently
    > a non-macro assembler.
    >
    The last time I looked, all processors except the IBM mainframe processors
    have machine level SUB and RET instructions. These are the two instructions
    required for subroutines. Yes, some assemblers allow you to put the
    registers on the SUB call line and the assembler packages the sub for you,
    but the underlying stack and register manipulations are done via a hardware
    level instruction pair - one to create a new stack frame and one to unroll
    it.

    As for VB 6, it has a lot of high level memory management features that C
    and C++ can't touch. You never have to deal with a pointer except when
    referencing Windows API functions that call for a pointer to a buffer. You
    also don't have to deal with memory leaks and uninitialized memory on the
    heap. You can event force the compiler to require variable declarations
    (but not types, unfortunately).

    You can write garbage in any language - you can also write maintainable code
    in any language. You just have to understand the structure of and how to
    implement program design so that the program is maintainable.

    Is VB the best language to teach programming, probably not. But neither are
    C or C++. VB forces some quirky structures simply because it's not truly
    object oriented and it allows global variables (I consider them to be the
    data storage equivalent of "GOTO"); C++ because you have to spend a lot of
    time thinking about memory management (which is ok if that's what you're
    trying to learn). From a standpoint of learning how to structure software
    for correctness and maintainability, I'd pick CLU as it only readily allows
    one major bad habit - putting your control structures too low in the code.

    Mike Ober.
    CLU, Scheme, FORTH, Intel Assembler, VAX Assembler, IBM BAL (Assembler), C,
    C++, VB, Clipper 5.x, Motorola 68xxx Assembler, Pascal


  • Next message: Soren Kuula: "Re: Writing Unicode-16 to a text file"

    Relevant Pages

    • Re: translating Python to Assembler
      ... program in machine code, which is all 1's and 0's. ... assembler has to be compiled in order to convert the opcodes to ... IMHO this "compilation" if trivial compared to HLL ... since it's just a translation from opcodes to numbers ...
      (comp.lang.python)
    • Re: Instr()
      ... Microcode was used only during the design of the chip and was not accessible thereafter on most machines on which that processor was installed. ... I meant that writing machine code can be done either with or without the help of an Assembler, and that writing it without the help of an Assembler is a quite different and much harder task than using an Assembler. ...
      (microsoft.public.vb.general.discussion)
    • Re: MSIL or Bytecode taught instead of ASM
      ... efforts of the "high level language" communities, ... spent learning any given assembler or assembly language. ... said IL (unlike the basic architecture). ... traditional VM (the high or low-levelness between bytecode and machine code ...
      (comp.programming)
    • Re: Instr()
      ... Microcode was used only during the design of the chip and was not accessible thereafter on most machines on which that processor was installed. ... I meant that writing machine code can be done either with or without the help of an Assembler, and that writing it without the help of an Assembler is a quite different and much harder task than using an Assembler. ...
      (microsoft.public.vb.general.discussion)
    • Re: Assembler?
      ... Machine code IS assembler.. ... Compliers immediately introduce TRANSLATION from high level language to opcodes etc. ... Or it MAY use spare registers, or the processor MAY have a data stack pointer, or indeed any other method the compiler writers feel is optional may be used. ...
      (comp.os.linux.misc)