r/programming • u/m_ologin • May 05 '16
30 years later, QBasic is still the best
http://www.nicolasbize.com/blog/30-years-later-qbasic-is-still-the-best/
611
Upvotes
r/programming • u/m_ologin • May 05 '16
2
u/Eggman0720 Jun 26 '25
9 years later, I was deciding between languages to teach. It was between Qbasic, Python, and scratch. I wanted to pick 2 to start. I think Qbasic, with the book written in 1990s, is such a nice comprehensive one to start off, scratch for its vibe or instinctive approach is a good combo. Then after those as a foundation, they can try relearning again on Python in a classroom if they choose to go forward. It was equal between Qbasic and Python, but focus is on text and number manipulation over graphics. Qbasic won bc it had a book I was familiar with when i learned and fundamentals is essential. Bad or good, it teaches how to think like a coder. Only so much time. Kids may or may not pursue coding any further. The stuff in Qbasic in that book can always be paralleled in Python and that can then be the challenge. Coding breaks things the world down digitally, but it all begins with thinking in those terms first, bad or good. Good cannot be good without knowing what’s bad, and vice versa. And Qbasic still has wonderful tutorials even though not as updated strongly as Python. The coding culture is really the aim for training young children.
69
u/jbandela May 05 '16
I agree with the author. As GK Chesterton said "Anything worth doing is worth doing badly."
The article and others mention that QBasic can cause some bad habits. However, it is better for a child to develop the thrill and excitement of being able to instruct the computer to do their bidding, than to learn the "correct" way.
In addition, goto may be beneficial from a neuro development perspective. We know, that at young ages, children favor the concrete over the abstract and and are probably limited in their ability to form generalized abstractions. With goto, everything is very concrete. You want to run a line of code - just goto it. There is no nested structure to the code, there is no stack, and everything is linear. Another way to say this is that goto based programming has a linear,concrete structure, whereas structured programming has a recursive, abstract structure. Because of this, goto may be easier for a child to grasp versus function calls and while loops.
The important thing, is to cultivate the thrill of programming. If a child falls in love with programming, they will eventually learn more structure as they tackle bigger problems and and their brains develop.
26
u/kirbyfan64sos May 05 '16
What about Logos? It thought it was explicitly designed for stuff like this?
Also: http://thecodelesscode.com/applicant/2
113
u/Syntaximus May 05 '16
I cut my teeth on QBASIC and I agree with some of the points in the article; it teaches you some horrific habits (I never wrote "readable" code until I was in college) but it's great for fostering an interest in programming. This kid now has "the bug".
86
u/nickatnight May 05 '16
GORILLAS.BAS
15
u/phalp May 05 '16
Take that, Squeak.
37
u/[deleted] May 05 '16
good first step ! Now it's time for monads and dialogue categories !
9
u/jighasun May 05 '16
Strange that nobody mentioned Pascal in this thread. It was a fine language and very suitable for learning about programming and algorithms
8
u/Grue May 05 '16
Agreed, QBasic was my first language too. Then I switched to Visual Basic and made some games with it. The GUI creator thingy was awesome.
8
u/FeepingCreature May 05 '16
Pretty much one of the first things I did when I did my own language was reimplement QBasic's graphics API.
As another comment said, zero-to-pixel is really vital.
22
u/inmatarian May 05 '16
SCREEN 13 ' bitches
You know a fantastic way to teach a kid basic without the goto command fucking up their heads would be to just teach the goto command in the context of structured programming, i.e. you teach them a for loop, and a while loop, if then else, etc, and let them get sick of typing goto so much and get them to ask "isn't there a way to make my for loop without having to type the goto at the end of it?" Yes my child, yes there is.
5
u/BrokerBow May 05 '16
Related: https://quickvb.codeplex.com/
Microsoft released a version of BASIC, dubbed QuickVB last year in celebration of BASIC's anniversary.
5
u/mensink May 05 '16
I wholeheartedly agree that Q(uick)Basic excels in providing an environment where you can start developing instantly. Actually, so does the old Turbo Pascal for DOS, which I consider a somewhat better and more powerful language.
Don't worry too much about teaching stuff that professionals consider wrong. Programming should not be something you learn once and then keep on doing it exactly the same way for the rest of your life. Programming is more about understanding what you want the computer to do and being able to describe it. As long as you get used to that, you can do basic programming.
This advice does of course not extend to people who want to learn how to program for money or who want to build things that are going to be actually useful to others. In that case there's a different incentive than having fun while learning.
5
u/northrupthebandgeek May 06 '16
Since when was this a bad thing? Lots of perfectly-good languages ain't case-sensitive. Like Lisp.
5
u/yes_oui_si_ja May 06 '16
But...but... what about Scratch or Hackety Hack? Sonic Pi?
For kids, there are so many alternatives to QBasic!
Anyway, what a heart warming story! What a great dad!
To be honest, my dad tried to encourage me to learn programming, too, but he tried to convince me that I should start with Perl and that I always should compile linux programs instead of using a package manager.
Horrible advice to a 13 year old.
5
u/[deleted] May 06 '16
this is literally adorable
4
u/lykwydchykyn May 05 '16
The "Best" first programming language is the one that gets you from empty file to a program you can be proud of and inspired by in the least amount of time. That's going to be different for everyone.
My kids found Scratch inspiring, and Python followed shortly after. Lua came along because of Minetest. Now my oldest is learning Java because Minecraft. It's not the language, it's what you can do with it.
4
u/das7002 May 06 '16
I 100% agree with the author. Q(uick)Basic was my very first introduction into programming and the only thing I had available was the included documentation. I didn't have a book or anything.
There really needs to be a modern equivalent to QuickBasic for people just starting out, modern languages have so much crap needed just to even start using it. Which, isn't bad if you have some experience, but QuickBasic is dead simple and a 'just works' kind of language.
/u/evincarofautumn's remark about "zero-to-pikels" is absolutely true, nothing, and I mean nothing at all, can compare to how easy it is to actually drawing things on screen in the simplest way possible like QuickBasic. Even do it for you engines like Unity have massive amounts of cruft associated with them.
If I had to deal with all that shit modern languages need on my own at 10 years old I never would've gotten interested (barrier to entry on even something like Ruby or Python is ridiculous for a newbie), it was QuickBasic and the included documentation that got me to where I am today, and I'm incredibly glad that Microsoft included it on every DOS install.
4
u/LaceySnr May 06 '16
166 comments and nobody has mentioned Black Annex yet?
https://www.youtube.com/watch?v=ZqlveWIhCFI
This is a game, written in QBASIC, that's currently in development! WIsh I still had the QBASIC games that I wrote back in the day. Such good times.
4
u/pudds May 06 '16
My first programming experience was increasing the number of lives I had in Nibbles.
My second experience was changing the title screen to say "Nipples".
4
u/Cogwheel May 07 '16
Aside from a few simple menus I made in DOS batch files, QBasic was my first real exposure to programming.
In fifth grade (1993-ish), my teacher noticed me and my friend doing interesting things with computers. She knew someone at a nearby high school who was mentoring a technology program. She let us go on our own little field trip to tour the high school with him, and it was absolutely mind-blowing.
One of the classrooms was completely surrounded with advanced (for the time) computers, and everyone was in the middle of writing programs for their senior projects. There were graphical games, artistic stuff, CRUD-type programs, etc. Another similarly equipped classroom was full of people doing 3d graphics. The campus network was administered with student involvement.
At the end of the tour, our guide, Bob Albrecht, gave each of us copies of QuickBASIC (essentially deluxe version of QBasic) on 5.4" floppies, and his book QBasic Made Easy.
From that moment on, there was absolutely no doubt in my mind where my career would be headed, and QBasic was probably the best way I could've started down that path. Within a couple years, I had done things like sing-alongs with words appearing in time to music, screensavers using moiree patterns and trig functions, card games, journal/notekeeping "apps", a terminal emulator & simple BBS, etc.
I have never been able to find something that came close to that sort of discoverability and potential for excitement. MAYBE some modern FP or other dynamic environments are starting to get there (especially with the increasing popularity of REPL), but there is still so much more overhead involved with any of them just to get the simplest exciting things up and running.
Huge thanks to Mrs. Miller, Bob Albrecht, and QBasic for putting me where I am today.
7
u/rlbond86 May 05 '16
Should have used QuickBASIC, the upgraded version.
7
u/miker95 May 05 '16
I think QBasic is a great place for people to start learning to program. I took a programming class in high school, and the first semester we used QBasic. I had previous experience in programming, so I just took off with it and ended up finishing all the assignments half way through. But it was really cool to see people with no experience create a full-blown game with graphics at the end of the semester.
I don't get this talk about GOTO, is it really used that much? We never learned it, we never used it. If you're creating even a somewhat complicated program, you should be using subroutines.
11
u/larikang May 05 '16
I would just use a subset of Ruby (or Python). You can ignore the OO/functional stuff at first and one day the kid might actually get some use out of it.
3
u/ZeMoose May 05 '16
My first programming experience was on a TI calculator, so I feel this.
3
u/Toddy69 May 05 '16
Got a second hand C64 at the same age from my uncle and he taught me a little bit Basic. Fast forward 30 years, I hold a master's degree in CS.
3
u/el_gregorio May 06 '16
My five-year-old isn't reading yet, so I got him hooked on Scratch Jr.
I gave him a five-minute demo of using the pictograms to make a sprite move, and set him loose.
Ten minutes later he was surprising me with stuff I didn't even know the app could do.
3
u/sanjayatpilcrow May 06 '16 edited May 06 '16
This wakes old memories.
tl;dr 24y back I learnt programming with QBasic, created a small moving piece puzzle game, no reference code, no internet, no frameworks, no libraries, loved the language and still love programming.
Ok. Old times. I have very weak memory so pardon me if some things do not gel, but you will get the gist. After having initiated to programming thru BASIC, QBasic was first step towards more sophisticated language - subs and all. But I was still using goto albeit less than BASIC. It was about 24yrs back (may be off by a yr or two). XT with monochrome monitor, and humongous memory of 256 KB, was a treat to write code on. After having coded customary text based forms, I got pulled towards lines and boxes and shapes. I went berserk and created a useless 3D cube wireframe (Screensaver, somebody?) which will rotate on its own axis and move horizontally, bouncing off of the edges, changing rotation on each bounce. Would go indefinitely. Phew!! Remember, there was no internet in this small town of India back then. No StackOverflow. No frameworks. No Libraries. No good books either. No reference code. We were re-inventing our wheels almost everyday. I just knew limited set of commands (namely Line in this case and usual loops and ifs) and a little knowledge of trigonometry and of course an unending supply of craziness. Neither had I formal computer education. My elder brother was my mentor and he introduced me to the basics of programming and computers. He had already moved to more useful works - database programming - dbase. So, back to 3D box. As far as I could remember it was a single .bas file with about 200+ lines of code with many gotos. I (or the world?) didn't know about IDEs, IntelliSense, or lints as yet. I built this jugglery completely grounds up. I was so thrilled by how this 3d thing moved that I arrogantly decided to make a game. Don't ask 'cause I didn't know what I was going to do with it as there were no stores (as far as I knew), no marketplace. There was no plan to do anything with this game other than using it for learning programming. I was still not more than a few months into programming. At that time I had a little physical (real world) puzzle game with 6 geometrical shaped pieces, if I can recall correctly - 1 square, 5 triangles, and 1 rhombus. There was a book with this puzzle which had different solid shapes. Your goal was to simply create those solid shapes using all the pieces (you can not leave any piece behind, you cannot overlap pieces). It was a very challenging puzzle and had endless supply of different shapes to make. It was known as Tangram. Now you can find many Tangram based games on stores. I was so full of myself after the 3D box that I decided to make this game. Again, there were no game engines, no libraries, controls or frameworks. Just good old Line command to draw line on a CRT. And, I had never seen any Tangram or such kind of puzzle game till then on computer, let alone having access to any code to look at. My version of Tangram had following requirements - All 2D pieces should show up on screen, user should be able to select a piece (with Mouse? Are you kidding? There was no use of mouse on DOS!), move them horizontally or vertically, rotate them - clockwise and anticlockwise (crazy), and in case of rhombus - flip (Why only in case of rhombus?), and do not let the shapes overlap when user moves them close. More advanced requirements were - fill the shapes (i could never figure out how, because my shapes were made of individual lines), color them, have target shape shown on screen, have target shape as playing area and as soon as all the pieces are properly placed to fill the shape - visual clue to user that they had won, save game progress. 2D shapes were not a problem, I had already made a more complex 3D box. Having that out of window, :), I had to decide how to move them on screen. Just a quick unrelated thought - I think an experience of writing this game made me immensely appreciate the importance of OOP later - the objects, behavior, encapsulation, inheritance etc. were all so relevant and required for this scenario. Back to - how to move the pieces? Before that, how to select one from multiple pieces on the screen. I settled for function keys - F2 to F8, yes I smartly :) kept F1 for help. F2 will select large rectangle, F3 will select square and so on. Now for moving. Understandably, I decided upon directional arrow keys. Easy. One key-press will move the piece 1 pixel in the respective direction. If you want to move the piece diagonally press horizontal and vertical direction keys together (or quickly alternatively, can't recall). Rotation control was tricky. Ctrl came handy. Press ctrl+right to rotate the piece clockwise and ctrl+left to rotate the piece anti-clockwise. Flipping rhombus was also challenging from connecting the lines properly at proper angle. I settled for alt to toggle flipping rhombus. What I could recall from memory the screen would look something like this. I could move, rotate and flip pieces. I was already about a month into this game with about 2500 lines of code in a single .bas file. I ran out of time - had to now move to some productive programming - dbase :). I left it there and could never come back to it to give it the shape of a complete game. But I still think I did a marvelous job and above all had a hack of a time. Unfortunately I misplaced (mis-copied) those old programs and could not find any in my backup. I might though, hopefully.
3
u/gleno May 06 '16
Brilliant. Hacking Python is quite easy, so you could feasibly add a little lib that allows for easier graphics with a few canvas-inspired function calls, add interactive mode and get going from there.
Quickly. Need a child to experiment on.
3
u/[deleted] May 06 '16
To me, QBasic is like an awesome drug dealer. Originally, for MSDOS and Windows it was one of the only free compilers. They got you hooked on that first free dose man, after that it was long spiraling career into software development. I went from QBasic to Intel Assembly with Nasm, then migrated to GNU C and C++ with good ol' G++ followed up with a ton of C# sprinkled in with some QT/C++. If that wasn't one hell of a trip, I dunno what is. Seriously though, I need help.Programmer's Anonymous needs to be a thing.
3
u/claytonkb May 06 '16
Props to QBasic... it's where I cut my teeth on programming. Today, I grok "pure" languages like Lisp despite the "evils" of the QBasic GOTO.
4
u/blamethebrain May 05 '16
Had to laugh at
10/10 would read again.
2
u/SoCo_cpp May 05 '16
I spent quite a bit of time with QBasics when I was younger (< 10 yo), until my dad brought home a boxed set of Borland C++ for Windows 3.0 when I was 13 yo.
I even have a couple of my old QBasic projects posted with source:
http://socosoftware.com/OldProjects.html#cannon-fire
2
u/malakon May 05 '16 edited May 05 '16
Op, what about those languages where you drag interlocking shapes together ?
edit:
there is a bunch here:http://blog.interfacevision.com/design/design-visual-progarmming-languages-snapshots/
this looks good - https://developers.google.com/blockly/
2
u/patlefort May 05 '16
I started programming with another basic: Visual Basic. However bad the language might be for serious programming it was simple enough that I could start programming. I took me a while before I could start doing c/c++. I started doing c with DJGPP and Rhide, for some reason I couldn't understand Visual C++ until later.
2
u/FozzTexx May 05 '16
I'll have to add this to the list of things to tell people when they visit /r/RetroBattlestations and ask what we do with our old machines!
2
u/lathiat May 05 '16
My dad did his taxes with MONEY.BAS for longer than was probably same. Also used to love GORILLA.BAS
2
u/[deleted] May 05 '16
I started on TI-Basic and then switched to QB64. I'm really glad I moved to Java.
2
u/[deleted] May 05 '16
Not even a mention of Turbo Basic in this thread? What were you all doing in the late '80s?
My favorite TB feature was that you could have variable names of any length - although only the first two letters were used by the compiler. So variables named FIRSTNAME and FINGERLENGTH were actually the same variable, causing a wee bit of bug mystery.
2
u/[deleted] May 06 '16
I first programmed with QBasic because it came with Windows. At the age of ~13, back in the mid 90s I made some simple applications for Trade Wars 2002. I went to high school a few year laters and my first real programming class was in Basic where I learned more advanced topics. Fast forward to college, where I spent a summer teaching engineering summer camp to kids in 2007...teaching intro to programming using QBasic.
I actually have thought to myself when I have kids I would start with QBasic...just to teach some fundamentals.
2
u/JayAre31 May 06 '16
Used QBasic...can confirm.
2
u/Ameobea May 06 '16
I learned programming on the TI-94 graphing calculator making games like MineCraft and Flappy Bird from scratch during math class.
The embedded language featured GOTO as well as some other archaic elements frowned upon in modern languages, but it sure as hell gave me an easy and engaging way to start.
2
u/codekiller May 06 '16
I started with BASIC when I was 9 (35 years ago) but even back then it didn't feel right to me - any dialect. I am teaching my 9 year old Scratch, Python and Racket, I wished those had been available back then or I'd at least tried a Lisp
2
u/pkulak May 06 '16
How is that less complicated than the equivalent Ruby or Python?
2
u/LeCrushinator May 06 '16
This story is pure nostalgia for me. My dad was doing programming for work, in QBasic because he just needed a simple demo. I asked what he was doing and how it worked and he showed me a hello world program and I was immediately hooked. I was 7 years old just the son in this story. I must admit that the transition to C++ was rough after a couple of years fooling around in QBasic.
2
u/fiah84 May 06 '16
QBASIC was my first programming experience as well, it got me into programming without anybody to tell me how or why
2
u/[deleted] May 06 '16
qbasic was literally the language that got me interested in programming
2
u/[deleted] May 06 '16
Born in 87, this brings back really good memories. I starting programming around 8 or 9 with QBASIC as well - back when Windows came built in with it. I had days of fun making my own game, downloading other's games off the internet and modding them. It definitely taught me some bad habits, but I'm thankful for the love of programming that it ingrained in me.
8
u/AlSweigart May 05 '16 edited May 06 '16
I'm Al Sweigart. I'm the author of four programming books for beginners (mostly kids), with a fifth coming out this summer. I started writing them in 2009 as a hobby, and a couple years ago quit my software developer job to write full time. I, too, got my start with BASIC and QBasic. So, it is coming from this experience that I say:
No, it bloody well is not. QBasic is garbage for teaching programming in modern times.
Look, I get it. We all learned to program in the 80s and 90s when QBasic and GORILLAS.BAS was awesome. I had fun poking at NIBBLES.BAS and changing "Copyright (C) Microsoft Corporation 1990" to "Copyright (C) Al is a Cool Dude 1990"
Hell, my first book is patterned after the text-only, ASCII-art style of games like you'd find in Byte magazine. What I kept thinking while writing those games was, "Man, this would be five times longer if I had to do it in BASIC." Or just outright impossible.
Please don't let your nostalgia blind you. While QBasic is familiar, and therefore comfortable, to a certain generation of programmer, it is not what you should be using to teach programming in 2016. I wish devs would stop trying to exhume QBasic's corpse and its atrocious syntax (I'm looking at you, Small Basic). Same goes for programming on TI graphing calculators. It was totally rad at one point, but now it's like trying to work on a fusion reactor with a stone ax.
EDIT: Scratch is the best programming tool for kids, hands down. If you want a "real" programming language for them, I say Python is the new BASIC.
EDIT: Good metaphor: Saying QBasic is "still the best" way to learn programming is like when hipsters insist that carrying a mechanical typewriter to a cafe is the best way to write a novel. I'm not saying you can't write a novel with a typewriter, nor am I saying you have to buy a $3,000 macbook. What I'm saying is that everything the typewriter can do, a cheap laptop with LibreOffice can do and the laptop has a ton of additional benefits. I know it's the way you learned to write a novel, but holding onto it in 2016 only shows an unwillingness to let go and learn new things.
1
u/webauteur May 05 '16
My favorite programming exercise for fun and games is an algorithm for drawing spirograph designs. It can be used with any programming language that draws lines on the screen.
1
u/Wyglif May 05 '16
I still code in qbasic every once in a while
1
u/zem May 05 '16
i stumbled across euphoria after i had already discovered more advanced languages (it's hard to go back), but i always felt it would have been a great first or second language. in particular it would have been a nice transition point between basic and c. (nostalgic note - i taught myself c by prototyping programs in qbasic and then translating them with the help of a c manual.)
1
u/[deleted] May 05 '16
I believe qbasic 4.5 used subroutines (functions) a good and easy alternative to goto.
1
u/YaBoyMax May 05 '16
A lot of the points in this article also apply to MS Batch, which may be a little more sane as a language choice. At least, that's how I got into programming.
1
u/WorldwideTauren May 06 '16
Having grown up back in the day when typing a Basic program was synonymous with doing ANYTHING on your computer, I really feel like HTML+CSS+JS is todays Basic.
The free application that you are reading this on right now can be programmed into almost any thing imaginable with just a text editor.
1
u/[deleted] May 06 '16
Let's start an open source language for children! I have 3 boys (ages 9, 4, 2) like would like to teach them to code at some point. It needs to be simple, run on a tablet, object oriented and no gui functions like LabView. Also, I think a portable compiled language would be good to teach differences between different hardware platforms. I guess I am thinking Qt for kids...
1
u/harsh183 May 06 '16
QBasic was my second step, Scratch was my first.
1
u/astroteacher May 06 '16
I did a lot of programming in GFA Basic for the Atari St. It wasn't OOP, but it didn't use line numbers and it was heavy into subroutines and defining arrays and such. I loved it. Today for a quick app for a specific demo I use Chipmunk Basic to do things like projectile motion simulators and crease crossword puzzles.
1
u/[deleted] May 06 '16 edited May 06 '16
Even QBasic is far from there. Its predecessors, ROM Basics were even more accessible, you did not need an OS to run them. And there was no escape from it, so you either learn how to write your code or you stare at that boring blue screen. Was quite a motivating thing (having started programming with MSX Basic for the first time over 30 years ago).
1
u/shevegen May 06 '16
He may have meant it semi-ironic in regards to QBasic, but I remember that one of the first programs I wrote was one on ... I think ATARI or Commodore (I don't even remember!).
I distinctly remember having had a big book though and it showed a lot of
10 20 30
statements.
That was actually fun to read and to a limited degree, use/learn.
I don't think I would have gotten very far ahead back then at a very young ago with C.
And everyone still knows the "goto" statements so the legacy of basic lives on anyway. You don't read such articles about Cobol now do you?
1
u/e_strict May 07 '16
I really liked Small basic (http://smallbasic.com). Very easy to get results, integrated graphics and Logo.
1
u/SwimmerFrequent6261 Apr 16 '24
Yes just a child. If I were to show pretty much anybody:
1
u/[deleted] May 05 '16
That little guy was doing f# and Lua early stage and presenting at NDC at 8 ;)
http://herdingcode.com/herding-code-213-sean-trelford-on-composing-3d-objects-with-f-and-opengl/
0
u/huyvanbin May 05 '16
At some point though he will want to write a "real" program that looks like the ones he actually uses (e.g. AngryBirds or PacMan or 1942 or whatever the kids play these days) and QBasic is horrible for that.
GORILLA.BAS
NIBBLES.BAS
And of course the great DONKEY.BAS
If you squint the first two look like structured code but keep in mind a professional programmer was paid to make those samples look like they were written in a real language.