The end of an age ! BASIC and possibly compilers.

Where do old programmers go when they stop programming ? Is the advancement of technology always a good thing ? What happens to technologies that get old, but still are quite viable ? And where does BASIC fit into all of this ?

Let me start out by saying that by today’s programming standards I am an “old dinosaur”. Time to let me go out to pasture, some may say. Time for the young to take over. In a few years I will hit 70 ! So what does an old dinosaur have to offer ? Experience. Hard lessons learned.

When I started programming in the 1980’s, it was the “wild west” of programming. Only “geeks” dabbled in computers. The home computer (aka. Commodore 64, Atari 400/800, Texas Instruments TI99/4A, etc.) was making it possible for the computer to breach the home market. Not cheap though. Starting in the many hundreds of dollars (likely would be compared to $1000 or more in todays value), it was still not easy to come by. Fortunately, I picked up my first computers when the market prices hit clearance levels, even picking up a TI99/4A and some Atari 400’s for just $50 each at a Roses store. I spent a good bit more for a Commodore 64 and started buying computer magazines like Compute Gazette to learn more about programming. Bought what I still think was the best book on 6502 machine language, I began to dabble into machine language. To understand the actual hardware under the hood was amazing.

It still amazes me today when I hear todays programmers, “trash” the BASIC language saying it is a beginners language and only an interpreter. All I can say is that unless you were there in the 80’s (the wild, wild, west) you don’t know what you are talking about. You see, back in the 80’s as a BASIC programmer, I was already tapping into machine language, learning how to expand the built in BASIC interpreter, using hooks into its core engine. The books that came with the Commodore 64 actually showed you how to do this. Magazines like Compute Gazette were teaching us how to tap into machine language and showing us all sorts of tricks to push the hardware to the max. For you dot.net and also Python programmers out there today, try to work with a Computer that had a processor which was only 1 megahertz with 64 Kilobytes of ram. Todays Arduino’s and PIC chips are more powerful than what we had back then. If there was one thing we learned back then was that one needs to fully grasp the low level features of the computer and find ways to push the hardware to the max. Performance was everything. So BASIC programmers like me, began to search for better ways to program to get more performance out of minimal hardware. Guess what we BASIC programmers gravitated to ? C compilers, Pascal, Python ? No we gravitated to BASIC language compilers. Yes, BASIC was also a compiler. I started with the ABACUS Basic language compiler and wow it made a difference. My apps would now run 10 times or more faster than the built in BASIC interpreter. Programmers like me never looked back. From then on, if a BASIC language compiler was available, I used it. I also used bits of machine language when even the compiler did not produce fast enough code. The problem with raw power and performance, was not the BASIC language. It was using an interpreter. You see, when a CPU is running at 1 mhz. you need to do everything possible to push the hardware. I even used the ABACUS compiler to write my own compiler, which was a subset of BASIC and I wrote my first family friendly video game using it and sold it to Compute Gazette and earned myself $1500. My programming now turned into a way to earn a living.

I started to look for ways to earn money doing programming. Back then, there were few programmers and very little one could buy off the shelf. Custom programming was one of the few ways a business could tap into using computers. I fell into an opportunity to do some custom programming for a local factory, which made valves for heat pumps. They had a machine which tested their valves and could upload test data to a computer. CPM (operating system popular before DOS) running on Z80 chips were the current computer of choice at the time and there were no BASIC compilers available (that I knew of), so I was forced to work with a BASIC interpreter again , called GWBasic. I really loved the Kaypro brand portable computers of time (albeit they were very bulky and heavy for a portable device). Fortunately CPM computers ran much faster than say a Commodore 64, which compensated performance wise. I still had to resort to machine language at times for key code which needed maximum performance. I earned some good money writing custom software for the quality control engineer in the plant. Also had to learn how to write code for a variety of dot matrix printers as well. Epson was the standard at the time and later I learned how to send data to HP Laser Jets. I missed the compiler though. CPM computers were way too expensive for me to purchase, so I used the computers at the factory to write the software.

