Considered harmful

A few years back, the University of Chicago hosted a great event. Students organized several day of panels and discussions, with luminaries in many fields coming to discuss the issues of the day. On a panel about technology, a friend of mine asked whether the panelists were worried that more people from our generation weren't involved in hardware, soldering whatzits and making hobby computers.

One panelist (the only person on the panel that I remember was Bruce Perens, and it wasn't him) said that he had learned to fix the carburetor on his ancient pickup back in the Stone Age, and he was entirely glad that his children didn't have to do the same. Things are easier now, and that's a good thing.

This piece about a father's bizarre quest for a BASIC interpreter would obviously disagree, and it is deeply wrong-thinking. The motives are sound, at least:

For three years -- ever since my son Ben was in fifth grade -- he and I have engaged in a quixotic but determined quest: We've searched for a simple and straightforward way to get the introductory programming language BASIC to run on either my Mac or my PC.

Why on Earth would we want to do that, in an era of glossy animation-rendering engines, game-design ogres and sophisticated avatar worlds? Because if you want to give young students a grounding in how computers actually work, there's still nothing better than a little experience at line-by-line programming.

Yes. Good. Learn to program. But not on BASIC. It encourages bad programming style and inefficient ways of thinking about program flow. In 1995, a computing great wrote that BASIC's main mechanism for controling program flow "goto" should be "considered harmful." Why inflict that on a child?

The idea that there's some programming language about which it can be said "nothing even remotely like [whatever] can be done with any language other than BASIC" is absolutely laughable. The freakish constructions that Mark shows off on Fridays are all as capable as any other language. Pascal was designed as a teaching language, use that. The author just embarrasses himself by writing: "The 'scripting' languages that serve as entry-level tools for today's aspiring programmers -- like Perl and Python -- don't make this experience accessible to students in the same way. BASIC was close enough to the algorithm that you could actually follow the reasoning of the machine as it made choices and followed logical pathways."

It's true that more advanced languages make certain things easier. Perl gives a lot of ways to avoid repetitive, mind-numbing busywork. But the Perl motto is "There's more than one way to do it." If you want to write out a program that does everything the hard way, you can.

Tags
Categories

More like this

Actually the best way to get intimate with the programming is to start with assembly language, get a small single board pic or 8051 and turn on an LED.

By ERIC JUVE (not verified) on 14 Sep 2006 #permalink

If I were learning programming again from scratch or teaching programming to someone, I would just start with C++. It is the universal programming language. If I were introducing a child to programming, I would probably teach some Visual Basic side-by-side with C++ since VB is based on BASIC and is a good tool to rapidly arrive at a contemporary windows program. I would not dig up classic BASIC and use it though. Programming language models have come a long way since BASIC and it is best to learn the contemporary methods than some of the classic kludges.

By James Taylor (not verified) on 14 Sep 2006 #permalink

BASIC is a proxy assembly language anyway. Might as well begin with assembler if you are going to start a child with BASIC. So, I guess I agree with ERIC if I believed that the first thing to teach is line by line processing and logic, but I think that teaching an OOP approach early will undo some of the confusion the pupil will face.

By James Taylor (not verified) on 14 Sep 2006 #permalink

I misstated my response. What I was responding to was the stament that "how computers actually work". Application languages are far seperated from the nuts and bolts of the underlying computer. In fact the very purpose of the high level languages is to relieve the programmer from the mundane and often error prone constructs required by the hardware model.

I would add that there is a profound satisfaction in finally seeing an LED blink while visualizing the 20 or so primitive instructions giving rise to that behaviour.

I aggree with James that if one wants to teach application programming, a modern OOP language is the proper platform.

By ERIC JUVE (not verified) on 14 Sep 2006 #permalink

After discussing this with one of my associates, I might have to agree with the father's choice. The reason you offer Josh, that there are new ways of doing everything does not help a computer programmer learn the underlying principles of computational logic or how the computer physically works. These are central principles and by ignoring the old methods, we are throwing away this knowledge. I forget that I started with Logos, Basic, Pascal and Assembly long before I learned any 4GL. I forget how I learned a computer is composed of nothing but simple transistors composed of AND gates and OR gates. I forget how I learned about bitwise operations. I forget about much of the underlying technology and how I came to understand it; because, I take for granted the current techniques available, but this neither changes how the computer works nor how I assess how to program a particular set of logic. The fundamentals are most important, because with a firm grasp of the fundamentals any language can be quickly learned and any language can be leveraged to do just about anything. Ignoring the old because of new technology does not help a programmer in the long run.

By James Taylor (not verified) on 14 Sep 2006 #permalink

BASIC is a proxy assembly language anyway. Might as well begin with assembler if you are going to start a child with BASIC.

Actually, I think that one of the old programmable RPN HPs would be great to teach assembly style programming. Man, I miss my old 41C.

Real men use FORTRAN.

Python would be my language of choice for introduction.

The syntax is easy to learn, its interpreted with a live interpreter, and its not the kludge of c++ or others.

If I was going to go the compiled route, I'd either go with C (not c++), or with pascal.

I wouldn't start someone off with C++. Better to start with an interpreted language, and not to worry about all the trickiness. You can't do much in C++ without getting intimate with big swaths of the spec.

Basic teaches bad ways of thinking. I started with Pascal (yes, I did tinker with BASIC on a C64, but not to any great effect), and mostly program C++ now. I've enjoyed forays into Perl, Java, Python, and various statistical packages. I've done some mildly tricky things in SQL.

Turing tells us that any language can do anything. But that doesn't make any language at all a good teaching language. A good teaching language will make simple features easy to use, while allowing more complex things later on. Basic doesn't scale up, and makes it harder to move to a sophisticated language later on.

And if we're going to teach assembler, we might as well just make them solder up their own computers and be done with it.

My point about learning C has more to do with learning standard syntax and scope. I have found C type syntax used as the basis for so many languages (ie. java, scripts and php) that by learning it, you will have learned the general structure of countless programming languages.

The problem with C languages is that for a neophyte programmer it is a nightmare to learn without another frame of reference. That first compile in a Hello World program can produce an intimidating exception list triggered by the absence of a single semi-colon. It hardest to know where to start and how to work with a complicated IDE.

I did recant much of what I said earlier, but a C language would still be on my list much earlier than it was introduced to me. I am just not sure where the best place to start the teaching would be.

By James Taylor (not verified) on 14 Sep 2006 #permalink

"And if we're going to teach assembler, we might as well just make them solder up their own computers and be done with it."

That's actually where I started. Those Radio Shack programmable circuit boards can teach a child a lot.

By James Taylor (not verified) on 14 Sep 2006 #permalink

Nitpick: SQL is technically not a programming language. It is a Query Language. DBA's usually know nothing about programming yet must know SQL.

By James Taylor (not verified) on 14 Sep 2006 #permalink

This is funny because Basic is prety much the most advanced language you can find for what I do.

Its either that with Basicstamp, or go straight to assembler with the 68000 (et alt.). If you want to introduce a more computer based system id go with C++, itl let you do anything fairly easily (provided its text based :) plus its low enough so you can learn strings pointers and link lists (oh my).

For a more electronic concentration, nothing beats the ease of use of the Basic stamp http://www.parallax.com/html_pages/edu/curriculum/sic_curriculum.asp

Of course im biased and I think that small scale electronics is so much more interesting:p

By Pascal Leduc (not verified) on 14 Sep 2006 #permalink

James Taylor said,

If I were learning programming again from scratch or teaching programming to someone, I would just start with C++. It is the universal programming language.

C++ is an extension of C, so it is necessary to learn the basics of the C language before studying C++. I can't think of any applications where a fifth-grader would find C++ particularly useful.

If I were introducing a child to programming, I would probably teach some Visual Basic side-by-side with C++

I think that C++ and Visual Basic would be difficult for the average fifth-grader to master.

Also, I am completely opposed to the idea of programming languages intended mainly or partly for "teaching" or "learning" -- e.g., Pascal. These programming languages just clutter up people's minds with a lot of mostly useless rules and codes -- and then people have to spend additional time learning languages that are more popular, like C. It is nearly as easy to learn the basics of programming in C as it is in Pascal. To overcome the shortcomings of Pascal, eventually advanced features like pointers and object-oriented programming were added to it so that it ended up being as complicated as C and C++. I think that people would not find learning programming so intimidating if they would just realize that it is like writing instructions for a monkey.

I took full semester courses in C, C++, Fortran 77, MS-DOS Assembly language, and Visual Basic, so I have a good idea of how these languages compare.

I'd go with Ruby (or perhaps Python) as a good starting language. They're modern, clean designs that encourage thinking about your problem rather than quirks and complexities in the language implementation or standard libraries (like C++ or Java tends to do).

While I don't think BASIC is the right language, but about that quest - it took me one minute max to search for "BASIC language for Apple Mac" on Google and find the free Chipmunk basic at "http://www.rahul.net/rhn/basic/" (use at your own risk). Maybe they should think about learning to use the computer as a tool first before worrying about programming it.

Markk, the article actually dismisses Chipmunk Basic as either too complex or too limited (he lumps it with various other things). Why exactly it isn't exactly what he wants remains obscure.

I agree that C++ is a good learning language, I'm a big fan. It has the advantage of being agnostic to the various language types. If you want to be all procedural, you can be, if you want to be object-oriented, you can be, if you want to be functional, that works, too. Then you can wander into template meta-programming and go insane.

I'd think that Python's formatting restrictions would be a nuisance for neophytes (though I guess those can be turned off).

One has to decide exactly what aspect of computing is to be taught. if you want to know the underlying operation of a Von Neuman architecture computer (if you use one that isn't VN, please let me know!), then you have to go to Assembler, but that is _not_ a good starting point for the young novice. My first program was written in Algol, the precursor to all of the "structured" languages (C, C++, Pascal, Modula II, etc), and any of those could be a starting point. The tricky part is to find a system that does not take too much work on the infrastructure needed to actuall get the "Hello World!" to show on the screen. A command-line C program is about as minimal as one can get there. Then move up to Web developer Express (free from M$) to get into UI stuff - that would be a faster entry into what will be useful than struggling with pure application programming systems. Browser deployment is the future, might as well start there soonest. "Hello World" is then just a text file you point to.

Having written a BASIC interpreter myself, I can absolutely say BASIC is nothing like an assembler proxy; its primary claim to fame is as the first line-entry interactive language. But it is veeerrryyy slooow in that PIC. (yes, OOPICs are very nice, but waste mucho cycles). If you want to really scream, use FORTH. Carefully.

"One has to decide exactly what aspect of computing is to be taught. if you want to know the underlying operation of a Von Neuman architecture computer (if you use one that isn't VN, please let me know!), then you have to go to Assembler, but that is _not_ a good starting point for the young novice." -Ianwolf

Funny thing is that at university, this is exactly where we started. We had to write our own Von Neuman machine and take Assembly right out of the gate. This was the second class right after the Intro to Comp Sci class. Most of the Comp Sci students were culled out to other majors by the Assembly class. I had tons of programming experience and worked in Assembly before taking it, so it was relatively easy for me, but it was a lousy place to start the curriculum for the neophyte Comp Sci students. During most of the University classes, most of the other students could not wrap their minds around abstracting the detailed code we evaluated into their own personal mental pseudo code. So many hours were lost with the same pointless questions about pragma statements. I was lucky because I was a total nerd about computers, so I had a distinct advantage, but the way the curriculum was structured it was obvious that there is a significant flaw in the methodology of teaching Comp Sci at my university.

By James Taylor (not verified) on 15 Sep 2006 #permalink

Python might be good for the practical reason that it would allow the user to mod Civ4

It think it depends on the educational goal of the excercise. When it comes to a car, for example, I could learn to be a good mechanic or I could learn to be a good driver. As car technology gets better, the connection between those two different pursuits gets vanishingly small.

The same is true of programming. The view of a computer as seen from a modern OO language is completely different than the view from the assembly language level. Knowledge of assembly language is not only unessential to good OO programming. In fact it is probably counterproductive.

The only goal that is served by teaching a kid assembly language is learning the basics of a CPU. If the goal is to develop a love or a skill for programming there is no substitute for the highest level language one can find that still is simple enough to operate at design time.

C and C++ are way too wedded to the solution domain from whence they came. I think teaching C++ to a comp sci student is even a waste of time these days. Modern languages are far superior, but most have a daunting development environment where kids are concerned.

The sweet spot for a kid might be Visual Basic 6. It is slightly harder than straight Basic, but the fun of the graphics stuff might offset that. Although it is not OO, at least you can organize your work in Forms and use long variable names and structured programming. Plus the development environment is fun and easy to use. A kid could learn to drag controls onto a form and stitch code into the event handlers and in no time have some real interactive programs that look like the apps he or she uses.

I taught my kids how to do that when they were young. A good demo is to drag a button onto a form and put code in the click handler to make the button move when you click it. A couple things like that and kids are hooked.

I would not recommend VB.NET unless the kid has an already established drive and aptitude for this stuff. The development environment is too complex.

It is a shame that there is not a really simple BASIC-like OO language for kids to start on. Niklaus Wirth, the inventor of Pascal, said that teaching anyone Basic was a criminal offense. Given that Basic was unstructured in those days, he was right.

A quick clarification. The article on GOTO statements referenced in the original posting refers to pre-structured versions of BASIC. Visual Basic is "structured" such that no GOTO statements are required. If Then Else, Do While, For Next, etc. are all in there.

I would teach POSTURING so the kid would fit in socially at college.