Re: Programming languages for the very young

From: Darin Johnson (darin__at__usa_._net)
Date: 01/28/04


Date: Wed, 28 Jan 2004 21:30:13 GMT

Ray Dillinger <bear@sonic.net> writes:

> Would you say that using machine code directly teaches poor programming
> practices? It has most of the same problems as BASIC: it does not force
> anyone to use any structure, has no enforcement of any particular style,
> and lends itself even more easily than BASIC to egregiously hacky things
> like punning on the bit patterns of constants and/or instructions.

Most people learn a higher level programming first, then start with
assembler later. So it's usually not a problem.

However, I did have a boss once who had learned IBM mainframe
assembler as his first and only language for ages. Then he learned
from a "learn C in X days" book. His code was by far the most
atrocious I'd ever seen (such as using strncmp to compare two
characters).

> It
> has goto, and conditional goto, but no such thing as, say, subroutine
> abstraction.

Once you learn about high level programming languages, the subroutine
abstraction is easy to create in assembler. It's not built in, but
knowing to create a proper frame and use the stack for arguments and
temporaries results in much cleaner and more maintainable code than
the person who uses globals or registers for everything.

Which brings up the facet of programming that should be emphasized the
most: maintenance. Almost all programmers spend almost all of their
programming time in maintenance. Ie, fixing up and modifying old
programs. Very often (most of the time?) this includes programs
written by other people. Even throw away use-once programs often get
recycled and develop a life of their own. Thus, being able to write
maintainable programs is an invaluable skill, while writing
unmaintainable messes is an anti-social trait.

> I would say that the unstructuredness of machine code teaches people the
> value of consciously imposing plan, structure, and design on a program
> rather than relying on the language to do it for them, and thus makes
> them *better* programmers.

But do such people learn to program in machine code _first_ and
magically develop higher level plans and structures, or do they borrow
those ideas from languages they learned elsewhere? With a good
teacher, perhaps I could see this skill forming in a person who knew
nothing but assembler, but on their own I doubt any good programming
skills will develop in a vacuum.

> And while I agree that BASIC is sort of an annoying and pathetically limited
> language, I don't see a qualitative difference in what it teaches.

Perhaps what makes the qualitative difference is that most people
learn on their own, with minimal helps perhaps from a harried teacher
or poorly written textbook. Thus the language that encourages good
style while writing small beginner programs will tend to naturally
create better programmers in the long run.

-- 
Darin Johnson
    Laziness is the father of invention


Relevant Pages

  • Re: when to use proc
    ... > point out that these are not real 80x86 assembly language statements. ... >> first assembler only app after reading the documentation. ... But remember I come from windows programming for 10 years. ... transition to Spasm was easy since the API I allready know a little about. ...
    (alt.lang.asm)
  • Re: Future of programming
    ... but again, let's not forget in my opinion the main purpose of programming, ... the more abstract the programming language ... code-generators, or even efficient compilers, which is not the case ... > fastest solution to the problem, then assembler is still needed. ...
    (alt.lang.asm)
  • A Friendly review of "Windows Programming in Assemble Language" chapter 3
    ... Programming in Assemble Language". ... Basically a commersial of HLA, and its ability to bridge the gap for asm ... ressurect HLA status to an assembler and positions HLA ...
    (alt.lang.asm)
  • Re: Survey
    ... >> There are a couple of things HLLs can do that an assembler cannot - ... >> programming population can read. ... No language can prevent the truly dedicated from writing unreadable ...
    (alt.lang.asm)
  • Re: Language design evolution vs. revolution
    ... Programmers prefer a language that is similar to what they ... I don't like typing lots of extra syntax that is unrelated to expressing ... I prefer structured programming. ... With NASM assembler, I don't have to understand what, why, or most ...
    (comp.lang.misc)