Thursday, September 11, 2008

BASIC, Considered Harmful?


It is almost a prerequisite of Capital "P" Programmerdom to have cut your teeth on BASIC. I started with the Radio Shack Color Computer BASIC and gradually made my was to BASICA when IBM PC-compatible machines started to take over. I spent many days typing in listings and running them to my constant amazement. Additionally, hours of fun could be had at the local department store, typing in crazy loops and other likewise routines, only to find the clerk bewildered at what happened and immediately restart the machine. Of course, in those days, a restart/reboot took only a few seconds, since most of these earlier computer did not have an operating system! 

The first BASIC I used on an operating system was GWBASIC on Microsoft DOS 3.x. From GWBASIC I followed BASIC through Visual BASIC (VB) for DOS and ultimately Windows. In fact, VB helped put me through my bachelor's degree in computer science by proving
to be a quick and quite useful way to develop Windows applications. I used VB in some truly unique situations, including a GPIB sensor/instrumentation/logging system and case where 
the application had no user interface at all! 

In any event, I learned the fundamentals of programming by hacking out loops and subroutines in the first consumer/hobbyist-available programming language. Later, in my engineering experience, BASIC showed itself many times: automation and control systems, instrumentation, specialty devices (eg: bar code scanners), etc, etc, etc. Today, there is some rabble about BASIC being a poor choice as a learning language. While I would not support the teaching of computer science using BASIC as the implementation language, BASIC does live on and is a fine language to solve computing problems. Just recently, I was turned on to an implementation of BASIC that carries on the tradition. I could go on and on about BASIC.

Conclusion: BASIC is a fine computer language, and I will defend it as a practical programming language and a perfectly acceptable way to learn and experience a little bit of what it's like to be "P".

4 comments:

klrvagabond said...

Excellent points. I'm not a [Pp]rogrammer, but it would seem that there's far too much talk about which languages are 'bad' for learning to code. Any practice is useful as long as there's an understanding that no two languages work exactly the same, and that one shouldn't rely on language specific features (garbage collection is probably the most commonly mentioned) to work across languages.
An 'easy' language like basic is great for people just getting started as it allows them to make things that actually perform useful tasks without getting bogged down too much in the details. People are much more likely to practice with something that _works_ than they are to bang their head against the wall coding in something more 'proper'.

Unknown said...

My first computer was a Commodore 128. I learned programming by using the BASIC interpreter burned into the ROM. I learned a lot of fundamentals this way: variables, loops, subroutines, etc. However, BASIC can lend itself to instilling bad habits. Many of my first programs were terrible tangles of spaghetti code. It was only through years of practice and research that I learned to embrace first structured, and later object-oriented, design techniques. This required a lot of unlearning of habits that I had picked up from BASIC. Your point about the low barrier to entry is valid, and I would probably not had as much interest in programming as a 7 year old if the only language available had been COBOL. I am glad I had BASIC. However, since the halcyon days of my youth, lots of advances have been made in the field of computer languages. If I were to undertake to teach someone to be a programmer, I would likely begin with Python. It has a similarly low barrier to entry, but it has far less tendency to instill bad habits. It has the constructs necessary to teach immediate-mode, structured, and even object-oriented techniques with a minimum of overhead. (Of course, it is garbage-collected, but as much as I lament the lack of memory management skills in today's "programmers", such topics are not really appropriate for the novice.) So, I must respectfully disagree with you, and say that, while BASIC was useful in its time, that time is now past.

klrvagabond said...

I'll clarify my earlier comment a bit; it was looking at learning to code from my perspective-I'm not and probably won't ever be a proficient coder, but I am someone who has to code stuff (read: kludge stuff together and steal working snippets from everywhere I can find them, resulting in a functional, but terribly ugly mess). For someone with limited time and resources the languages that are quick to learn and use are the ones that will most likely be educational.
Those who are learning to code in a more structured manner (taking CS classes, for example) who can take the time to trudge along and learn 'the right way' are probably better off using a more structured language-though I still think that the bad habits picked up by earlier use of an 'inferior' language are probably outweighed by whatever positive experiences accompany them.
At this point I'll let it be known that my first BASIC 'programming' took place on a Sinclair 1000, so while my coding proficiency is far below the average here I can at least compete with you guys in terms of antiquity. ;)

hexhead said...

I take your point Nate, but I also agree with j. I have seen, and taught, many people that have NO experience BASIC in a few minutes. I think Python is an excellent language (see my latest post today), both for teaching and production-- are rare combination. However, I still believe some flavor of BASIC will put a smile of recognition on a users face much before he/she gets their Python script running. With that in mind, anybody programming regularly would be well-advised to get into Python quickly if not from the start. Is this comment wishy-washy or what? ;)