Friday, June 03, 2005

What's my story?

As an implementor of BASIC, where am I coming from?

The home computer, a way back machine - In regards to the BASIC programming language, I think my strongest formative influence comes from working with old home computers. There was something wonderful about these machines that plugged into the family television set. They were simple when compared to computers now, and you could get your mind around them. You could master the whole computer because all of the details fit in a 5x8" spiral bound manual a couple of hundred pages long.

Personal Mastery - Perhaps similarly, I used to work on my own cars. I loved working on old Volkswagen Beetles, and I owned a bunch of them. I knew pretty much everything about the Beetle, and I loved knowing all about it. It's about that feeling you get when you master something. Nowadays I take my cars to the experts because I simply cannot understand the new cars. If it breaks down, I call a tow truck. It's harder to love cars today. This is how computers have become.

Interactivity - Let's see. Just like you can take the parts of an old car and flip them over in your hands, see how they fit together and what makes them tick, programming in BASIC on a home computer was like that. You could stop your program, look at variables (flip them over in your hands, so to speak), execute a little line of code on the fly, and resume execution at any point. If you wanted to mess with the video mode, or tweak the sound, or read/write some memory value, you could. The very nature of the machine permitted it. There is was, all laid out before you like clay in your hands and it was not so vast that you were overwhelmed by it all.

BASIC today - So I really feel that if at all possible BASIC programming should still be like this, but it mostly is not. Most BASIC languages today are compilers. This means that once you start to run your program, you cannot just stop it and tweak it. You can't change the code of a running program without needing to restart the program from scratch. In addition, the huge functionality of modern operating systems inspires programming language implementors to continually make their BASIC languages bigger and bigger. This is an artificial barrier to personal mastery.

The reverse 80/20 rule - Okay, since only 20 percent of the Windows operating system functionality is needed 80 percent of the time, why create a programming language that tries to embrace all of it? Home computers did most of what a computer is useful for, and compared to computers today they didn't do much of anything. The reality is that an awful lot of useful things can be done with a very small language.

Small is beautiful - Balance is also beautiful. BASIC should try to strike a balance between being small, and also supporting the most often needed features of Windows, the Mac OS or whatever operating system it runs on.

Aesthetics matter - How does your BASIC language look, like BASIC? I'm not kidding. Many programming languages today that call themselves BASIC don't look anything like BASIC. Tacking ideas and syntax onto BASIC from other languages only complicates things. If it doesn't look like BASIC, it isn't BASIC. I don't mean this in a snobby way. I just think that the feel of the original language is worth preserving because it had a nice simple down to earth quality. Removing that quality also removes some of the fun, and I don't see why we need to do that. ;-)

5 comments:

Dave B. said...

"How does your BASIC language look, like BASIC? I'm not kidding. Many programming languages today that call themselves BASIC don't look anything like BASIC."

If you ask the people at True BASIC if any of the other languages are BASIC they might tell you no (since they are the inventors of it). The BASIC clone that I use now (not Liberty BASIC) looks unmistakably like BASIC. But look is not the most important aspect of a language (after all how many users of software EVER see the source code?). What matters to them is function. What should matter to programmers and developers is function too.

You may look back at the old syntax with nostalgia, but don't fool yourself, that command set of PRINT, INPUT etc is geared more toward console programming than windows. Event driven windows programming requires additions to that BASIC command set.

Here's an example from nature: It only takes 5 base pairs of acids to create a DNA molecule. With a set of DNA molecules you can create genes and with genes you can group them into chromosomes. With 46 of them I can make a human. Yes, that's more than 5 acids to play with, but the complexity of having to design a creature with only 5 base pairs is daunting compared to what I can do by messing with genes or chromosomes. The key here is something called abstraction. There are natural forms (like arms and legs) that are useful and I can simply place them where I want by manipulating genes. In the computer world, these arms and legs are called “controls,” “gadgets” or “widgets” (established useful structures)

The problem with much of the old syntax is that it has not kept up with where programming has gone. To say that BASIC must look like the original in order to be BASIC is just silly (my car doesn’t look like a model T but it is still a car—would you want to commute to work in a model T?). BASIC is not defined solely by it's command set, but also by its syntax and grammar. I use a BASIC that has many more commands than the original and it still is unmistakably BASIC.

