The PowerBasic advantage

Ok, I have been programming using PowerBasic for nearly a decade now, so may I am a bit biased. Yet I do feel that Powerbasic does have some real advantages.

After having downloaded the latest Visual Studio Express version I can definitelly say that programming has changed over the years. While I do appreciate the value of RAD tools, it appears that programming has changed, possibly for the worse.

No matter what anyone suggests, programming is all about code. Yes, real programming is all about knowing how to code solutions. The problem is that the development environments being used today have over taken the coding part. Visual Studio is now all about either XAML or Intellisense coding. If modern IDE’s did not have Intellisense they would be totally useless. Why ?

There are now so many system objects associated with the programming languages now, you just could not keep track of it all without intellisense. You will likely spend more time selecting your code (from intellisense drop down lists) than actually writing any code (or at least that is my impression of it anyway).

What I like about PowerBasic is that it is a language for coders. Don’t get me wrong I value RAD tools too, but I find that nothing beats real coding. The PowerBasic core language is rich for those who need to code complex tasks which excellent performance. What is really amazing though is the compile speed.

So let me ask you a question. How long is your average compile time for say 100,000 lines of source code ?

Do you count it in minutes, even on a multicore CPU ?

Let’s take my EZGUI main runtime DLL compile time as an example. My actual source code is about 40,000 lines of code and with the API includes it uses the total number of lines compiled are:

63,210 lines of code.

The PowerBasic 10 compiler compiles this code in just slightly over 2 seconds.

The compiler reports that is was compiling at a rate of:

1, 648,956 lines per minute

Now I should point out that I compiled on my current development PC which is a Windows Vista PC which I recently upgraded to 2 gig memory, a Pentium D 3.2 ghz CPU and a cheap ($50 range) 3D video card.  To appreciate that this older dual core CPU is not powerhouse, just compare your PC’s CPU to mine on the passmark benchmark list found here:

http://www.cpubenchmark.net/cpu_list.php

Mine CPU rates as 757

The average core i3 rates at 3 to 4 times faster than my CPU does.

Many programmers have core i7 CPU’s in their development PC’s.

So even on a lowly (slower) PC, PowerBasic compile times tend to be just a couple seconds. Imagine how much work you can get done when compile time is that fast.

Add to this that PowerBasic produces executables with performance on par with the best C++ compilers and you have an amazing combination.

I was recently reading a blog article online where a programmer commented about how he improved his compile time (of about 80,000 lines of code) from about 6 minutes to a minute and half with his new computer (or CPU, not sure). For me with PowerBasic, without the benefit of the latest CPU, I am usually only looking at a few seconds. That is dramatic IMO.

Maybe in tools like Visual Studio, programmers don’t concern themselves with compile times because they spend so much time in the RAD environment and compile less often. But would have to pose the question, if they don’t compile often then how much real code are they actually coding. If you compile often, compile speed is critical to a programmer and I would venture to say that if Visual Studio is compiling in minutes rather than seconds one would get tired of that after awhile. Maybe Visual Studio can compile faster than I realize and I am just reading the wrong programmer blogs and getting wrong info, but does Visual Studio compile in literally seconds like Powerbasic does ? If not, then PowerBasic is worth a second look.

Another thing bothers me about the state of Microsoft languages in the last decade. Take a look at the software license for Microsoft programming languages. Often you find a clause which basically states you can not post (or write about) any benchmarks you do with the compiler. So how fast is your code actually executing ? Do you do inhouse benchmarks ? You may not be able to post the results on the web, but you can compare it for your own personal benefit. How well is your compiler really performing and I am not speaking about compile time ? I am refering to execution speed.

The one thing about PowerBasic is their motto “smaller, faster, smaller, faster”. I have participated in beta testing PowerBasic in the past and I can tell you that they are constantly looking for ways to improve the performace (compile time and execution speed) of their compilers. If they can squeeze a few more seconds or even milliseconds from a task, they try to do it.

Performance is also about choices and a programming language should not minimize those choices simply because they might be more low level. Powerbasic provides programmers with many choices, even if they require a little bit of experience to get the most out of it. For example, I personally use pointers a good bit. PowerBasics support for pointers offers so many different solutions for tasks which require performance. Using pointers in powerbasic is also quite easy to do. You can even call subroutines/functions using a code pointer, rather than direct calls if you desire. I use this a good bit in EZGUI so it can be dynamic and change depending upon the operating system. EZGUI polls the operating system to see if certain API’s exist and if not provide an alternative if possible. This means calling those API’s via code pointers and it works great.

I had a nice experience with one of the articles I wrote for betanews.com . When ever I mentioned PowerBasic in my articles (or comments to them) I got a lot of grief from other programmers, basically calling me old fashioned and ignorant because I use BASIC. One such commenters, because of my articles, got up enough nerve to try Powerbasic and simply put, he was so impressed by it that he changed his tune. IMO PowerBasic is what C (not C++) should have been. PowerBasic has the power of C, but the ease of Basic. Add to this amazing compile times and amazing performance and you have a great combination.

Now if you live for the latest Visual IDE, then PowerBasic may not be for you. But if you are a coder like me, who wants performace and the benefits of Basic, then PowerBasic is definitely worth a look.