In time the IBM PC and compatibles took over the market. CPM quickly disappeared. At a local Flea Market I was able to purchase a used Blue Chip brand IBM PC compatible. It was not cheap, but much cheaper than new. I sold most of my home computers to a guy interested in them and used the money to buy my first IBM PC compatible computer (used). With a slow processor, green monochrome screen (which could emulate CGA color using shades of green) and a floppy disk I was off and could now start writing software for DOS PC’s. My first big opportunity was a local machine shop which was looking for a programmer. The owner, who became a long time client, was very business savvy. He had just purchased two Radio Shack computers running DOS for $5,000. He went to the local community college looking for help in getting some software for them. Someone in the computer department told him, be prepared to pay 5 times what he did for hardware for custom software. Now $5,000 was a lot of money back then (early 90’s), but $25,000 was just way too much money. He found out about me and when I showed up, it only took a hours discussion with him about his needs and he knew I was the guy for the job. I was only charging $9 an hour to do custom programming back then, since I tended to undervalue myself since I was a self taught programmer. So for a few thousand dollars, by time I finished, I had developed software which did job tracking of the all of the machines in the shop, did job estimating and also tracking shipping of the finished jobs. All done using a BASIC interpreter.

In time Microsoft came out with Quick Basic and I purchased QB 4.0 and did not look back. Once again I had a BASIC compiler and I reworked my clients software using a compiler for better performance. I could also use machine language along with QB 4.0 and I wrote some libraries in that. Eventually I ended up using Microsofts PDS 7.1 Basic compiler. It became my goto programming language of choice. I did more custom work for local clients (and even one far away remotely, before the internet). BASIC as a language not only was much faster now, but the language was being enhanced with concepts found in other languages, particularly Pascal. BASIC never lost its core syntax, but simply took the best of other languages and added a BASIC version of it. In the BASIC world, backward compatibility was important. Old code still worked, but new features were made available. At this point in my programming experience I began to learn important lessons, which I learned about how to accomplish the most in programming. and to embed them into my programming style.

Lesson 1: There is no need to ruin a programming language when new features are added. Backward compatibility can still be maintained. Best to use a programming language that follows this rule.

Lesson 2: It is best to stick to one programming language (also machine language as an aside) and become a master of it. The old say of a “jack of all trades, but master of none” has real meaning. Better to be the master of one programming language is my experience. As long as the language provides all the core constructs needed, then learn to master it. Push it to the limits.

Note: This does not mean one can not learn other languages. But to tout how many programming languages one knows is not the sign of an excellent programmer.

There are benefits to a language like BASIC. A term used to describe it, by those who really know, is that it has a natural syntax. Computer programming is complex enough, but the more terse a language is the harder it is to read the code and debug it. Being able to write code and then go back to it years later and being able to make sense of it, goes a long way in producing quality software. Also a key lesson for producing good code in any language, especially BASIC, is the use of modular design.

Myth number 1: Modular design does not mean it has to be object oriented. Procedural programming languages, like BASIC, C, etc. can be written using modular design without using any OOP.

So what is modular design when using BASIC or any other procedural programming language. It simply means writing code which is reusable. In a procedural language, reusable code is either a Function or Subroutine. Simply put, for a BASIC programmer, this means writing code as libraries. Library code can be fined tuned to the point that when one builds an app upon it , the end result is a more reliable app. (more about this later).

I began to build complex libraries of reusable code and was able to use it for multiple custom programming projects. The end result was extremely reliable software. Over the years I wrote software for point of sale (POS), engineering, job tracking and more. Some of my customers used the applications I wrote for 10, 15 and over 20 years.