Which line is more clear:
print #TextBox$, "!contents? Text$"
or
Text$ = GetTextboxText(#TextBox1)

In the first line it looks like I’m printing something (but I’m not). The beauty of the latter line is that it clearly says what it is doing and the command itself can act as the variable Text$ as in:

IF UpperCase$(GetTextboxText(#TextBox1)) = "YES" then...

This is something the former syntax does not allow. It turns out that this form: Var = Function(Arguments) is very powerful. It allows feedback that is not available from the old BASIC syntax. Like: Result = OpenFile(#hndl, File$)

Did the file open correctly or not? "Result" will tell you. In Liberty BASIC [Open File$ for input as #hndl] does not give you any feedback.

I welcome the additions to BASIC that enable this sort of simple syntax and programming. I can show you how much more simple and elegant my coding is now. And yes, it looks like BASIC (so it must be BASIC).

I hope this nostalgia over the old BASIC command set and the "small is beautiful” fallacy won't hold LB back from evolving into something really useful (which is what programming languages should be).

JohnM said...

After reading what both you and carl have written in several posts, my opinion is that there is room in the programming world for both philosophies. I'm one of the "hobbyist" programmers who find that Liberty BASIC is all I need. Building a small program is like putting a puzzle together, or building a plastic model.

When I want to do some event-driven programming, I fool around with MS Access and its VBA shadow. I find that I get enough of that soon enough--and retreat back to my BASIC hobby. I think there are many who want to stay in the event-driven world, and also many who want to stay in the hobbyist BASIC world, so both of you have a bright future...

Oli said...

I just found Just Basic, and I am very impressed. Having read your story, I would agree that things are getting too complex - almost as a way of justifying their existance.
Like you, I did programming on the old 80's home computers, and then went on to play with cars and motorbikes, in my case.
I have spent the last 2 days trying to find a simple version of Basic to write a program I have had in my head for years - but never got around to writing, because every programming tool I could find just involved too much learning to justify the end result!

I have a request, although it might be going a little against the grain, but would you consider porting Just Basic to Linux?
I use Linux for a two fold reason - it's not produced by a liciencing hungry corp. and it allows me to use a Pentium 233 for my day to day internet useage - that's just not possible with a Windows OS!

Anyway, I am now subscribing to your blog, and look forward to playing with JustBasic on the work Laptop!!

Dan U. said...

I was daydreaming about how to improve programing, and I was thinking, why not WikiBasic? This would be an online Wiki, with imbeded source code. Each page could be an in-depth explanation of a function. These functions could be called by other pages. You could download an ActiveX plug in that would be a Basic VM, so you could run any program on the Wiki. The whole world could contribute code to the site. Anyways, just daydreaming... :)

milf said...

black mold exposureblack mold symptoms of exposurewrought iron garden gatesiron garden gates find them herefine thin hair hairstylessearch hair styles for fine thin hairnight vision binocularsbuy night vision binocularslipitor reactionslipitor allergic reactionsluxury beach resort in the philippines

afordable beach resorts in the philippineshomeopathy for eczema.baby eczema.save big with great mineral makeup bargainsmineral makeup wholesalersprodam iphone Apple prodam iphone prahacect iphone manualmanual for P 168 iphonefero 52 binocularsnight vision Fero 52 binocularsThe best night vision binoculars here

night vision binoculars bargainsfree photo albums computer programsfree software to make photo albumsfree tax formsprintable tax forms for free craftmatic air bedcraftmatic air bed adjustable info hereboyd air bedboyd night air bed lowest pricefind air beds in wisconsinbest air beds in wisconsincloud air beds

best cloud inflatable air bedssealy air beds portableportables air bedsrv luggage racksaluminum made rv luggage racksair bed raisedbest form raised air bedsaircraft support equipmentsbest support equipments for aircraftsbed air informercialsbest informercials bed airmattress sized air beds

bestair bed mattress antique doorknobsantique doorknob identification tipsdvd player troubleshootingtroubleshooting with the dvd playerflat panel television lcd vs plasmaflat panel lcd television versus plasma pic the bestThe causes of economic recessionwhat are the causes of economic recessionadjustable bed air foam The best bed air foam

hoof prints antique equestrian printsantique hoof prints equestrian printsBuy air bedadjustablebuy the best adjustable air bedsair beds canadian storesCanadian stores for air beds

migraine causemigraine treatments floridaflorida headache clinicdrying dessicantair drying dessicantdessicant air dryerpediatric asthmaasthma specialistasthma children specialistcarpet cleaning dallas txcarpet cleaners dallascarpet cleaning dallas

vero beach vacationvero beach vacationsbeach vacation homes veroms beach vacationsms beach vacationms beach condosmaui beach vacationmaui beach vacationsmaui beach clubbeach vacationsyour beach vacationscheap beach vacations

bob hairstylebob haircutsbob layeredpob hairstylebobbedclassic bobCare for Curly HairTips for Curly Haircurly hair12r 22.5 best pricetires truck bustires 12r 22.5

washington new housenew house houstonnew house san antonionew house venturanew houston house houston house txstains removal dyestains removal clothesstains removalteeth whiteningteeth whiteningbright teeth