QuickBASIC Lives On with QB64

When I got my first computer, a second hand 386 running MS-DOS 6.22, I didn’t have an Internet connection. But I did have QuickBASIC installed and a stack of programming magazines the local library was throwing out, so I had plenty to keep myself busy. At the time, I thought QuickBASIC was more or less indistinguishable from magic. I could write simple code and compile it into an .exe, put it on a floppy, and give it to somebody else to run on their own machine. It seemed too good to be true, how could this technology possibly be improved upon?

Of course, that was many years ago, and things are very different now. The programming languages du jour are worlds more capable than the plodding BASIC variants of the 80’s and 90’s. But still, when I found a floppy full of programs I wrote decades ago, I couldn’t help but wonder about getting them running again. With something like DOSBox I reasoned I should be able to install the QuickBASIC IDE and run them like I was back on my trusty 386.

Unfortunately, that was not to be. Maybe I’m just not well versed enough in DOSBox, but I couldn’t get the IDE to actually run any of the source code I pulled off the floppy. This was disappointing, but then it occured to me that modern BASIC interpreters are probably being developed in some corner of the Internet, and perhaps I could find a way to run my nearly 30 year old code without having to rely on 30 year old software to do it.

The QB64 Project

After searching around a bit, I found the very cool QB64 project (alternate site: QB64.org) This is an open source QuickBASIC development environment that is not only completely compatible with existing programs, but adds in functions and capabilities that were unthinkable back on my 386. Displaying a PNG, loading TTF fonts, or playing an MP3 in the background can be accomplished with just one or two commands.

Such things were possible with the original QuickBASIC, but existed more in the realm of tech demos than anything else. Oh the games I could have made back in the day with software like this! I had to be content with bleeps and bloops, and even that required you to figure out the timing for the tones yourself.

Even better, QB64 is cross-platform and supports compiling into native binaries for Linux, Windows, and Mac OS. That meant that not only could I run my old code within the IDE, but I could actually compile it into a binary for my Linux desktop. I don’t own a Windows computer anymore, but with WINE I was able to run the Windows version of QB64 and compile an .exe that I could give to my friends who are still living in the dark ages.

You can even use QB64 to compile QuickBasic code into an Android application, though there’s considerable hoops to jump through and it currently only works on Windows.

Conjuring Black Magic

This might be lost on those who never wrote BASIC code on a vintage machine, but the following code creates a 800×600 screen, puts a full screen PNG up, plays an MP3, and writes a message using a TrueType font.

' Init screen
SCREEN _NEWIMAGE(800, 600, 32)

' Load files
menubg& = _LOADIMAGE("splash.png")
menufont& = _LOADFONT("font.ttf", 30)
theme& = _SNDOPEN("theme.mp3", "SYNC,VOL")

' Set theme volume, start playing
_SNDVOL theme&, 0.3
_SNDPLAY theme&

' Load font
_FONT menufont&

' Show full screen image
_PUTIMAGE (0, 0), menubg&

' Say hello
PRINT "Hello Hackaday!"

As a comparison, this QuickBasic tool for simply displaying a JPEG image clocks in at 653 lines of code.

Revisiting a Project

In my edgy teenage days, I created a graphical version of the “Drugwars” style game. You moved a little stick man around a pixelated environment, buying and selling substances that I had heard about in movies but certainly had never seen in person. It was terrible. But it was part of my youth and I thought it would be fun to see if I could shoehorn in some modern flash using QB64.

As it turns out, transparent PNGs and the ability to display proper fonts makes things a lot easier. Being able to play music and ambient sound effects in the background makes even sloppily done games seem a lot better. The following screenshots are of the main menu of my little teenage crime fantasy, before and after the application of QB64. Note that the core source code itself is more or less the same, I’m just interleaving it with the ability to load and display external files.

Should You Be Using QuickBasic?

No, you definitely should not. I didn’t write this to try and convince anyone to jump on a programming language that peaked before many of our readers were even born. QuickBASIC is an antiquated language, stuck with outdated methods and limitations that are confounding to the modern programmer. But QB64 does do an excellent job of modernizing this classic language, if only to a relatively small degree in the grand scheme of things, for those of us who cut our teeth on it.

Being able to take a disk with BASIC code I wrote on a DOS 386 in the early 90’s and turn it into a Linux binary in 2018 is a pretty neat accomplishment, and I salute the QB64 development team for making it possible. I won’t be writing any new code in the language, and I don’t suggest you do either, but it was a lot of fun being able to revisit this period in my life and drag it kicking and screaming into the modern era.

