10 ms·
For young children, QBasic and goto may indeed be superior to more structured languages. From a neuro development perspective we know that young children are ve
by jbandela1 10y ago
For young children, QBasic and goto may indeed be superior to more structured languages. From a neuro development perspective we know that young children are very concrete and have limited abstraction ability. With Basic and goto, a program is more concrete (you run a line which is more or less 1 command) and linear (no nested structures). With structured programming, it is more abstract, and has an recursive structure (with arbitrary levels of nesting).
Because of this, it might be preferable to introduce a child to the more linear, concrete programming model with goto and let them experience the thrill of programming then as they develop more and their programs increase in complexity, introduce them later to other more abstract methods and languages such as structured programming, oop, and functional.
- clock_tower 10y agoFrom my experience back when I was 12: once you get ambitious enough in QBasic, you start to wish for some way of organizing the code and making it easier to follow. At that point, an intro to structured programming or OOP is natural. (Probably not functional programming, though, since functional's not very good for games, and what else do you think QBasic is going to be used for?)
- bduerst 10y agoI was in the same boat at that age. I was trying to build a text-based BassTour clone in QBasic, and the book my dad bought from Radioshack didn't get into OOP. It would have made it much easier to do than that static-state version I cobbled together.
- wj 10y agoI would love to see that if you did built it.
- epsylon 10y agoQBasic supports subroutines (called SUB for procedures and FUNCTION for functions). You can write very structured code with QBasic; pretty much the only thing it lacks is pointers, but it's a very capable language otherwise.
- pc2g4d 10y agoGOSUB got me pretty far!
- exDM69 10y ago> pretty much the only thing it lacks is pointers, but it's a very capable... You can PEEK and POKE arbitrary memory addresses and use CALL ABSOLUTE to call assembly shell code at any address. I remember typing out a mouse driver shell code in hexadecimal from a magazine. QBasic does not have built in mouse routines and the young me was baffled when you could make that happen with a long string of digits.
- exDM69 10y ago> pretty much the only thing it lacks is pointers, but it's a very capable... You can PEEK and POKE arbitrary memory addresses and use CALL ABSOLUTE to call assembly shell code at any address. I remember typing out a mouse driver shell code in hexadecimal from a magazine. QBasic does not have built in mouse routines and the young me was baffled when you could make that happen with a long string of digits.
- ef4 10y ago> you start to wish for some way of organizing the code Yes, this is a critical and valuable step in learning. You can't easily learn the solution until you've encountered the problem.
- elijahparker 10y agoI learned programming in QBasic when I was 12, wrote thousands of lines creating a Windows 3.1 style GUI complete with a help file reader that included hyperlinks. For me the limiting factor wasn't organization -- functions and subs worked well (and I loved the byref and byval parameter definitions). The real limit was speed, which drove me to learn C and was amazed that everything I wrote appeared to execute instantly compared to QBasic
- jlg23 10y ago> Probably not functional programming, though, since functional's not very good for games Can you elaborate on that? People have actually written games in FP languages ([1], [2]). [1] http://www.cliki.net/game http://www.cliki.net/game [2] https://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp https://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp
- rtpg 10y agoI think this isn't that FP languages themselves are not good for programming games, but that the languages don't really bring much more to the table. Even when writing games in C, you end up writing many things in a very functional way by default. You have some state variables, and on every tick you advance things around in a very defined fashion, and redraw the screen. The "default" pattern for making games is so close to functional languages already that the only thing moving to purely functional languages gives you is a tutorial on State monads. In a way, this is a way of saying that functional languages are good for games, though... meanwhile, OOP-style tools are extremely useful in games, because you often find yourself working with Entities with a lot of shared behaviour. The abstraction maps well to the concrete structure of a game. Going to an FP-language will often cause you to sacrifice many OOP-centric language niceties without bringing much to the table to replace those niceties. In game programming, I think the tradeoff is much harder to justify than in other domains.
- eru 10y agoOnce the Haskell people have figured out lenses properly, you can have all your OOP niceties (that anyone actually cares about).
- deleted 10y ago[deleted]
- clock_tower 10y agoWe've already got those niceties (including the ones that you don't care about), and we get them without having to learn Haskell's enormous universe of exotic terminology. How do we get them? We don't use Haskell.
- joesmo 10y agoQBasic offers structured programming. QBasic has both subroutines and functions and the IDE actually displays them in their own window, separate from the main program and other subroutines and functions. It also has if blocks, loops, etc. I don't see what else you need for structured programming. When I was young I was able to create many complex games including breakout, tennis, basketball, arcade shooters, etc. with QBasic alone.
- kmill 10y agoQBasic was one of my first languages I learned (as a young child), and I am fairly certain I rarely used goto, since the language does have if/for/do/while. Interpreting these structures is still fairly linear, since each part manipulates some variables, and possibly jumps to one of the delimiters (if to end, do from loop, etc.) The language even has some structured procedure/function definitions, though I didn't grasp these until much later. In contrast to control flow, which has lexical structure, procedure invocation has dynamic structure. This exceeded my abstraction ability at the time. Probably the most important parts about QBasic were 1) it was easily accessible in C:\Windows\System32\qbasic.exe, 2) the interface was streamlined enough that I just had to hit F5, no need to figure out tooling, REPL-like, and 3) it gave an easy interface for drawing things on the screen, which is captivating. (And as an aside: in no way did I end up with the brain damage Dijkstra would have predicted. Unless programming in Haskell and Lisp are symptomatic -- or maybe antidote?) By the way, did anyone else use Klik N Play or The Games Factory (both by Clickteam)? I got a lot of milage out of them. They are essentially event-driven graphical programming languages for designing on-the-simpler-end games. I wouldn't have traded them for Scratch.
- voidlogic 10y ago>And as an aside: in no way did I end up with the brain damage Dijkstra would have predicted FWIW QBASIC is pretty advanced compared the the BASIC Dijkstra's comment was referring too.
- tlarkworthy 10y agoConstruct 2 is like games factory but better
- tujv 10y agoYes, I used The Games Factory for many years! It would also create stand-alone installers that would fit in a floppy.
- mzs 10y agoI think you might be onto something. For my oldest son I tried to help him along in python. Just poking about in the interpreter went great, but pygame overwhelmed him and when his laptop died he never picked-up again where he left-off. For my youngest son I introduced him to awk first. In an editor he would edit the script and then run it in the terminal. I explained how every line goes in order. At first his script would output things like: jake is awesome I love POTATO but soon he was using $n, variables, arrays, and conditionals from one line to the next. I had some silly stuff I had already written for awk to make it work one keypress at a time and I created a little h -> awk project for him. Then he wrote a game: https://github.com/msliczniak/jake/tree/master/games/letters https://github.com/msliczniak/jake/tree/master/games/letters Just yesterday he said he wants to make it so that after every 100 points more enemies show-up. A nice benefit to this is it is a whole lot like JS. That's the way to show-off for friends, I'm still mulling how to get him there though without over complexity. I'd appreciate advice.
- jandrese 10y agoYou are teaching him awk? Are you trying to create a supervillain?
- e12e 10y agoWell, it could be worse, (s)he could be teaching him REBOL/SPITBOL - and then he'd be disappointed by all new programming languages he encounter later in life...
- nickpsecurity 10y agoOr How to Design Programs with Dr Racket. Same effect.
- e12e 10y agoI was actually suggest Racket as a great platform for learning programming (it's a "real" language/platform, decent IDE, support for building stand-alone executables, great documentation, sold cross-platform support) - but was a little surprised that I couldn't find a BASIC #lang-uage extension for Racket. It would seem that a BASIC mode and maybe a pure turtle graphics mode should be pretty trivial to make for Racket. Not that scheme is a terrible language.
- Narishma 10y agoAren't you confusing QBasic with some older BASICs? QBasic is a structured language. It has blocks, functions, different kinds of loops, custom types... It doesn't require gotos or line numbers, though it supports them for backwards compatibility.
- amelius 10y agoYes, but it does not have closures, which are somewhat further removed from the bare metal. All the constructs you mentioned have an almost trivial mapping to assembly language.
- mschaef 10y agoThe lack of anything like a pointer or reference type is more significant. That and pointers to code would go a LONG way to adding useful expressive power to the language. As things stand right now, there's really no way at all to abstract control flow, which makes a number of useful programming styles very difficult to implement, if not impossible. For reference, the Microsoft BASIC 7.0 implementation contained about the only implementation of a GUI (text mode) framework that did not use pointers to functions. The result was something that worked, but had immense amounts of repeated complexity and boilerplate code.
- anexprogrammer 10y agoAgree with this, there's also another big advantage that the article doesn't mention - the instant response and lack of distraction. 30 years ago you turned on, and in seconds were at a DOS prompt. Now you had to load something, to do just that. A C64 or other 8 bit turned on instantly to BASIC. Everyone could program enough to make scrolly insults of their sister or swear and beep on the demo machines in the store. All the improvements have added layer on layer of insulation from the tedious guts, which is great when you just want to work, web surf, write a mail or play farmville, and the machine, even a phone, takes ages to boot. It's terrible for kids in my opinion - all the things that would feed their natural curiosity are just not there. What's there instead is appstores and notifications reminding of social messages and games to play. I made a heavily curated PC for the kids and they were able to do remarkable things in paint (the youngest could do more with paint at 6 than I ever could) or build little programs or make tunes in something that looked like an old tracker. Best part, they did it nearly all themselves. It's a shame for the next generation we've mostly reduced all tech to consumption only devices. Then they hit teen and just got addicted to WoW anyway. :)
- bitJericho 10y agoThis is why I collect, maintain and most importantly, make available at a whim many old consoles and computers. Anyone can experience the joy of instantly available basic, duck hunt, Mario paint and many other classic and historically significant games and programs more easily than even when I was a kid. I use LG auto switchers to connect everything so anyone just has to turn on the equipment they want to use. On top of that I also have an av switch reversed so one can choose between the big screen or the crt.
- elliotec 10y agoA cool idea could be to do something with those collections like open up an interactive historical technology museum or something like that.
- anexprogrammer 10y agoGreat idea. I really regret turfing out some of the older kit that weren't PCs. Some of the early games were much more creative (and of course some were terrible). My kids proved frogger is just as addictive as 30 years ago! :)
- mondoshawan 10y agoI don't quite get this assumption -- qbasic doesnt have line numbers unless you want them. Noah's code didnt even have any in the pictures. Qbasic has subs and functions, so structured programmig is entirely possible in that environment. Additionally, it isn't compiled -- every time you move your cursor off of the currently edited line, qbasic converts that directly to bytecode for interpretation later. This isn't the 1988 PC BIOS basica.com. :-)