When Windows came along it was a time of great change for BASIC programmers. Many DOS BASIC programmers who wrote successful commercial software, could not make the jump to Windows. In the 16 bit years, one could only write software using C and required an understanding of the Windows API. Microsoft eventually came out with Visual Basic 1.0 for Windows. It was a big hit and introduced the world to visual design of applications. Even C was left behind for awhile when VB came out. Now the so called “citizen programmer” could easily write Windows software using easy drag and drop design and using a long time popular language of BASIC. The 32 bit versions of Windows came out with the transition to 32 bit OS’s such as Windows 95. So called “Classic Visual BASIC” had done what no other programming language ever could do. It made programming for the “masses” , as well as professionals, a reality. Third party support for the language made Visual Basic likely one of the most successful programming languages ever.

Sadly, a good number of older DOS BASIC programmers could not make the jump or at least it took them some time. This was not the fault of BASIC as a language. It was not the fault of Visual Basic. It was quite simple really. Windows was a multi-tasking operating system and DOS primarily was not. Windows was event based, while DOS was not (one could use hardware interrupts, but that was very low level and typically not something BASIC programmers usually dealt with). DOS programming was more linear in nature, so the event model of Windows may have been confusing to some. Lastly Windows was a Graphic User Interface OS and required the addition of a new concept for dealing with the user interface, which Microsoft chose to use COM (Component Object Modal). ActiveX was based on COM as well. This is what likely confused many a DOS BASIC programmer. Visual Basic’s implementation was relatively simple so many DOS BASIC programmers were able in time to grasp it. But something unexpected happened.

Lesson 3: Compilers were still the best choice for performance software, even on Windows. BASIC programmers also recognized this and they clamored for more raw power, especially in the Windows world.

Something similar and akin to what BASIC programmers experienced in the days of the Commodore 64 happened with Visual Basic. Quickly VB users realized that Visual Basic was not as fast a C. Not because of a flaw in the core language syntax, but simply because Visual Basic was not a true native code compiler. It was a PCode compiler. While faster than an interpreter, a PCode compiler still was no where near as fast a true native code (machine language) compiler. Imagine if the first version of Visual Basic was actually a native code compiler ? It is quite possible that the C language could have faded away and all professional programmers would have used BASIC. But C programmers had an edge. They could write high performance apps and libraries (most ActiveX components were likely written in C) and had easier access to the Windows API. In time though the pressure for more, pushed Microsoft to give BASIC programmers the raw power they wanted.

Visual Basic eventually became a native code compiler (version 5.0 was the first I believe) and from what I gleaned in some research on the internet, Microsoft had to use a C compiler backend to accomplish the task. Over time many a book author wrote books on how to access the Windows API using Visual Basic. The headers for the Windows API were all in the C language, so this required porting C header code to acceptable Basic code so VB programmers could make the calls to the WIN32 API. Visual Basic though did lack some language constructs which still made some tasks either difficult or impossible to do, since it require constructs found in C which VB did not support. C still had the advantage.

So one serious weakness in Visual Basic (classic) is that it was not built from the ground up as a native code compiler with support with core features needed to talk directly to the operating system. I consider this the biggest mistake ever made for the BASIC language. It may have been the first nail in the BASIC languages coffin. Learning later than Microsoft did not create Visual Basic themselves from scratch, but simply purchased the core software from another company and turned it into Visual Basic is likely why this serious flaw occurred. Microsoft saw the benefits of Visual Design and that was the motivation for Visual Basic, not a new low level programming language to replace or compete with C.

Lesson 4: The failure of BASIC in the long run was not some inherent flaw in the language itself. It was Microsoft’s lack of insight into the need for Windows languages to be a native code compiler. Visual Design alone while great, could never trump a native code compiler. Both were needed.