170 thoughts on “QuickBASIC Lives On with QB64

  1. “Of course, that was many years ago, and things are very different now. The programming languages du jour are worlds more capable than the plodding BASIC variants of the 80’s and 90’s.”

    The programming languages of the 80’s and 90’s were much more capable than the plodding BASIC variants of the 80’s and 90’s. Basic has always been a toy language to learn basic programming concepts on.

    I’m a bit older than the writer, and I learned on an older version of basic than QBasic. I did love having QBasic on old Dos and early windows machines and definitely missed it when it went away. Even back then BASIC was a toy.

    Does the writer even know that the “B” in BASIC stand for Beginner’s? Clearly not judging from his “Should you be using qucikbasic” conclusion. It never was a serious choice.

    1. Many corporate products are written in some variant of Basic. Large behemoths of code, written completely in visual fox pro or VB. Largely because industries which adopted computing early on typically pushed the “coding” on some operations department.

      I currently work in travel, the majority of code which talks to airlines, does QC, handles the back office, etc is written in VB. Typically this code was written by travel agents who filled a support type role already. This is not unique to travel however, for a long time the medical field was also filled to the brim with silly code written by people with no business writing such important systems.

      If you want to talk hacks, let’s talk about huge systems written over the last 20 years by non programmers.

      Though the purpose of Basic may be to educate and reduce the barrier of entry, a pretty lucrative and easy retirement plan is converting VB systems to more robust solutions.

      1. I also had Microsoft Basic (not quickbasic) back in the 80’s, the “Pro” version, which was a complete oxymoron. And I did do some large apps at work in Visual Basic 3 back in the windows 3.11 era. But as you say, that was exactly because of companies pushing “coding” on other departments (in the VB3 case, the department responsible for tech support and running the WAN).

        My reply to the author that QBasic is hardly an example of the state of programming languages in the 80’s and 90’s is still valid.

      2. Most of that legacy BASIC code can be traced directly back to the “Learn Computer Programming From the Comfort of Your Own Home” scams which were so prevalent during the early 80’s.

        I got really, really tired of employment agency staff saying “But he’s got BASIC”, or “He’s got BASIC, isn’t that the same thing?”, or some other variation thereof, while trying palm an obviously unsuitable candidate off on to me.

        The one which really took the biscuit though, was the guy who had no programming skills whatsoever which didn’t matter because “You’d really like him if you met him”.

        1. This still happens to me from time to time. Just last month someone with no programming experience was pushed towards my team because he worked in a gui script system based on Visual Fox Pro.

    2. Oh really? Maybe you could refresh my memory: what C compilers came bundled with MS-DOS? Better yet, which ones could I have installed on my TRS-80?

      More advanced languages existed in those days, but they might as well have been on the Moon for the access we had to them as home-gamers. If you’ve got dialup (at BEST) and couldn’t afford to buy a boxed copy of Borland C/Pascal/Whatever, what were you supposed to do? You used the tools you had.

      If anything, I think you are the one who might have the twisted view of BASIC. For most people, it was the only programming language they had access to. We call it a toy now, but back then it was the only game in town. You would by a computer and you would get dumped right into a blinking BASIC prompt. Have fun, there’s your computer.

      1. Oh, I see, only things bundles with MS-DOS count as the state of computing at the time? Wow; so the state of word processing was limited to EDLIN. You sure didn’t get wordperfect bundled with MS-DOS.

      2. MS-DOS and the TRS-80 were a bit of a step backwards considering they were supposed to be ‘professional’ machines, not ‘home computers’.

        By comparison, most CP/M machines came with an assembler and a C compiler.

        1. “By comparison, most CP/M machines came with an assembler and a C compiler.”

          Not that I recall.

          The assembler, yes, but not a “C compiler”…

          There was CBASIC, a very popular compiled BASIC used to create business applications, and DBase. Many burgeoning professionals cut their teeth writing so-called vertical applications using CBASIC and DBase applications on CP/M machines.

          >

          1. Not to be too nit-picky, but ‘available’ is not the same as the original poster’s ‘included’ statement.

            CBASIC was *everywhere* back in the day, Small C was a very niche product.

            >

          2. Mention of Small C reminded me of Deep Blue C on the Atari 8-bits, which was probably a port of this. It was a subset of C, I don’t think it had structs for a start…

        1. 6502 computers couldn’t run CP/M because the default start location for all CP/M software is at 0100h. This was meant for compatibility. The 6502 architecture was a bit too different. On the 6502 this is exactly where the stack begins in hardware 0100-01FF. Below that is the zero page index region… As soon as you issue a PHX command or whatever, it would start deleting the beginning of your program!

          C compilers were not widely available for <= 64k machines in the home market. There were a few releases but they were primarily slow interpreters meant to teach C. As far as C goes, and Pascal, if you wanted to learn them, and had a few hundred dollars to spare, you could. Most people didn't want to bother because they had BASIC/asm which was a great combo and served the purposes they needed. Indeed, even today, people will often cross compile for those machines using CC65 rather than try to code on the original machine. In the day too, people would cross compile C in major software houses because it was so large and inefficient in comparison to assembler. C is meant for "large" systems of at least 512KB of ram. Even though they can fit in smaller footprints, they very often didn't. The large amount of memory required for compiling and such meant most people used BASIC.

          As to why is simple. BASIC was essentially a small library of commands with versatile parameters. This meant you could tailor basic to be as small as the system would allow. This library was available on boot. In many cases this was only 8KB(even as small as 4K, and in the case of tinyBASIC from Dr dobbs journal, only 2.4Kb), leaving much of the addressable space for programs and kernel operations. C on the other hand is a very different animal. It requires more infrastructure to run. Both are inferior to FORTH so I don't even know what the argument is about :D

    3. > Basic has always been a toy language to learn basic programming concepts on.

      Agreed. I learned QBasic as my first programming language, and my father was horrified and told me I was wasting my time. He insisted that I learn VisualBasic instead. My preteen rebellion was to learn C++ instead.

      1. I first learned basic and then learned qbasic. It was well understood that they weren’t professional languages, and they weren’t designed to be. With the release of qb 4.5, one could compile executables which was a pretty big deal since I could give my programs to any IBM compatibles to run without batch starting basic. It also ran way faster assembled. Other languages were out there and I learned C, did well with that but c++ ended up giving me the death kiss. Learning object oriented programming when you are 14 and grew up mastering qbasic, was quite fruitless. I understand better these days but I ended up not pursuing my potential as a programmer. I always think what could have been had I put my head down and stuck with it. These days I mostly program micro controllers because it makes sense for what I need and wiring language is mostly c.

        1. JAVA: For beginners, children, and programmers of limited skill.

          JAVA: “Jerks Always Venerate Abstraction”

          Abstraction is a great tool for people “too stupid” to program bare-metal hardware, or deal directly with memory by using “hard” things like pointers, malloc, or just people who do stupid things and need a nice guarded sandbox to play in.

          “BASIC” Allowed direct access to hardware, the OS, and other dangerous things. Most people are OK with JAVA,since it protects them from their own stupidity.

          1. Abstraction – like Wirth’s ‘unspeakably evil goto’ – is a tool just like any other. It’s up to you to learn how to use it properly.

            BTW: Peek and Poke – that direct hardware access you so eloquently referred to above – were not part of the original language specification. They were added later by one of the early ‘home computer’ vendors because BASIC lacked graphic and sound functions.

          2. ““BASIC” Allowed direct access to hardware, the OS, and other dangerous things. Most people are OK with JAVA,since it protects them from their own stupidity.”

            “Out”, “Peek” and “Poke” were microcomputer-specific extensions, they were not part of the BASIC language definition, they were added by Microsoft to better support the machines they ported their software to.

            >

          3. Unless you’re writing drivers or an OS, it’s better to keep the programmer away from the metal. There’s no need to do it, and it’s just yet more opportunity for bugs, and possibly some really difficult ones. Horses for courses. Higher-level programs are written in higher-level languages.

          4. Oh, and putting object-orientation into fucking *C*, is such an unutterably stupid idea I can only think the Swedish chap did it as an act of vandalism, some madcap revenge scheme against future nerds. It’s like building a cathedral by gluing gravel together.

          1. “The name doesn’t matter.”

            And therein lies the problem. Those modern ‘basics’ are so far from the original specification that I’m not sure they should, or even can, be called ‘BASIC’.

      1. Have any of you even seen the original basic??!?! Dartmouth basic???? _That_ is a beginner language. One letter variables, integer math only, etc. GW-Basic, QBasic etc. were as capable as pascal and C. Freebasic/QB64 are capable of building modern applications. Deal with it. Qbasic back then even had a more stable version of directX called directQB. Bet no one here even knows that.

        1. You might want to revisit the articles on Wikipedia about QBasic and QuickBasic – suffice to say, they are not and never were the same product, though they had certain similarities (the language was mostly the same, but QuickBasic had many more commands and functionality). Also, there was never a version 4.5 of QBasic – it was QuickBasic 4.5, the last version of QuickBasic (after 4.5 came QuickBasic PDS – Professional Development System, and VB 1.0 for DOS). QuickBasic was always a compiled language, and had to be purchased; QBasic was interpreted, and came with DOS (it was a replacement for GW-BASIC).

          1. Well, coming from that era Andrew, Microsoft may say they are different products entirely, but Quickbasic is just a stripped off version of QB 4.5. I used both of them extensively. You literally can’t tell the difference except they didn’t include some of the more advanced libraries(mouse support etc) with the program…that’s not to say you can’t load them yourself because you can and they are 100% compatible. Quickbasic 1.1 is actually newer than Qbasic 4.5. The libraries just weren’t included. It also doesn’t compile. Other than that they are 100% identical in syntax and function. Quickbasic is the basic environment or IDE of QBASIC 4.5, stripped of the compiler in essence. In every other way it is 100% identical.

            The other thing to remember is that even though microsoft couldn’t figure out what to call it (has anything changed?) users eventually distinguished between the two for themselves. Quickbasic 1.1 is the version included with windows. GW-basic coming before Qbasic and QBasic(also called QB45 or just QB(in the case of 7.1)) are the full dos compilers that everyone used back then for making games and such. With the WWW coming right on its peak of popularity with beginners and hobbyists, GW-Basic never really got a huge online following even though it was used in BASIC stamps by parallax and some other proprietary systems which are still available, and very cool chips. QBasic became a huge thing with hobbyists and even had a lot of professional use. It even had a bunch of fan magazines, one of which was for business professionals using QB.

            There is also POWERBasic, or PB by Bob Zale, which went on to be PBwin/PBWin32, which a lot of companies still use today. In fact the founder passed away and one of the companies who ran PB based software bought the company and is now in the process of bringing it into the 64 bit era. So basic is not dead, never has been, never will be. It just doesn’t get credit for being an easy powerful language. Oh well… It’s just a good secret weapon, just like FORTH.

          2. The abbreviation for QuickBasic 4.5 is QB 4.5 and not QBasic 4.5. There was never a QBasic 4.5

            The first print on the wikipedia page for QuickBasic says “Not to be confused with QBasic”

            And the first print on the wikipedia page for QBasic says “Not to be confused with QuickBasic”

            You not alone in this confusion though as most of the posters here are using QBasic interchangeably with QuickBasic.

            QBasic is what most people have seen as it shipped free with various version of DOS as a replacement for GW-Basic. It was an interpreter only and had limited functionality when compared to QuickBasic.

            QuickBasic was a paid for release that could compile Basic into .EXE

          1. Well, I did a pretty good job of explaining the difference in detail. Again, I was there and used both products extensively, having written two rather large applications and a great deal of smaller applications. One larger being a subset of 5 applications including a CAD program in the language that I am meant to not know the name of. Do you see how that might not slide with me? To reiterate, I actually own copies of both of these. They are different products. QuickBasic V 4.5/ 7.1 was the next generation superceding GW-BASIC(which I also have right here in my possession on 5.25″ disk. I think version 3.3). QuickBASIC 1.1 was the free interpreter(only) which didn’t include QB.QLB I/O libraries etc. or a compiler. This was included with windows 95/98 and would allow you to run programs in autoexec through command line QUICKB~1.EXE -YOURFACE.BAS as an example, but not produce standalone EXE. Although internally they have the same name, QuickBASIC, they are not the same. The difference is the version number.

            The convention of calling it QB/QBasic rests in the DOS naming convention itself…QB.EXE is the name of the actual program, and QuickBASIC 4.5 is the actual name given in the IDE. The convention existed way before Quickbasic 1.1 even existed. In fact, you can look up ‘QB News’ from the late ’80s early ’90s. They too used the convention. However, to avoid confusion later, QB users would refer to Quickbasic in order to delineate between the cheesy 1.1 version, and the good 4.1/7.1 compiled versions, which they called QB, or QBasic or Q-Basic. It was actually quite convenient that they had different names for the actual .EXE files. They have the same name internally, but the confusion rests with the fact that microsoft did not delineate the difference themselves by calling it QBlite.exe or something like that.

            If one chooses not to believe this, or chooses to believe wikipedia over items one can physically pick up and look at or a person who was a developer using the language itself…well, I can’t say much else to convince them. The community always referred to it as QB or QBasic, and it’s mascot is the QB hamster(often wielding a flamethrower to flame newbs).

            P.S. I tried QB64 and wow! It really does do all the screen modes from the old days, as well as add modern features! I was able to compile and run MSDOS graphic mode using source code from back in the day and it compiled with NO changes and ran under windows! Incredible! I may need to revisit some of my old applications again :D, and write some new ones.

    4. “Does the writer even know that the “B” in BASIC stand for Beginner’s?”

      Beginner’s All-Purpose Symbolic Instruction Code. Entracnhed into my brain from the early 80s

      And that would make the “B” in VB and VBA mean the same!

      1. Back the day, when I wanted something fast and tiny, I turned to ‘ASIC’ (Short for ‘almost BASIC’), which was a much larger pain in the butt to actually use because it was so pared down, but it was almost as good as assembly in its speed. I recall using it to write libraries for my QB & PDS programs. I also remember embedding said tiny programs in batch files as DEBUG input strings. The batch file would pipe /itself/ as input to DEBUG, which would then create the program that the rest of the batch file would use. VIrus scanners just don’t expect you to do things like that. :grin:

  2. What fun! Makes me want to take another stab at reading in the BASIC programs stored on cassette tape which I wrote when I was a kid. Where’s that C dup() function for humans?

    1. There are many utilities in the retro computer scene that run on a modern OS like windows that allow you to connect your cassette player to the line input of the sound port and convert the sound back to the original data.

  3. If you are a little bit older and BASICA was your thing before QuickBASIC then you want Blassic. http://blassic.net/

    I have an old EE textbook from the 80s that I bought at a garage sale some time in the 90s. It has BASIC excercises in it. I started working through this book a couple years ago. Yes, I could have bought something newer but I tried and failed as a kid so I wanted to turn that around. Anyway, of course I could have ignored the fact that the book talks about BASIC and just went with Python or some other modern language but.. I felt like keeping with the period of the book. Besides, a language that relies on whitespace to convey meaning can’t be any better than one which relies on GOTO/GOSUB right? Anyway, I looked at QB64 but went with Blassic because QB64 was too modern.

    1. LOL
      I used to use MBASIC in a native 32 bit XP cml/dos box to parse CSV’s of
      my daily share trading dumps and offer a 8 x 8 matrix of “best fit”
      guides for next day’s trading over several stocks !

      It was fun to fit that into only 62K of usable space, it was damn fast though
      and sometimes had half a dozen windows open. Getting it to grab the odd
      html/java output from some of the share trading apps on windows was a bit trickier
      though. Maybe now I can go a bit better. might be busy this weekend, :shrug:

      Will look up blassic.net too thanks Yibby

  4. Hmm interesting Tom Nardi – didn’t know QBasic had “graduated” a bit, offers a
    few lines of progress to maybe revitalise commerce with my investor group
    who might be happy to get dirty hands again from early Qbasic experience,

    Basic may be for beginners as some jibe but, the more learned & mature who
    are in the business at the coal face of productive programming efficiency have
    seemingly offered it some more fruit. The time impost and documentation
    hurdles in just trying to do simple utilities with the more conventional (modern)
    packages is surprisingly onerous. I say surprising as most younger programmers
    might proclaim newer is better but, they take ages to do rather simple things,
    well stuff I so often consider simple ;-)

    So anything that can advance the gestaltic like conjunction of straightforward
    documentation with structure to improve efficiency has my attention and especially
    so if there is as little variance necessary to replicate functionality across platforms.

    So I especially like the idea of potential migration to Android as we (my meek
    little enterprise) already has momentum in that direction on “all sorts of stuff” :-)

    Nice article Tom Nardi a a good primmer for my style of progress over a few gaps
    re current utility decisions I have in mind which can also maybe fill other gaps…

    Thanks

    1. That’s a good point, and maybe BASIC is worth revisiting again to challenge those assertions! I remember BASIC it being damn easy to make something go, but I was a kid then, and I guess I didn’t try to “go” very far. Nowadays when I see a “beginner language” (i.e. it tries to keep you from shooting yourself in the foot), the wordiness and convoluted methods to do something outside the fence are very off-putting.

      Would I be bothered by the verbosity of QBasic now? I mean, knowing Perl and C and a bunch of other stuff, maybe I would think BASIC was as tedious as reading COBOL?

    2. I think taking ages to do simple things is probably down to the programmer, not the language.

      I managed to learn enough python to write some simple linux scripts in a couple of days. It might have quicker but I kept tripping over the damn spaces/tabs crap. WTF was van Rossum smoking when he made THAT decision?

      1. The TI-BASIC built into the TI-99/4 and TI-99/4A were terribly slow. Not because of BASIC but because the BASIC code was first translated to GPL (Graphics Programming Language) *then* to 9900 machine code. TI Extended BASIC was coded in a much more efficient way, including things like tokenizing the common commands internally to reduce program size.

        I wish I’d kept copies of the TI programs I’d written, but I traded my stash of TI hardware and software for four new 1 megabyte 30 pin SIMMs way back when. I may still have a printout or my hand written code for a role playing game character generator. With that I could re-create it using an emulator. In Extended BASIC it could spit out character sheets as fast as I could poke Enter.

  5. I think Hackaday brought down the QB64 web site. Perhaps they wrote their web server in QuickBASIC?

    But seriously, thanks for this… I might just have to fix a few bugs in my old QB games, if only to distract me from real life for an evening.

  6. I’m one of those weirdos that still appreciates VBA in Excel. I wrote a small program to batch proces exam analisys data and email each student a pdf with a personalized report. Havent got the time to learn how to donit in a proper language and it works on all school computers…

  7. Having cut my teeth on Fortran and Basic (in that order, oddly enough), I was always turning out small code projects to crunch lab data using Qbasic/BasicA/Level1 Basic/PET Basic. Why? Because the campus “computer centers” had all the other resources locked down under layers of bureaucracy. You use the tools you can actually get at.

    Imagine my dismay when I first lit up Visual Basic – possibly all the tools in the universe but incapable of whacking together code in 20 minutes for a single purpose unless you were willing to tolerate a month(s)-long learning curve and many unnecessary layers. Perhaps there was a “simple” mode that I never found.

    Hello, Matlab!

    For what it’s worth, MS has issued “Small Basic” that seems to have gone mostly back to the educational roots (though it compiles rather than interprets) and seems like a better place to go if you’ve an urge to work with this.

    http://smallbasic.com/

  8. Interesting! I’ll finally be able to use the program again that I once wrote in QuickBASIC to print inlays for my audio cassettes (I’ll have to get an EPSON dot matrix printer though).

    I think you hackaday’d the server, it’s timing out right now.

    By the way, wasn’t there some rule about the first link in the article being the link to the page of the project?

  9. i do not know, but there seems to be a collection of programming “smart asses” that think that whatever programming language that is on vogue right now is the way to go, and feel the urge to go back and reconstruct the world using that and their newfound all encompassing “power”.

    i say BS. coming from an engineering background, i think you need to use whatever gets you to your goal the easiest way possible and you feel comfortable. also, knowing when to stop is a welcome attribute, specially when you have a time limited budget (budgets are limited by money by definition :))

    there is no pride on over-complicating code… at least for me.

    1. Must say I agree with you on that, use what works for you, I found Euphoria in the
      early nineties, still use it for my projects, bit like basic but I can go a year without needing it and then get back into it quickly.

    2. AS a software dev, I totally agree about your observation of the programming “smart asses”. The amount of crap frameworks and oddball libraries in general that has been introduced over the years by software devs who love anything shiny and new (we call these resume stuffers, because they look great on a resume) is my daily headache. The amount of abstraction for the sake of abstraction… the amount of generalisation for something that will be used for one specific purpose… it is such a mess!

    3. Note to Engineering section:

      The coding for this project has been minimized and is complete.

      Unfortunately one of the tasks specified by engineering has consumed 98% of CPU resources when written in Asm.

      The project has now been returned to engineering so that you can quadruple the CPU clock, reduce memory assess times to 0.5 ns and install a liquid nitrogen cooling system.

  10. I still have all my qb programs done so many years ago on my hard drive! Survived through all the countless hard disk and computer upgrades. Just downloaded qb64 and ran a old sieve benchmark program. Probably one I typed in from a old Byte or Dr Dobbs magazine. This brings back so many memories… THANKS

    1. I agree about the line numbers, but forced myself off of line numbering while working on a QB64 program for work. The program read data coming in from a fire panel RS232 port and email it out. Did it in about 200 lines of QB64 code. It’s been running on 10 laptops 24/7 for over 2 years!

      1. BASIC had comments, so your example could be rewritten as:

        : 1245 GOTO 1765 : REM Calculate Sales Tax : : 1765 REM Calculate Sales Tax 1770 Sales_Tax = Total-cost * Tax-rate(State) 1775 Return :

        >

  11. TRS-80 BASIC was good enough to start my first business back in the 80’s selling a few games and even a paper route management program via mail order. Sometimes I miss those simpler days when everything didn’t require a GUI and web services. Granted, the cassette tapes we shipped the software on were not as reliable as some of the more modern media formats…

  12. QBasic was mostly “used” in addition with ASM inline code. It makes QBasic quite versatile in fact.
    No Operating system in view, but i remember realmode madness, which led me to C later in my childhood. 320*200*256 resolution for INT13H interruption, etc… Also the B8000 knowledge which was mandatory in order to create cool ASCII TEXT shits. It was really quite something back in the old days.

  13. QuickBasic 4.5 is how I first learnt programming, at age 10 or so.

    The killer feature was the very thorough integrated context-sensitive documentation – since Google wasn’t available at the time.

    (A few years later, I spent a lot of time playing with embedded X86 Assembly in QuickBasic)

    1. I agree there…same story for me. QBASIC was so approachable for an absolute beginner. I remember finding a cheesy tutorial online around 1997… In an hour I had everything installed and was making my own stand alone EXEs! I felt like a god amongst humans. I pretty much spent every day there after playing with QB and visiting QB websites…where I quickly learned how I was not a god, and was a total newb. They had some really great RPGs. Some I even go back and play for nostalgia! My favorite was dark ages(not to be confused with 3d rpg Dark Ages). I know petesqbsite still hosts it, but you’d have to run it in dosbox these days. Still hoards of fun. That said, he could have done a better job on the monsters’ sprites lol. Anyway, I ended up making a 2D engine with a very nice size map..although i never got around to making a story line and the like to go with it. I did also make a map editor…so who knows, I may go back and finish it one day.

  14. Java has always been a toy language. It isolates the PC and gets rid of any “hard” concepts, by means of tons of layers of abstraction at the cost of speed.

    Sorting, that’s hard, let java do it for you.
    Pointers, that’s hard, let java do it for you.
    Math, that’s hard, let java do it for you, but in a non-IEEE-754 compliant way.

    All you need in Java for a simple “hello world” program is a few GB of Ram, a few GB of libraries, a few GB for the IDE, and a quad-core CPU, and about 40 lines of typing.

    Sure beats print “hello world”, which only requires a single core, and maybe 128Mb of ram to run qb64 in Linux.

    The true test of a language is how many GB of support libraries it takes, and How many minutes it takes to print “hello world”. If doesn’t need a few GB, and at least 4 cores, it’s just a toy.

        1. I was that prick who simulated a universe using pebbles, then wrote a pretentious comic about it, using fucking stick-men. Because despite thinking of myself as a cartoonist, I can’t draw anything at all.

          The XKCD guy is a prick. For the airy-fairy pseudo-deep garbage his stickmen come out with, not just because they’re stickmen. But also the stickmen, because I’m sure he has a clever reason for using them besides “I can’t draw”.

    1. These days computer hardware is cheap. Programmers time is expensive. Anything you can do to reduce the amount of work they must do, and make it easier to maintain the code after it is written, is worth balancing against the extra hardware needed to do it.
      I’ve written code in everything from assembler, through C/C++, assorted varieties of BASIC, PASCAL/Delphi, Java and C#. I can’t say Java is my favourite language, but it’s productive and you can find plenty of developers who can read and maintain code written in it. The hardware needed to run it is neither here nor there (most ARM SBCs have enough oomph to run it).

    2. You’d be surprised how little use “Hello World” gets in the commercial software business.

      As far as sorting, unless you’ve invented a better method, in which case there’s some conferences would like to pay you lots of money, why not use a library? Or an inbuilt function, same thing. You get the skill of dozens or hundreds of programmers, who’ve done the research to do it the best way. You’d literally be an idiot to do it yourself. Don’t you have something more useful you could be spending your time coding?

      Pointers are unnecessary except in drivers or low-level OS stuff. You don’t NEED to know the RAM address of things. And your language should have a parameter passing mechanism that isn’t so violently palaeolithic. What else do you need pointers for?

      Maths, do it how you like. Pretty sure though that someone else already did it properly. That’s why programmers like to share code, instead of bootstrapping their PC from pegboards and paper tape.

      Most of the time I’ve written anything in C, C’s main features have made things difficult and caused bugs. You just don’t need all that hardware access for most programs. C was invented to write Unix in, and it did a good job. But any sophisticated program quickly gets beyond the information you can keep track of in your head. And that’s why abstraction exists. That’s why C has functions!

  15. All that talk about “real programmers” with (almost) bare metal, pointers, manual memory allocation and so on.
    It’s all fun and games until you have a deadline to meet. Not delivering working code on time is a great way to get fired.

      1. You DO know that most Microsoft code is written in C/C++? Many of the errors that they are famous for are directly attributable to this fact. “Real Programmers” are aware of the strengths and limitations of the language they have chosen and work accordingly.

        1. Please don’t conflate C and C++. While you can write C in C++ if you’re so inclined, you don’t have to. I virtually never get the kinds of errors in C++ that I used to in C. Not because I’m some superhuman programmer either, but because I use RAII and other idiomatic language features that make those kinds of errors nearly impossible without deliberate malice.

  16. “I had to be content with bleeps and bloops, and even that required you to figure out the timing for the tones yourself.”

    QBasic had functions to play music in the background; I forget the commands, but you basically made an array with “notes” written down as “ABDEFG…” in some weird syntax and then called the function, which would start playing the music in the background.

    It also had commands to call custom machine code functions stored in memory, so you could “in-line” assembly code and achieve things like proper frame buffers and get 320×200 framebuffered graphics with sprites. I made an prototype of an isometric game engine that way and tested it to run at a good clip, something over 60 fps on a 486DX2

  17. Very cool!
    Back in the early and mid 90s my primary use for my amazingly fast 386DX33 was to program in QuickBASIC. I still have most of my old .BAS files, but I had no way to read them. I think I’ll be installing QB64 today and taking a look at a past segment of my life!

  18. I don’t know why People just don’t load a USB stick with 6.22 DOS or setup dual boot. All you need is a hard drive formatted in FAT and you can get the files from the Windows environment and run native mode. Funny listening to everyone talk about the old days. I did Basic+2 on a PDP 11/70 in the 70’s (also Fortran/Watfor and Cobol), along with multiple versions under CPM, MPM, DOS, etc – CBASIC, MBASIC, QBASIC, ZBASIC. Back in the days very few People had the money to buy things like compilers. I actually have a copy of BASCOM for DOS, a basic compiler, and about 400 diskettes full of software that runs under .386 DOS (now converted into sub-directories under windows), including a ton of assembly I had written at the time. Also things like Norton Guides which allowed you to write online manuals you could pull up with shift keys – including all of the DOS calls/processor instructions. When Windows came out it was near impossible to address things like printing directly. Until some of the more advanced interface books came out, it was use a control under VB3 to do it. Even under DOS until “Undocumented DOS” came out nobody knew what the insides of DOS looked like, like the SDA DOS swappable areas. And yes, back then it was a given that you needed to know 2f8,3f8,2e8,3e8 along with b800:0 and b000:0 video areas. In the end under DOS it was assembly using OPTASM/MASM and OPTLINK/LINK for me. Those days were fun, and they ended roughly in 1994 when VB was starting to take hold. And for historical sake – VB was chosen by businesses because they could produce screens for business and technical project analysis quickly. The morons managing never understood that screens didn’t equate to real code. Still, for business applications VB was a fast development environment to code in, easily debugged (since it didn’t allow direct memory pointers until later), and easy to maintain if some standards were used during development.

    1. I don’t know why People just don’t break up their walls of text into paragraphs… All you need is to hit the carriage return (“enter”) button a couple of times occasionally.

      Plus, have you actually tried loading DOS on a modern computer? That hard drive needs more than just a FAT partition; it needs a MS-DOS disklabel (not a GUID partition table), and likely will need to be no more than 2GB in size, as MS-DOS 6.22 didn’t support any bigger.

      You’re at the mercy of whatever your BIOS supports too. No thanks, if I want to run an old OS like that, I’ll use a VM.

      1. On the paragraphs, many of the basic languages required line numbers, some didn’t – but things like GW-Basic did. It seems to me that QuickBasic and TurboBasic didn’t need a line number on each line, and depending on the compiler, not required either. Most People need to remember that many of the basics were interpretive languages and you ran an interpreter against your text code vs compilers that you ran native code .EXE’s or .COM files once compiled. On the label, I don’t know about the disk label – that has never come up on my setups that I recall. On size, considering the original IBM AT came with a 10MB hard drive in it, and the IBM PC had 360/720 KB diskettes – later 1.44MB, formatting 2GB as FAT isn’t a big deal. But yeah, I have a couple VM images setup with 6.22 for yucks, and you can’t exceed that size.

          1. Lighten up Francis, this isn’t an English course. Loading MSDOS 6.22 on a modern computer is about 50 times faster than it used to be on the original equipment, assuming you bothered to put the primary drive on a SSD or hard drive. Even the POST on an original PC took a really long time. And if you really want to see a regressive language lookup “CADOL”, it’s worse than assembly. You know Assembly/machine code, right?

          2. He was just saying you should use a few more paragraph breaks in your posts, Bob. They’re a bit long to be single blocks of text. Your eye keeps track easier if there’s space breaking things up a bit.

    2. You forgot which interrupt, 5 or 7!

      There must be millions of customised apps for small fields of business that are just VB code strapped on to a database engine. Front end is what it’s good at, basically all it is. You can do the necessary processing your front end might need. Everything else you get as add-ons written in more serious languages.

  19. Before you might complain qb64 does not have all the same debugging tools as qb45 did. Look for VWATCH and use it too. Since the board was reset it might be awhile before VWATCH shows up. QB64 is so much more than a BAS to C spewer. All the extensions added to QB64 make a worth while second look. Hell you can even make windows system calls. Like file attributes, mod date/archive/create date/flags.

    BTW, latest version of QB64 will take qb45 tokenized files and load them. No need to save them as TEXT.

  20. Dosbox, nah. Ran qb45 directly in windows7 command prompt the other day, appears to work.
    I used to be quite good with it many years ago. Still good with batch but it’s surprising how much of the qb45 syntax has leaked out of my memory over the years. Practice me thinks.

  21. My first dive into programming was with Qbasic 1.1 back in 1998. I was 12… I didn’t really know any better, and as far as I was concerned, it might as well be magic. Being able to draw circles and lines and manipulating ASCII text in 16 colours (and later on 256 colours when a friend ‘discovered’ SCREEN 13 and hurriedly called me on the phone one day).

    The first program my friend showed me (which got me hooked) is as follows:

    CLS
    SCREEN 7

    DO
    LET X = INT(RND * 320)
    LET Y = INT(RND * 200)
    LET C = INT(RND * 15)

    LINE (X,Y) – (100, 100), C

    LOOP WHILE INKEY$ = “”

    I saw that running on his 486DX266 one warm Autumn afternoon, and I’ve been a software dev ever since!

      1. well, yes… that was learned later on.

        Besides, the program does a ‘CLS’ and then sets the screen mode with ‘SCREEN 7’… there was no need to ‘CLS’ if you change the screen mode right on the next line since it clears anyway xD

    1. ??? You were poor so you WROTE YOUR OWN COMPILERS!? Like, for existing languages? Or something more like an assembler with stuff added on top? Smart nerd like you could surely get employed somewhere.

      1. Hmm Anthony,
        My initial understanding is the underscore provides clarify in respect
        of long function names to improve readability – especially efficient
        for those professional programmers who thought ahead acquiring
        the skills of speed reading in tight commercial environments for
        the most optimum level of productivity.

        ie. The space normally used in sentences gave way to the
        underscore when variable & function names could be long to offer
        as much useful context as possible as the space offers delimiting
        functionality in most languages.

        So now the underscore is added as an arbitrary marker instead of some
        other reserved character in that context, couldn’t this add a later of
        confusion for the novice when exposed to high level code at the earliest,
        rhetorical question for most part ;-)

        1. Nope, he’s talking about variables whose names start with an underscore or two. Like __HELLO_THERE. Lots of system stuff is infested with stuff like that. Lots of Linux stuff, lots of C stuff.

    1. Thanks for the replies on this. The thing that bugs me about the underscores is that I’ve seen code with one, two, or even three on the beginning of variables and functions, and since underscore characters usually connect, it makes it hard to tell how many are actually there. They end up looking like lines of varying length.

  22. You had me at:
    “This might be lost on those who never wrote BASIC code on a vintage machine, but the following code creates a 800×600 screen, puts a full screen PNG up, plays an MP3, and writes a message using a TrueType font.”

    You lost me at:
    “No, you definitely should not. I didn’t write this to try and convince anyone to jump on a programming language that peaked before many of our readers were even born. ‘

    … just saying.

    1. The implication seems pretty clear. If you learned programming on a BASIC variant, or even have some QB code you want to revisit, then the new functions offered in QB64 are a welcome addition.

      But if it’s 2018 and you’ve never written a line of code, BASIC isn’t where you want to start.

      To me it seems a little bit like restoring a classic car. Yeah it’s cool to look at, and we can all appreciate the work that went into keeping it up and running. But few people would seriously suggest you should hop into a 50 year old car and tool around in it as a daily driver.

  23. For those who want to play around with BASIC code and haven’t been in the scene, an excellent source of a TON of BASIC code comes from something called “The ABC Archive” – it stands for “All Basic Code”, and was crafted by someone named William Yu (he was the archivist/maintainer). Basically people submitted code (I have a bit in there myself), he created an archive, then released it. It required a special “reader” program to search, view, unarchive and such – but the archives are still out there: http://www.phatcode.net/downloads.php?id=204

  24. As I am a product of ‘Mid Century Modern’, the only programming language I have ever really been proficient in has been Basic–first learned on a TeleType connected to a Univac, or QuickBasic on a PC. As soon as C and it’s variants rolled into view, I guess I was doomed.

    1. Reminds me of my days on the early VDU’s connected to the DEC Systems KL-10
      circa 1976. WIth TECO editor, shareable high segments Macro-10, ferrite core memory
      of a whopping 128K words of 36 bits at first setup, upped to 512K Words Semiconductor !

      The best was extensive use of Basic with the Print Using statement to have my program
      write another program on the fly then Chain to it, great for direct entering functions as a
      string – had a few ppl think I had a parser set up, nah took the lazy way out that
      basic Chain statement was a god send to them old qudos days, first intro to the net
      when the Bentley KL-10 mainframe connected to the KI-10 at UWA Western Australian
      Regional Computing Centre (WARCC) with a 4800 baud link to Singapore for
      all of Western Australia, yikes how time has changed :-)

  25. “BASIC is a toy language for beginners…”
    Dartmouth basic, sure. Now, when BASIC became about as powerful as Pascal, I didn’t hear anyone retracting that. QBasic seemed like a toy language to those who didn’t know what it could do. In point of fact it was every bit as powerful as any other language of the time. The problem for it’s reputation was that there were two tiers of users…the beginners who found basic approachable, and the programmers who had discovered how to integrate assembly into libraries to run with QBASIC. Fact is, qbasic offered the best of both worlds. Ease of programming, and the ease of assembly integration. For things which did not require speed, you could make them in basic. For the repeating tasks you could use assembly libraries. By 2003 people were using premade powerful libraries to make 3d game engines etc. in BASIC. The most popular of these was DirectQB. It was similar to directX and allowed for accessing full memory as well as all graphics modes. All of the routines were written in hand tuned assembler and could be called within basic. You could also send signals out directly to ports natively in basic. So to say it was a “toy” was to misunderstand just how powerful it was. That’s before you even get to POWERBasic!!! Which is entirely written in hand tuned assembler and produces hand tuned assembler..and in that language you can actually insert assembler lines in amongst basic lines.

    1. Indeed, I used the Future Library for Qb4.5 back in the day. Fricking awesome library which enabled SVGA with mouse support, animated gifs, bmp, sound (wave files) and textures (load an image and then manipulate it on screen). I had so much fun with that library!!

  26. I’ll start with this quote:

    It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. — Edsger W. Dijkstra

    I started with QBASIC years ago, later graduating to CA RealizerBASIC and Microsoft VisualBASIC 4.0… still have both of those on floppies here.

    Yes, “toys” as some point out, but they did tell me about how to write software, and a little about how to drive hardware. I had a program that drove a Roland DG DXY-800A plotter and a Fujitsu DL-1100 printer. It taught me about flow control, and how to get something working. I had dabbled with other languages like C, but never really warmed to them. I could get things done in BASIC, and that was fine.

    Move to Linux around 1997~98, there’s no BASIC, but I discovered Perl and PHP, and so began writing crappy web apps using Perl/CGI and PHP. Including horrors choc full of SQL injection holes.

    University actually taught me about modularisation of code and how to better structure it for maintainability, and about data structures, data manipulation, etc. No longer was I manipulating integers by converting them to an ASCII string of binary digits and doing string manipulation. They started with Java first up, then later C++. I picked up C again, having had it “click” with me doing C++; and just in time for an embedded programming subject.

    I no longer do BASIC now… my day job sees me coding 99% of my code in Python, JavaScript or C. If I were to suggest a first timer language, I would find it hard to go past Python, as it’s a highly expressive language that offers a lot of features. You can even write modules in C for it… so C code is not far away.

    For me, I use C if I have to do something low-level or in limited resources, Python or JavaScript otherwise. You wouldn’t write a Linux kernel device driver with NodeJS; horses for courses!

    BASIC was popular in the day, because it pretty much was the default language on many home computers. Without learning the machine code, it was the only way to get something done yourself. The original BASIC suffered from a number of flaws which lead to spaghetti code.

    QBASIC on the other hand, did have a much more structured syntax. It wasn’t a bad first-start language. QuickBASIC was more powerful again, not that I ever got proficient enough to fully appreciate it, by that time, Windows programming had my interest. You can do some decent stuff in it… and if I had to code for DOS, I’d definitely consider it today.

    However, if coding for Windows, Linux or MacOS X; there are more modern and far more capable tools out there that should be looked at first. I’ve been a professional Python developer now for about 6 years… I don’t think too many employers out there are looking for QuickBASIC developers. :-)

    1. maybe that’s what’s wrong with me. I’ve been wanting to use Arduinos and such, but C keeps whizzing over my head. Maybe Commodore screwed me up…

      Or maybe I just don’t have the free time anymore to dedicate to learning a new thing. Maybe it’s both. Either way, I keep building hardware, with no software behind it.

  27. Man I loved qbasic and quickbasic! I got my first job because I wrote a program that drew a house, snowman, snow, and played jingle bells. I think that it’s possible that a lot of developers got their start with QB. Thank you for writing this article, and allowing me to feel some nostalgia.

  28. If all BASIC as a language did, in it’s many forms, was to draw in and introduce a generation of programmers it has done a fantastic job.

    To pour scorn on BASIC by examining it retrospectively in today’s context is like pouring scorn on an old MG or or other vintage car just because it could be beaten on the racetrack by a modern supercar.

    I find lots to criticise a many modern frameworks about, especially given that none have been so good that creation of new/alternative frameworks has been discouraged – too simplistic, too complex, too much “magic”, excessive abstraction so you never know what they actually doing at the machine level without huge effort, the list goes on. And still a new one most weeks…

  29. I seem to remember an ancient story of youngster Bill G going livid when someone in his computer club used a little basic interpreter he’d written without his permission and then forcing payment for its use. Shadows of things to come..usder

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.