[NTLUG:Discuss] Lego Robots. (Was Symbolic Links)

Steve Baker sjbaker1 at airmail.net
Fri Nov 3 00:18:41 CST 2000


Richard Cobbe wrote:

> Why is the concept of moving common code into a library or the kernel so
> alien to these folks?  For that matter, why is the concept of moving common
> code so far away as a separate *function* within the same module so alien
> to so many of my co-workers?
> 
> Do these people *enjoy* fixing bugs 3 and 4 times over instead of just
> once?
> 
> I know there are some CS teachers in the audience here.  We *do* still
> teach the idea of abstracting common code out into a separate function,
> right?  I know *I* learned that back in high school!

People who were brought up in the age of punched cards were better at this.

I blame the ease of doing 'cut and paste' in modern text editors.

Where I work we call this style  "yyp" programming.  'vi' users know what
I mean!
 
> I'm wondering if it would be a good and useful thing to teach a class in
> good software design from the other perspective: giving the students the
> source to a medium-sized buggy project and having them fix the bugs.  Do
> three or four:
> 
>   * one with no documentation and bad (formatting) style
>   * one with documentation, but with buggy code repeated 4 and 5 times
>     through the project.  Ideally, include some problems that are usually
>     the result of cut-n-paste coding.
>   * one with good documentation AND good use of abstraction.

* One with documentation that's so out of date that it refers to
  completely different code.  :-(

> This, I think, would drive home the value of documentation and abstraction
> in a far more effective manner than a series of lectures.

Yes - certainly.

I've recently started playing with Lego Robotics.  I think that's an *EXCELLENT*
training ground for programmers:

  1) There is no simple way to debug a program - you have to resort to flashing
     a light when your code gets to a certain place - or beeping some number
     of times to indicate the value of a variable....or perhaps you learn to
     write code that works first time!

  2) There is only a *tiny* amount of memory in a Lego Robot's computer.  You
     have to be efficient in space terms - 'yyp' programming is definitely out
     of the question.

  3) It's **FUN**.

Obviously you still have to learn all the other stuff - like good data structures
and things like that - but from a "teaching the practical stuff" perspective,
Lego robots are a blast!

If you fancy this (and Xmas is coming!) get the Lego "Robotics Invention System"
at
about $180 - plus the "NQC" (Not-Quite-C) programming language (which runs great
under Linux and is OpenSourced).

(Don't get confused and buy the $68 "Robotics *DISCOVERY* System" because that's a
stand-alone machine that you can't program...well - you can - but only if you
already have the $180 set).

Fun, fun, fun!

-- 
Steve Baker   HomeEmail: <sjbaker1 at airmail.net>
              WorkEmail: <sjbaker at link.com>
              HomePage : http://web2.airmail.net/sjbaker1
              Projects : http://plib.sourceforge.net
                         http://tuxaqfh.sourceforge.net
                         http://tuxkart.sourceforge.net
                         http://prettypoly.sourceforge.net




More information about the Discuss mailing list