4 ms·
I've been using FreeBASIC for about 10 years and help maintain a 100+kLOC codebase written in it (a game engine). FreeBASIC has multiple dialects; there's the
by versteegen 10y ago
I've been using FreeBASIC for about 10 years and help maintain a 100+kLOC codebase written in it (a game engine).
FreeBASIC has multiple dialects; there's the qb dialect that supports most of QB except some audio and real-mode DOS-related commands, and the modern fb dialect, which is all of C plus half of C++ with BASIC syntax. And it does improve on C and C++ in several ways, like much better string support and a "preprocessor" that looks like the C preprocessor but is far more powerful (it's not a preprocessor, so it knows about types and variables, etc).
Of course it's not better than QBasic in every way: it's not interpreted with that awesome edit-and-continue ability that QBasic had. And the compiler can be quite buggy.
There are also a number of other QB successor languages, like QB64, which has a focus on the QBasic IDE and supporting all of the audio-visual stuff QB had fully. But (after comparing the codebases) will say FB is written far more like a professional product.
- nickpsecurity 10y agoThanks for the review. Sounds like it's what I used to call an "industrial" BASIC where it has the features and compiler to get real work done. Many people think some toy with a few key words and interpretation when they think BASIC. Yet, I used to do all my hacking in it and Visual Basic 6 for GUI layer. Loved VB6 specifically for rapid iteration: instant load, instant test-run, instant... you name it on P3 400Mhz w/ 128MB RAM. That efficiency on arbitrary hardware is something industrial BASIC's and Wirth languages have in common. Only Go can touch it these days but still not low-level as Wirth stuff gets.
- versteegen 10y agoYes, I would agree with "industrial", especially since you can link with any C library after translating the headers with SWIG (translations of common libraries like C, winapi and GTK are included with FB). I've never used/don't know VB, but it appears that quite a lot of FB's design is borrowed from it. In recent years FB has been focused on borrowing C++ features instead (and even aiming to be ABI compatible with g++, not sure if that works). E.g. recently added "dim byref" (like a C++ reference variable) and polymorphism + RTTI. Sometimes things move in the other direction, like binary literals new in C++14 :)
- nickpsecurity 10y agoNice. Appreciate the tips.