Another player in the BASIC market was running parallel to Quick Basic and later Visual Basic, but was in many ways kept in the dark for a number of reasons. Who was this player ? It actually started back in the DOS days with a company who competed with Microsoft in the programming language market. It was Borland. Borland tried to compete with Microsoft with its own programming languages and a few stand out. Borland competed with database products, a C compiler and a Pascal compiler. The C compiler and Pascal compiler still exist today as Borland sold off its tools and they eventually became the Embarcadero programming languages. You can still get those quality compilers today, albeit under a different brand. They made the transition to Windows as well (Borland competed in the DOS days and then later in the Windows market). One of Borland’s fine compilers was a direct competition to Microsofts Quick Basic and was called Turbo Basic. Borland purchased the rights to this compiler from its creator Bob Zale and Bob worked for Borland for awhile improving the compiler. Turbo Basic in many ways was superior to Quick Basic, but in the end Borland could not compete with Microsoft and sold off its IP. Turbo Basic though was not sold off to Embarcadero like some of the other languages, but the original developer Bob Zale got the rights back to it and created his own company called Powerbasic.

Lesson 5: Powerbasic created what Microsoft could not, a true native code compiler for Windows with the raw power to do many of things C was good at. A native code BASIC compiler was not only viable, but really existed. Again BASIC was not flawed because of the language and a real compiler was doable. Borland’s legendary Turbo BASIC compiler lived on. Also Powerbasic demonstrated an aspect of compiler design which has been long lost. Powerbasic because it had its origins in the DOS days, recognized that the speed of the compiler process was also important. The faster a compiler could process source code, the quicker a programmer had results and the need for an interpreter became less important. In the old days of C compilers it was often joked about how having to wait for the compiler to finish one could take a long coffee break. Turbo Basic and later Powerbasic demonstrated this was not necessary. Both languages were written in pure assembler and not C, so the compiler itself ran at lightning speeds. Even with all the powerful computer hardware of today, compiler speed is still important.

I came across the Powerbasic compiler after using Visual Basic for a few years. I liked VB, but its lack of performance and low level features made me realize I needed to look for something better. Powerbasic was a small company and sadly did not have the resources of big companies like Borland or Embarcadero. If it had, I have no doubt that it would be one of the most powerful programming languages today. Powerbasic has to move along at a snails pace, while the big players in the market could move along at high speed. This does not mean Powerbasic failed though. It simply took longer for it to make strides forward. Bob Zale, is creator was a genious, IMO. The skills for writing an optimized compiler in pure assembler is a lost art and his death in 2012 was a huge loss to the programming world. Fortunately for me, I started with Powerbasic while Bob Zale was at his peak. I started with a 16 bit version of Powerbasic and then to the 32 bit compiler. I was doing some beta testing for a company who had a product called Media Forge. The original programmer, an amazing C programmer who lived in Utah, gave me a chance to beta test their multi-media development tool. I was writing some utility apps for it using Visual Basic and I remember he moan about all dependencies VB had. I couldn’t even display an open file dialog box without an extra ActiveX control. I had been dabbling with Powerbasic and I wrote a plugin for MediaForge which was a DLL and the C programmer commented on how good it was. One could have thought I wrote it in C. But I wrote in in Powerbasic.

Lesson 6: A native code compiler, even one for BASIC, which can access the Windows API directly could compete with C. If one could learn the low level WIN32 API and tap into using a native code BASIC compiler, one could produce amazingly fast and powerful software which could rival anything written in C.

Powerbasic had a serious flaw (at least for most Visual Basic programmers who might consider it) and that is that while Bob Zale knew compiler design, he did not have the time and resources to become an expert with the WIN32 API. The 16 bit version of Powerbasic did not have a visual designer or even a GUI command language, so use of it was left to using it to write DLL’s for other languages, including Visual Basic. The first 32 bit version also suffered from this. knew that if I ever wanted to be able to write full blown Windows apps with it, I needed to learn the Windows WIN32 API. Sadly accessing the WIN32 API directly was going out of fashion and finding books about low level WIN32 coding were getting harder to find. There were no libraries to make it easier either. In the C world programmers resorted to MFC (Microsoft Foundation Classes) and later other technologies. But something was going to make nearly all WIN32 programming almost obsolete. It as called DOT.NET .

