Couldn't say when I first found FreeBasic. Didn't do much with it at first, most likely. I only took it for a serious test drive years later, thinking it would let me make good quality games without external libraries. But it doesn't work that way.
FreeBasic started as the open source clone of an influential MS product, but it has long outgrown its roots. It's now a systems programming language with a feature set between that of C and C++:
- has OOP and namespaces, but no templates;
- dynamic arrays and memory-managed strings are built in;
- function and operator overloading are supported.
It also has a very clean syntax, if somewhat verbose: an important feature all by itself.
Game ports
As of late September 2023, I completed FreeBasic ports of Lost in the Jungle and Space Cruiser Orion.
Notes
- FreeBasic supports function pointers and array initializers, allowing a programming style more like in other programming languages.
- On Linux, cursor control in
screen 0 mode is implemented with ncurses, so it doesn't get along with the input statement. Use GetKey instead.
- FreeBasic lets you put the main program code after all the function declarations, similar to modern scripting languages, but unlike other Basic dialects. Beware of portability issues.
- like in related Basic dialects, but unlike in most other languages, operator precedence is unusual in that multiplication comes before division.
- At least in
-lang qb mode, FreeBasic readily accepts completely broken programs and will compile them without errors, generating executables that fail silently. There's basically no way to debug such a program short of getting lucky.
Tip: With the -lang qb option, or the #lang "qb" pragma, you can still enter code similar to what QBasic used to accept. This helps with porting code to / from other modern dialects.