Jul 06 2008
Why BlitzMax
This was intended to be the preface chapter of a book that I was planning to write about the BlitzMax programming language. I am no longer sure if this project is ever going to happen; BlitzMax only occupies a very small niche in the language market, and I am not convinced that a mammoth project in the magnitude of ‘BlitzMax - The Definitive Guide’ makes any commercial sense. An endeavor of that size would keep me busy for at least a year, probably more, in full time. And when there is only a market of a few thousand users, this will never justify itself. Unfortunately, I also have to make a living somehow. But maybe this little article makes a strong enough case for the BlitzMax language and will help to interest new users in this wonderful development tool.
Why should you learn BlitzMax and not one of the ‘fancier’ languages like Java, Python, C# or C++? After all, BlitzMax is just a niche language for game programming, developed by a very small company from New Zealand and supported by only a small community of game programmers. It is not commonly used in the industry, there are virtually no jobs for BlitzMax programmers out there and you cannot even really use it in a computer science class. Ultimately, only a few indie developers mess around with it.
Indie developers. Think about that for a second. Indie developers are usually one man armies or very small teams of a fistful of developers who sell games or applications that they write for a living. Since they need an income and have only tiny budgets, they cannot afford long development cycles and they need to be able to focus on their game, their product, their goal. So, naturally, they only use highly productive tools for their work.
Languages like Java and C# were designed with coroporate-style development processes in mind. That explains the buzzword-compliance of those languages, but in the end it basically means managers, boring meetings and even more boring reports. It also means huge teams of developers with a broad spectrum of skills, from people who can hardly code to very routined coders. You will most likely not find any hardcore hackers there, because usually hardcore hackers do not work for corporations but run their own startup or work as an indie developer instead. That’s because corporate life and corporate projects are brain-rotting boring.
C++, which should not be mistaken with C, is a system language that quite often is misused for application development. According to what you hear from people who went down that road, those projects more often than not fail miserably for a multitude of reasons, of which several have to to with the (unnecessary) complexity of C++ and the design flaws in the language itself. One of the best hackers that I know used to say this: “C++ is a nice system language. But whoever uses it for application development has a tendency towards masochism.” I take his word for it.
Another commonly used system language is C. The Linux and Windows NT operating system kernels are written in it, and this is the language’s natural domain. It won’t ever hurt you to at least be able to read and understand C code in your career as a programmer. It will help you understand the operating system and environment for which you are writing your own software. It also helps you to communicate with the OS directly or to write so-called “wrappers” for functionality provided by the OS that your programming language of choice does not provide you with. C is also the language in which Doom and Quake were written.
Python. This is a very high level, highly productive and interpreted language that is being used in many software domains and by some of the ‘big names’ out there. Since it is an interpreted language, many program errors will only appear during the runtime of the program, which means that you will have to test your code to death if you want to be sure that it runs correctly. Certainly, you cannot test a program enough, but the problem with Python and other interpreted languages is that you also have to test for errors that could not happen in compiled languages, because the compiler would find those errors for you before your program runs. The bigger your code base, the more problematic this will become.
Furthermore, compiled programs run faster than interpreted programs. Whether this is relevant for your specific problem is a different story. Modern computers are so fast that it usually does not matter anymore - unless you write 3D engines or other performance hungry software.
Python is a good language to learn programming with and you will also find the one or the other Python job out there. YouTube was made with Python, and Google also uses it. For what, however, only the people who signed the Google NDAs know. Python’s also been used as a scripting language in some games, a good example being Civilization IV. And last but not least, the One Laptop Per Child project also used Python as its development platform and language.
Coming back to BlitzMax. BlitzMax unites many of the strengths of Python and Java and has a set of powerful tools and features built in that especially make your life easier when you want to write games; things that you would usually implement in a language like C or C++. And in case BlitzMax does not yet have a certain feature for you, it provides you with an API that allows you to link modules written in any C dialect to your BlitzMax code.
What the makers of BlitzMax not specifically tell you, however, is that the language and the available third party libraries for it have long outgrown the domain of games. Games are the highest art of software development, but there is also an abundance of other things you might want to do with your programming language, and the BlitzMax community will help you there. They have written platform independent modules for database access and web development, date and time calculations, various network protocols and according to the BlitzMax forum, the language’s even been used in the medical sector.
BlitzMax is easy to learn, and yet flexible and powerful. But what’s more important than any of the above, however, is that the language is fun to use, read and write.
You will have a great time with it.
Indeed it is powerful. Or I would even say really powerful - for example I had one thousand of simple enemies, bouncing (with gravity) around and it still was 60 FPS :). It is more than enough for both amateur and serious Indie games creators :).
Very nice article I must say. If I weren’t already “in love” with BlitzMax (For a year) I would probably at least try it. It reminds me how I stumbled upon it. I downloaded game Grid Wars 2 which had its Source Code along with the game and I wanted to do some changes here and there to make the gameplay a bit different. And that’s how I started playing with it. After discovering how much can be done with it I left Game Maker for my new favorite and now I consider myself good enough to write Modules :).
But BlitzMax is, as you said, “niche language” and thus the only place you can find something about it is their own site and forum, and two or three other sites, which barely have anything about it. Because of that when I need to know something it is almost impossible to find it. The documentation is so simplified and, it might be brutal though, almost useless. BlitzMax cries for some real documentation, language reference and function reference (Though the latter is almost as good as it should be). Some nice Module Writing documentation would be nice too.
And also I long for few function, most notably something like “type of” as I didn’t encounter it. Barely anything is said about arrays and pointers (I had lots of issues with the former). As for arrays, there are a lot of problems with making byte/short arrays as you have to use Casting or else Blitzmax (at least in Super Strict) thinks you are trying to put Ints in Byte Array -_-.
But other than that I find BlitzMax really great. Too bad it is developed so slowly.
Ok, now, I think that this is enough :).