In hindsight DOT.NET was not an improvement over early technologies, at least when it came to getting the most out of Windows, especially in performance. It was Microsoft’s grasp at cross platform development. JAVA was a real competitor for cross platform. It succeeded in some ways, especially with cross platform development and especially the web. But what about Windows ?

Lesson 7: DOT.NET was to cross platform developments benefit, but to native Windows development a failure.

That may sound a bit harsh, but it is true. DOT.NET is bloated and requires huge resources. Computer hardware has come a long way, but much of its raw power has been lost to bloated software. I used to develop software using Powerbasic (and my own GUI library which targets the WIN32 directly) and my main development PC used Windows 95/98 (even though ME,VISTA and XP existed) and it only had 128 meg ram on it (and a slow CPU). Todays PC’s get bogged down with 4 GB of ram and most require at least 8 GB or more. Most software runs slow compared to the capability that today’s hardware provide. Now an app written in pure C (or Powerbasic) which calls the WIN32 API directly can runs circles around most dot.net apps. Native Windows desktop apps (still used by many businesses today) suffer because of all the bloat in software. The lessons learned by us old time programmers in trying to squeeze every bit of power out of a computer have been totally lost. While BASIC is maligned by many as old and obsolete and “just an interpreter”, the same people tout the benefits of languages like Python which are simply an interpreter. Python is just the modern replacement for BASIC, but has not learned the lessons long time BASIC programmers have learned. Back in the 80’s Commodore 64 programmers were using BASIC compilers. BASIC has a better natural syntax than does Python in many ways. BASIC has taken some of the best features from other languages and putting a BASIC spin on them added them to the language.

Well, it may be time for this old dinosaur to move on to more important concerns than the current state of programming and all the lessons lost in time. As a parting note, let me say that BASIC has been a good friend to this programmer over the years. BASIC is not dead yet, though many have tried to bury it over time. Even Powerbasic has faded away (even though I still use the compilers I purchased years ago). It is a long sad story which I will not go into (but maybe someone smart might consider buying the IP rights to it before it is lost forever). But BASIC still lives. There are a number of indie BASIC compilers out there.

Just for fun, for the sake of this old dinosaur, why not download two sample apps which use my GUI library written in Powerbasic. You might be surprised!

Demo app which demonstrates GUI engine features which only use the WIN32 API:

http://cwsof.com/download/testwin8.zip

Demo which demonstrates GUI engine using OpenGL directly:

http://cwsof.com/download/ezmodvw11.zip

100% written in Powerbasic !

GUI engine (DLLs) are over 50,000 lines of Powerbasic code which calls WIN32 directly for all GUI features.

Absolutely no DOT.NET !

Entire GUI engine is only about 1 megabyte in size and could fit on an old fashioned floppy disk.

Can run on any version of Windows from XP to Windows 11

Lesson 8: BASIC is not dead. WIN32 programming while a lost art, is not dead. Basic has been a compiler since the days of the Commodore 64.

Lesson 9: A smart entrepreneur who sees what BASIC has long been and its real potential even today, could start a programming renaissance by taking some of these lessons to heart. The programming world, especially “citizen programmers” are just waiting for the next generation of 100% native code BASIC Windows compiler. Forget DOT.NET (leave that for cross platform) and embrace the WIN32 API taking advantage of its raw power. You might be surprised at the amazing software one could write with it.

Time for this old dinosaur to move on to better things like wood working, CNC, 3D printing, embedded microcontrollers and more. Have a nice day ! If you are a long time BASIC programmer feel free to make a comment and say hello.

Oh, before I fade away, I would like to leave those who are yearning for more ways to tap into the raw power of Windows (using an native code compiler you like) something to read. This web page list of some of the best books I have read about low level WIN32 programming, OpenGL, etc.:

https://cwsof.com/softdev/resource.html

I read some of then cover to cover. May be hard to find them since they are older books.