This made me smile. I remember trying to learn coding at 6 or 7 from my Tandy 56K Basic manual. I didn't get it but I tried all the same. It would have been cool to have someone there to help me understand.
It's a fortunate thing to have common interests with your child. I can't wait to have my daughters show even the slightest interest in coding. They are toddlers, so I have to just wait.
I was around the same age. My dad was a big ZBasic fan, and he had me copying BASIC games out of a book and getting them to run, on our Tandy 1000. My oldest is 5, and I'm trying to figure out the best time to expose him to it. With the entertainment-focused nature of computing we have now, I can't rely on the lack of distractions that were present with a non-networked computer with a monochrome display. Right now, we don't even have a regular computer for him to play around with—my wife and I have our own laptops—so I think the first step is setting up a desktop machine that the kids can fool around with.
I've had a lot of success with a Raspberry Pi 3 and a 15" monitor. My 3 1/2 year old learned how to use a mouse nearly instantly and can click around on the desktop.
The Pi is $35 and has HDMI out and lots of USB ports. It's pretty great.
I almost bought a Pi for my son when he turned five, but then I decided to hold off (he didn't seem mature enough to be trusted with it yet). I want each of my kids to have a device that they can use how they please—whether it be playing Minecraft or tinkering with the hardware (including destroying it—I broke quite a few computers growing up...).
What software do you have running on the Pi for your 3.5-year-old?
Well... the Kano distro is pretty good for "I'm gonna learn how to type and move around the computer". [1] They have a build-a-computer kit and are coming out with a screen soon? It's a little old for my son, though. It really wants you to type things which is great except he can't read yet.
A colleague of mine had a lot of success with Edubuntu. [2] Her six-year-old is a whiz at the command line. Again with the keyboard use, so not quite appropriate.
I'm still looking, basically. He likes clicking around and seeing that he's having an effect on things, but he usually ends up at YouTube, which isn't so great.
I spent some time fiddling around with assembly when I was a teenager to run a TSR (terminate and stay resident, what daemons were called before they were daemons). It would hijack the screen when my little sister was playing a computer game and type out spooky messages like "Help me Sarah... I'm trapped in here" and then go back to the game after a few seconds as if nothing had happened.
Ah, how we laughed (after her nightmares stopped)...
Wow... good job man. My first experience with programming was QBasic, and that was about 16 years ago. I only did it for a couple of weeks but when I picked up on programming several years later as a young adult, it all came back to me - assigning variables from user inputs, printing on screen, if then else, all the basics. Good stuff!
I learned to program on an Apple ][, where the programming environment was always a CTRL+RESET away. BASIC was great. I carefully typed long programs that I found in the back of computer magazines, broke them by changing stuff, and fiddled around endlessly. Those incantations are still in my fingers (CALL -3116 for a nice visual effect, PEEK -16384 for the current keyboard key, VTAB and HTAB to get around the screen, etc).
I volunteer at a local Coder Dojo and there's nothing to give these kids who want to fiddle around like that. Scratch is the closest I've found (with the bonus of not having to necessarily be able to read or type), but it's still cluttered with logins and passwords... and, being a GUI, it suffers when the kid's computer doesn't have a big enough screen to manage the complexity they eventually create. It's a shame. I tell kids who've grown tired of Scratch that they can "graduate" to Stencyl, a game engine that uses a similar visual programming metaphor but lets you drop down to the Haxe beneath. It also compiles natively to desktop or mobile, so that's cool too.
Python, ruby, and JS are all really close to the ideal "type and go" environments, but they're also littered with speedbumps. Installing packages and keeping the environment sane are difficult enough for some professional engineers, let alone kids who just want to mess around and make cool stuff.
The woman who started my local Coder Dojo got her son started with his own Linux computer at a really young age and he's a whiz at it, so maybe there's no real problem here and I'm just underestimating the ingenuity of these kids. They'll get it done if they really want it, I guess?
Yes, there are a number of QBasic reimplementations and compatible languages. FreeBASIC is one that aims to be a (compatible) successor rather than just a reimplementation. I can't remember what the others are...
I learned to program on Texas Instruments calculators in the same form as this seven year old's application, I made really elaborate choose your own adventure games with if statements.
My first programs were for a TI-55 calculator. No conditional jumps, only a RST that restarted the program with data intact, so you could do some tricks.
I managed to make it solve second-degree equations in less than 33 steps (using the RST jump to re-run part of the program on modified data). Without the trick it'd require, IIRC, 35 steps, which were beyond the limits of that model.
QBasic was my first exposure to programming, when I was 9 years old. Fond memories. Despite it having what today I consider terrible syntax, it made programming extremely approachable. After a quick "hello, world" intro from an IT guy at my mom's office, I spent countless hours reading the help pages and learning the commands. Sometimes I wish programming could be as simple again.
After loosing my memory, I have to relearn programming nearly from scratch. I took a challenge to do specific program in around an hour, from language to toolchain to solution. Had to be system-like language. Got bogged down by toolchains, IDE's, whatever. Said screw it: why the hell is it so hard when I faintly recall starting lightening-fast on QBASIC? Found a BASIC, FreeBASIC, that was just like it with simple command to launch stuff made in text editor and good documentation. Maybe half an hour of my challenge gone.
Next, time to apply lessons I remembered from high-assurance and Wirth. First, subset the language to minimum necessary. Used docs to test each in isolation to develop template & functions for using them, esp file I/O. Wrote formal spec in English & pseudocode of my problem with decomposed functions. Mapped almost 1-to-1 to FreeBASIC as expected. Did one refactoring. Executed code for first time to see successful run & solution to problem.
Yeah, BASIC is friggin awesome. I stretched industrial BASIC's, esp 4GL's, really far back when I was a hacker as they did rapid iteration, safe-by-default, and ran fast. Today, I'd say do a Wirth language like Oberon or Component Pascal instead. Still, BASIC has lessons to teach us and a painless bootstrapping for developer that many modern tools lack outside of scripting.
Just a head injury. Dont give too much detail as too solud testimony might be used against me in hiring or court or something.
But, yeah, lost most memory except stuff I repeated most along with muscle memory anx hand-eye. (Shrugs). Supposed to be thoughtless drone but I do well here on many topics despite working with pieces and little short-term memory.
Appreciate it. Just functional enough to recall pieces of a good, in-depth conversation with you here on programming, software quality, etc. I gave you credit elsewhere for being unusually knowledgeable about present and past techniques of getting job done. Plus noticing high assurance implementation came down to rigorous FSM's and their connection to hardware. Impressive.
Since then, although my condition hasn't changed, I've at least pursued that hardware research to get very far. One thing was finding where SW and HW connect with those FSM's as I predicted. Already have 2-3 methods to express software that (a) can integrate with verification tech and (b) can auto-generate hardware from it. So, slow but steady progress toward grand challenges and such. :)
Cool! Congratulations! I also think that approach sounds potentially very fertile, and painfully feel the inadequacy of existing methods of programming to the tasks we face today. What kinds of media of expression have you come up with?
Tks. Looks like a nice BASIC but appears closed-source from Microsoft. They trash a lot if their side projects over time. So, I'd recommend it only for temporary stuff in learning. Maybe OSS imitate any good qualities it has, too.
I've been using FreeBASIC for about 10 years and help maintain a 100+kLOC codebase written in it (a game engine).
FreeBASIC has multiple dialects; there's the qb dialect that supports most of QB except some audio and real-mode DOS-related commands, and the modern fb dialect, which is all of C plus half of C++ with BASIC syntax. And it does improve on C and C++ in several ways, like much better string support and a "preprocessor" that looks like the C preprocessor but is far more powerful (it's not a preprocessor, so it knows about types and variables, etc).
Of course it's not better than QBasic in every way: it's not interpreted with that awesome edit-and-continue ability that QBasic had. And the compiler can be quite buggy.
There are also a number of other QB successor languages, like QB64, which has a focus on the QBasic IDE and supporting all of the audio-visual stuff QB had fully. But (after comparing the codebases) will say FB is written far more like a professional product.
Thanks for the review. Sounds like it's what I used to call an "industrial" BASIC where it has the features and compiler to get real work done. Many people think some toy with a few key words and interpretation when they think BASIC. Yet, I used to do all my hacking in it and Visual Basic 6 for GUI layer. Loved VB6 specifically for rapid iteration: instant load, instant test-run, instant... you name it on P3 400Mhz w/ 128MB RAM.
That efficiency on arbitrary hardware is something industrial BASIC's and Wirth languages have in common. Only Go can touch it these days but still not low-level as Wirth stuff gets.
Yes, I would agree with "industrial", especially since you can link with any C library after translating the headers with SWIG (translations of common libraries like C, winapi and GTK are included with FB). I've never used/don't know VB, but it appears that quite a lot of FB's design is borrowed from it. In recent years FB has been focused on borrowing C++ features instead (and even aiming to be ABI compatible with g++, not sure if that works). E.g. recently added "dim byref" (like a C++ reference variable) and polymorphism + RTTI. Sometimes things move in the other direction, like binary literals new in C++14 :)
>to realize that in more than 30 years, we have not been able to come up with something better for our kids: Qbasic ..., but we have never really made a simpler or more direct access to the thrill of programming than QBasic.
First, I think it's really cool that he's exposing a young mind to programming. But I'm also old enough to have installed QBasic from floppy disks and part of me thinks his statements I quoted are romanticizing QBasic a little bit.
I think that Javascript in today's browser is a fine substitute. I've had good experience with children that age by going to the browser, pressing F12, go to Console tab and start typing code. It can start as simple as:
alert("hello world");
And boom, you get a popup. You can also show the kid he can type in arithmetic stuff like "2+3" and he'll get back the answer 5. You can then show him how to modify the existing web page. You can ramp up a slight bit of complexity by showing how to create a text file and writing Javascript and then having the browser run it. The 8-year olds I've seen can handle this no problem.
What I like about the Javascript-for-kids approach is that it shows them that programming isn't some other universe where you install QBasic in a vm. Instead, the initiation into programming/experimentation is just 2 keystrokes away. There's something about the immediacy of F12-Javascript that keeps it from being an esoteric dark corner. The kid can also get more mileage out of his "programming" knowledge because he can use his Javascript console tricks at his friend's house on any web browser. On the other hand, playing with QBasic today is more isolating. The use of QBasic in 1980s had more utility because the syntax of '10 PRINT "HELLO"' also worked on Apple II, Commodore 64, Radio Shack TRS-80, Texas Instruments TI-99, etc.
JS is a fantastic language for teaching the basics of programming - introducing variables, flow control, etc.
The problem is that as soon as you go beyond "write a series of statements and run them" and in to actually trying to write something interesting and fun with a little abstraction or actual software design then JS very quickly stops being a good choice. You can quickly hit synchronicity problems, weird scoping issues, data typing difficulties. Those are things that could easily frustrate an interested person.
A hour or two of JS as an introduction followed by learning a BASIC variant is probably a really good bet.
> My favorite is the date, where you months are 0 to 11, and days are 1 - 31.
I think this is something you need to blame UNIX for. Or who knows, maybe something made even earlier.
That said, there is a logic behind that. Days we usually represent with numbers. Months we often represent with names. So the month numbers are returned as an index of a sequence of names. (Not saying I like this logic, but it sort of makes sense.)
> I think this is something you need to blame UNIX for. Or who knows, maybe something made even earlier.
Continuing forward with bad designs doesn't absolve you from them, though. Plenty of languages avoid this--look at how .NET handles dates and times, it has no real relation to the underlying OS on either Windows or *nix.
This was a design error introduced by, apparently, Dennis Ritchie (RIP) in the early 1970s, when ctime() was split into asctime() and localtime(), around the time UNIX was rewritten in C. It kind of makes sense in the context of implementing ctime(). But it was still a design error.
I agree with your complaints about QBasic but I disagree a bit about JavaScript. You are totally right that the environment being right there in the browser is great. But if you press F12 right now you'll find an amazing complex dialog box -- as a professional you just implicitly skip over that complexity. And JavaScript is a significantly more difficult language than QBasic even if it's one of the simpler professional languages.
When I taught my daughter about programming I actually installed an old copy of Visual Basic 6.0 and it was really good for that. You draw the UI and the interact it with it mostly procedurally. She created a small useful application out of it. It's kind of crazy that in 2016 all our programming environments are more complicated than VB6.
It's always Python+X somehow, where X is a whole different thing you have to learn to get a fraction of the whole thing shipped in Python. Keep I.T. simple - teach the kids BASIC.
Isn't TK usually part of the standard library? Of course, then you have to build your UI in code, which can be a lot for a beginner - which I why I stated QML or GTK Composite Templates, both allow you to design your UI in the relevant tool (QtCreator, Glade) and then just wire it up. Speaking from experience, the trial and error of creating UI's in code instead of through a markup language with an editor that can preview it is a pain.
Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import turtle
>>> turtle.forward(100)
I don't really think GTK is that difficult to get a grasp on with composite templates. It's a little less "magic" than VB6 since I'm not just dumping code into a partial form class where the rest of the accessors to the COM controls are generated for me, but it's pretty straightforward in Vala right now (I use glade to design a UI, much like the classic WinForms designer - annotate a class with a GtkTemplate attribute and then put GtkChild attributes on class members to have the widgets automatically assigned there).
GTK in FreeBASIC is simple as well - just translate the C function calls into BASIC. FreeBASIC is really C++ without the curly braces so it's really a good covert way to gradually turn userland programmers into system programmers
Yes. I've been doing Javascript + HTML games with my 9yo nephew every now and then, and the complexity of the environment as a whole is incredibly discouraging. Sure, he gets assignment, functions, conditionals and other basics. But the interface between the logic and the presentation is just so incredibly abstract that getting from those basics to anything interesting is way too hard.
I've been thinking of switching over to some other environment the next time we do that. The immediacy and integration into an environment he already uses every day are compelling advantages, and it'll be a shame to lose them. But it does feel like the downsides easily outweigh the benefits.
Consider using an HTML5 canvas (with a 2D rendering context) instead of DOM manipulation.
It makes programming very similar to QBasic's LINE, CIRCLE, PAINT.
I write a lot of stuff with the Canvas in general, but it's not great for teaching programming. The Postscript imaging model is again very abstract, complex, and easy to misuse early on. It can be made to work if by setting up a lot of scaffolding up front.
And then there's interfacing the other way around, which the Canvas doesn't help at all with or makes even more complicated. It's somewhat easy to explain an onClick handler for a HTML button; doing a useful onClick handler for a canvas, or body-level onKeyDown handler are again much more complicated affairs.
>But if you press F12 right now you'll find an amazing complex dialog box -- as a professional you just implicitly skip over that complexity.
That observation is fascinating to me. Isn't it possible that we're judging it with adult eyes? To me, kids can filter out "ui complexity" that's not relevant to whatever exploration they are doing. Examples I think of:
A microwave oven[1] might have 25 separate buttons on it but a 6-year old will know the 2 buttons to press to heat up the popcorn. Yes, the keypad complexity handles more advanced techniques of 2-stage cooking with different power levels etc but the child just ignores all of that.
Or, how many of us grew up with those multi-component integrated stereo racks?[2] The front panel has all those buttons, sliders, knobs, and lights. And yet, a small child knows how to turn the FM knob to find his favorite radio station or rewind a cassette to replay a song.
I also see video games[3] that 6 to 8 year olds play (even if the game wasn't intended for that younger age group). To me, the screenshots show a complex "dashboard" at the bottom of weapons or other status. (I'm not a Starcraft player and it all just looks complicated and confusing to me.)
I think kids can look at the "complex" F12 screen the same way as microwave ovens, stereo receivers, and Starcraft screens: ignore the non-relevant UI elements and just type "alert ("hello");"
The real problem is there is no ISO Standard for the appliance interfaces. Do you press power level first? Or time first. Is it Forth like, numbers then operation or Haskell like, Function then number. My refrigerator has illuminated bars indicating how cold it is set for. Even after downloading a pdf of the user guide I can't figure out if I'm setting it correctly. Placing a thermometer inside and using trial and error solved the problem (after a few frozen bags of spinach).
So that you know it worked. Even without looking at the small display that also usually changes in response.
This is what I miss about older technology - especially dumbphones. The input always worked, and always worked with the same timing. I could operate my Sony Ericsson K800i without looking at the screen because my brain memorized the sequences of buttons and timings of common operations. Joystick press, up, up, press, down, press, wait about a second, press, done. Compare with Android phones which routinely ignore or misinterpret input ("that was a swipe, not a press!"), and hang at unpredictable moments for unpredictable amount of time (usually also ignoring input while hung).
Input lag is the mortal sin of UI design, and it's ignored everywhere except on dedicated appliances (touch phone, microwave, fridge). Instant response is not a given. I wish OS designers treated the user as a real-time system with hard deadlines.
One benefit, though not necessarily intended by the manufacturers, is that blind users get some kind of feedback for each keypress, since there's usually no tactile feedback on a microwave.
I once spent half an hour reading the microwave manual (in Japanese) looking for some hidden way to disable the beeps. If you hold down one of the keys for over 5 seconds it puts you in silent mode, also disabling the annoying melody when heating is finished.
Personally I think problems people have with appliances like microwave ovens are a combination of fear and intellectual laziness (aka. not expecting to have to figure out anything for themselves anymore). Probably the same thing as with computers in general[0].
Most of appliances provide functions expected from devices of their class and follow obvious patterns that you quickly internalize. I have a running bet with my friends that I can operate any electronic appliance without a manual. The hardest case I've ever had so far was setting the clock on a microwave that provided alternative functionality under "START" button when the oven doors were open. It took me a few minutes to crack that one.
My microwave has two knobs. One for power, one for time. It turns on automatically when you turn the timer and turns off automatically (sounding a mechanical bell) when the timer hits zero.
I used one of those microwaves once. Best interface ever, and so much simpler than the high-tech beepy button matrix! Do microwave manufacturers just not realize that they're making their products worse by complicating them? I don't get it.
Actually, yes. Anything with a moving part is painfully expensive, which is why cheap monitors try to reduce the number of buttons or use capacitative touch-sensitive controls.
Touch-sensitive membrane buttons like the ones the use on the front of microwaves are much cheaper than mechanical timers.
My family had a microwave like that for ages, and I loved it. I think it was over 20 years old by the time they got a new one, because it was so rugged and easy to use.
Yeah.. kids are tougher than we tend to give them credit for. I got an Amiga 500 when I was 10 years old, try playing Carrier Command, Elite or something like that without a manual and no clue what any of the words mean :) We sometimes didn't get very far, or missed out on many aspects, but there was still so much we did get out of it, so we kept hanging on, and with everything we understood, other things became easier to understand. I basically learned English that way, once I got a dictionary, since the coolest and best games and applications generally were in English. I didn't even notice I was learning you might say, I was too busy stacking boxes to get the banana :D
Ah, Carrier Command... I'm going to have to play that again. Powered on my Amiga 500 on my desk yesterday after almost two years, and to my amazement the battery kept the correct time.
My A4000T is also still working fine (last time I checked), but of course the HD died. One of these days I will get a CF or even SSD in there, maybe get a nice mouse and indulge myself to bits. http://aminet.net/ is still here and nice things still get made, after all :)
What miss most is using tools like ExoticRipper to grab music modules from memory after reset, to then play them at leisure and examine/change them with a tracker. Or playing around with the "Action Replay" modules I-III, that blew my mind too. Making a pause toggle by connect the mass of the case to a specific pin of the extension slot, haha, I was so scared doing it and so shocked it actually worked. I may not have learned so much I ended up still using (except today I prefer Renoise to all other DAW), but I sure learned a lot about learning, that is, wildly poking around to figure things out.
I think the "thrill of turning text into action" might be an adult sentiment. I wouldn't write this off.
I decided I wanted to learn to "program" when I was 8, but I had no mentors, and no adults I knew could tell me how programs were made. I found QBasic lurking in the C drive, and got some books from the library, but without anyone to help my 8 year old brain couldn't get far alone. I got it to switch resolutions and draw some static pictures, but nothing else. I was frustrated.
Eventually I found and started playing with Games Factory, then Multimedia fusion from Clickteam, which is is sort of related to this, programming without typing. It was something my 10-year old self could understand on its own! I got a solid intuition of thinking in logic, and. Being able to set up some crazy causes and effects myself was really exciting. I made some "cool" stuff, for a 10 year old.
Once I found that limiting I tried to learn text-based programming again and by that time I was able to read code and puzzle out what it did from the concepts I learned. Maybe being a couple years older helped too.
I can't stand using tools like that as an adult, but without visual programming, I probably would've given up. Yet I paid my way through college writing Java/AS3/C, and now I made a living in games.
Don't get me wrong, I think that any environment aimed at children needs to be highly visual. One of the most common environments for teaching programming to kids used to be Logo. But it was still 'type commands' => 'produce visuals' and I think there is value in that. A lot of Logo wasn't even producing programs but seeing what crazy affects you could get through one line of "code".
Almost almost all modern programming environments, including JavaScript in the browser, require a lot of work to produce a simple visual.
However, Scratch feels like it does too much and becomes more like solving puzzles rather than creation.
My daughter learned to program with Scratch. It is definitely the right approach for more visually-oriented kids. She created some cool (to her) games, and found it so compelling that she turned some of her friends onto Scratch, who also then created games. Playing each others games and looking at the "code" was an important aspect of the learning experience.
Visual Basic 6.0 was great for learning how to program!
You could create GUIs and easily share self-contained exes with your friends. Also very cool was the documentation, complete, offline and and with lots of examples.
I initially got into programming through Apple HyperCard/HyperTalk on the outdated school computers, but it was rather clunky and limiting in what you could do without going through the C interface.
Well yes it was online in that sense, which was great. But what I meant to point out was that the complete MSDN help library came shipped on two CDs that you could locally install. It was really really good. There was a description, detailed background info, and usually at least a few example code snippets using the function. I was later a astonished at how sparse and useless documentation for many other libraries/languages was compared to that, especially when it came to example usage. Some notable disappointments included e.g. the Java/JDK docs (v1.4) and the early Android docs (v1), which both required looking at the code because the docs were severely lacking (both have improved by now).
I think you can still download the whole MSDN help library for offline use, but I don't believe that nowadays that would be enough for daily work use. Lots of useful info and example use is scattered around blog posts and StackOverflow answers now, instead of being a part of the documentation itself.
Not really. The VB6 exes required a huge runtime to be installed. Plus all the visual controls lived inside of OLE DLLs als native code and you had to ship these too (and register them on the target machine)
This was the biggest motivator for me to move to Delphi because that actually produced self-contained exes and allowed you to call any Windows API directly without any COM wrappers in between.
And you had a real type system. And pointers. But you still had an easy GUI editor and a very good class library that was incredibly easy to use.
As someone who actually learned programming with JavaScript, back in IE 5 days, I agree. Writing dumb little "guess the number" games or copy-pasting snippets from DynamicDrive.com to study and adapt made it very easy to get started, and that you can upload it to a free host and share the link gives you an extra incentive.
I've since learned a few more languages, and I don't particularly enjoy writing complex JS programs, but I'm very glad it was there when I got started.
You missed out - there is nothing quite like getting your first picture on the screen with the Copper, or doing your first scroller with the Blitter, or hearing your first Future Composer tune play correctly inside of a working level 3 interrupt request...
Yeah, we couldn't afford a computer back then. I learned by spending my Saturdays on the public computers at the library, hence why having access to an interpreter that didn't need to be installed was awesome.
Is it simple to draw a line in JS? Like in one line of simple and straight code, yes? I mean, not adding some divs to some DOM, but actually drawing a line or circle. Drawing is simplifying things for kids.
If I was going to start a child on coding javascript, I would probably do this or codepen rather than a full fledged text editor, ide, or browser built-in console. Move them to the console once they're comfortable and teach them how to use the debugger.
1) Ok, in firefox I opened the console window. 29 buttons. The one to type this in was the thing at the very bottom that looked like ">> " with no cursor in it indicating that you could type in it.
2) typing your code (on this page) ... nothing happens. Element was added at the bottom of a very large page, element was not visible, so I didn't see anything happen.
3) the added element is a white box on a white background. Grand total indication of it getting added was a small adjustment in the (hidden by default) scrollbar on the right of the page ...
4) after that you want to start people out with paths and stroking and state storing and evaluating ?
Making a program like this that responds to keyboard input at all in javascript is dozens of lines, and you have to know DOM, properties, and event handlers in addition to the base language to make anything happen. Getting keyboard handling good enough to have a simple game ... let's not go there. Hundreds of lines. And of course, doesn't work on your friends machine (different browser ...).
I hope you can see that this is less than optimal to get people exited.
I am one of those guys that thinks web programming sucks, that it's far inferior for most programs as compared to Qt/QML and even to Delphi/VB like languages.
Sure! Just locate the element you want to draw in, set up a 2d context, start a path, move to one end of the line, draw a line, and then stroke that line so it fills in! How much simpler could it be really?
I sincerely wish that the post you linked was sarcastic as well, but it was probably serious which makes the (former) QBasic programmer in me a little bit sad.
That's really a question of the APIs you're using rather than the language. If you're using a browser, you don't even need JS to draw the line; you can just go to this URL:
and that works. (Although you could surely argue that the language of processing.js isn't itself JS, but you can invoke its facilities from JS.)
There are also clumsier ways to draw lines, like with DOM manipulation in SVG or drawing stuff on a <canvas>, and those might be desirable for the extra flexibility they give you. But you don't have to start with them.
Part of learning HOW to program has always been how to SELL your program. The BASIC programming language has always offered an easy path to doing just that. No googling what to use to turn the code into an executable like Python, no learning a whole library to do that either like Javascript& the node.js nightmare. Code -> Ship -> Profit (or get famous) - Any Basic, any platform, whether your machine runs at 8Mhz or 4Ghz.
> I think that Javascript in today's browser is a fine substitute.
I cannot think of a more complicated way to introduce someone to programming. Yes, you can use `alert` and print things, but that's about where the ease of interaction ends.
Absolutely, this is what I miss, both for myself and for teaching youngsters. Not even Python or Javascript has an easy way to just get a full screen canvas that lets you set RGB colors onto pixels and draw shapes.
The python way is to import pygame and get mired in page flipping, creating canvases, creating your own event loop, etc.
The javascript way is to create an HTML5 canvas, learn how to get page elements and store them in a variable, and where to put your code so it will run at the right time, etc.
Both have so much scaffolding before you can just create some procedural graphics and begin to reason about x and y coordinates in a way that's fun and shows the power of programming visually.
My hobby with QBasic was making variations on Conway's Game of Life. So easy and fun in that language compared to anything else.
Some screen modes[1] like screen 9 actually had page flipping as an option. You could write to the "back" screen buffer and then switch which buffer was shown. I used that to make a poor man's strobe light.
My favorite thing about this story is that Basic was meant to be used exactly this way, for getting new programmers off the ground. And like everyone, I've got fond memories. We had an IBM PS/2 80286, with a whole megabyte of memory, a 20 megabyte hard drive, and MS-DOS three point something. At some point, I discovered that it had Basic, but it didn't have a graphical editor. It had edlin, which was still enough to write programs that told their users how awesome I was. Forever, with gotos.
And for the record, I don't think using gotos as a child sabotaged my ability to write structured code later in life. "GOTO considered harmful" gets taken way out of context!
I've always thought that learning to follow GOTOs and GOSUBs was the key to understand assembly language. "GOTO considered harmful" is really what's considered harmful. I never take anyone who says "X considered harmful" seriously because of "GOTO considered harmful".
"GOTO considered harmful" is about a style of unstructured programming that was prevalent in its era.
GOTOs are certainly not harmful on their own. But they offer a power that leads to unmaintainable and unreasonable [0] code. Like the spaghetti mess that is callback hell today. Languages which offer structured constructs that are really just syntactic sugar over GOTOs are better [1]. Structured use of GOTOs are feasible. But it requires a discipline that is not found in the community at large. If you're responsible for any project involving more than yourself as the developer, you cannot assume that discipline is present.
With regard to assembly, yes, the branching and jumping instructions are the gotos Dijkstra was talking about. No, he wasn't wrong. The thing is, they have to be used in a disciplined manner or the outcome is extremely fragile code. Which was one of his biggest hobby horses. He viewed programming as a branch of mathematics. Where programs could be derived from first principles. GOTOs, as commonly used, necessarily broke that process. They also make it nigh impossible to understand poorly disciplined code. Same thing with magic numbers, weak type systems, and a number of other topics. They aren't bad on their own. They're bad when used in practice because they make undisciplined code trivial to produce.
[0] In the sense that the code cannot be reasoned about.
[1] In a strict sense, they're equivalent. In a less strict sense, they remove or minimize the ability to make unreasonable [0] code.
I agree -- the whole "considered harmful" meme is long overplayed. I don't even click on links with "considered harmful" in the title. The original point, which was that GOTO abuse was letting undisciplined programmers create impossible-to-follow control structures, was true in its time. I've seen some truly headache-inducing GOTOs in 1970s-era FORTRAN that involve jumping into the middle of loops and the like. But the modern point of view that rejects GOTO out of hand is just ignorant.
I don't think QBasic's mainstream popularity can be understated. Googling "gorillas.bas" gives you a predictable result. I suppose it can be argued that Gorillas and Nibbles are partly responsible for QBasic's popularity (is there a lesson in here somewhere?).
However, like many others, QBasic was not my first experience with a BASIC language. Prior to that was GW-BASIC on PC (it was part of our introductory course to Computers at high school), and before that was Sinclair BASIC, which I learned in part from a book called "Peek, Poke, Byte and RAM"
I'm sure there was a BBC Kids show that featured Logo programming (yes, they drew shapes with the turtle), but I can't remember the name. What I liked about Logo was that, as a child, it seemed very intuitive, and I felt like that even without having touched a computer I knew what programming was about, which is a lot more than I can say for any other language I've worked with.
I am curious what's there to stop a kid from starting a Jupyter notebook (or even Mathematica with all the FullSnakeCaseNames) and firing away? Sure it isn't complex at least wrt. the basics (pun intended)?
Grandpas know BASIC and they can teach any version of it to their grandkids in under 2 weeks tops, they don't necessarily know Jupyter notebooks or Mathematica (how much does that cost these days?).
Ha! Who didn't hack the gorilla throwing bananas? :)
I learned to programm with BASIC [0] before on a Spectrum ZX clone, however that GORILLA.BAS [1] was a good programming lesson. I remember even now, after 25 years, figuring out the algorithms and the parameters of the flying banana.
I remember learning to program with QBasic as well. It was so much fun as a kid. I painstakingly drew out full scenes with line and circle commands for a small text based adventure game. Good times.
QBasic was a truly incredible way to start programming.
Today I'd probably recommend python with pygame, and especially the book inventing computer games with python:
https://inventwithpython.com/
No love for Logo? I currently have my kids experimenting with ucbLogo and FMSLogo. And one of our latest endeavors is to hook it up to Minecraft [1], but that is certainly quite convoluted, with having to run minecraft servers with various plugins, and then working around the borked networking capabilities of FMSLogo, etc.. I wonder what other simple approaches there are to programmatically control Minecraft.
OpenComputers is pretty nice, but involves writing Lua code. It features a virtual UNIX-ish OS to put your programs in, including editors; in many ways it's like stepping twenty years back in time.
Electrical Age doesn't have computers. (Yet; I'm working on a PDP-11 simulation.) But it does have a functional DC electricity simulation, and "signal processors" that let you do amazing things with simple functions, as well as OC integration. If you're interested, I could show you around the setup on my dev server.
(Or you could join. High quality players are always welcome. And of course we've got both mods, if you want to experiment... :)
That's what I was missing! Lots of love for Logo here. Started with that first, then eventually to QBasic. There was a lot of time spent on KidPix for a while too. That thing was insane.
I learned through logo in middle school.
A language sophisticated enough to later (high school) write programs that would take equations and graph them.
Plus who doesn't love writing software to create spirograph graphics.
I come back to Logo probably once every 2 years, for about 15 years now. First used it in primary (elementary) school but never really progressed past spirographs.
I think I'll fire it up again this weekend - any hints?
GW-BASIC (QBasic's kinda sorta ancestor) was my first programming language (well, other than Logo I suppose). I still have a soft spot for it and might not be a programmer today if I hadn't first learned on such an easy-to-grok-for-11-year-old-me language.
I've toyed with writing my own GW-BASIC interpreter for yucks (because I've never written an interpreter) but never gotten around to it. Perhaps I should... I've been meaning to learn Rust, maybe that'd be a good excuse?
As a person who taught himself programming (and a bit of English) with QBasic, and also have known many people that did the same. I agree with this article.
But you have other BASICs such as the one for computers such as the ZX Spectrum.
Python in my opinion can also be used to teach programming, since many high level constructs are optional and syntax is simple.
I agree- we should also have just as easy of a way to start off with drawing.
Why do we need to install 50 frameworks, tell a window how to spawn, basically create a universe just to start experimenting with creating computer graphics? It's a (Width x Height) matrix of RGB values-- why can't we get a simple way to create a simple 100x100 box for kids to draw in?
No reason your son couldn't tell a screen to print colored pixels in RGB value with the right syntax.
Ya I can see that, I'm imagining a way a kid could make his OWN logo implementation, though.
Logo is cool because you see the things you tell the little cursor to draw being drawn-- how could a kid implement something like his son's program, though, where a user is prompted to type their name and hit enter-- then a smiley face is drawn if their name is noah and a sadface is drawn if their name is anything else?
Start off with lower primitives. In Logo, for instance, have a "draw at pixel" command. Have a way of recording a state. The student can then recreate the notion of pen on/off and pen placement and movement on top of the basic primitive plus a conditional. Pen is moving from A to B, if it's on, it draws along the way, otherwise it just moves. Some challenges with the math involved in movement, but it's solving a linear equation. Minor issue with rounding, perhaps allow the numbers to be floating point and let the renderer handle which pixel to draw. Everything up to the external turtle can be handled in this same way as long as they have the primitives.
Handling hardware, give them primitives to write to and read from devices. Build up the code on top of that to handle more complex situations like manipulating external servos over a serial port.
I absolutely love Processing. It's a subset of Java with a dead simple IDE. Bonus points for exporting to Android, javascript, and executable jars for the desktop. Comes with excellent examples. The community is generally quite supporting and open as well.
And to answer your question "why can't we get a simple way to create a simple 100x100 box for kids to draw in?"
Here's the processing code that does exactly that:
void setup() {
size(100,100)
}
That pops a blank 100x100 box onto the screen. Drawing a line is line(start_x, start_y, end_x, end_y).
Adding interactivity and animation is as simple as adding:
Processing is a great and fun way to learn programming! I learned it that way, and I found that it kept my interest cause I could use it in a creative way while it also was easy to use.
I remember doing the same. Starting with a Qbasic book I had bought with the little money I had, I was already writing mud-like games and calculating prime numbers after only an hour. Though I wasn't lucky enough to have done it at that age. Lucky kid :)
307 comments
[ 2.7 ms ] story [ 340 ms ] threadIt's a fortunate thing to have common interests with your child. I can't wait to have my daughters show even the slightest interest in coding. They are toddlers, so I have to just wait.
The Pi is $35 and has HDMI out and lots of USB ports. It's pretty great.
What software do you have running on the Pi for your 3.5-year-old?
A colleague of mine had a lot of success with Edubuntu. [2] Her six-year-old is a whiz at the command line. Again with the keyboard use, so not quite appropriate.
I'm still looking, basically. He likes clicking around and seeing that he's having an effect on things, but he usually ends up at YouTube, which isn't so great.
[1]: kano.me
[2]: https://www.edubuntu.org/
I spent some time fiddling around with assembly when I was a teenager to run a TSR (terminate and stay resident, what daemons were called before they were daemons). It would hijack the screen when my little sister was playing a computer game and type out spooky messages like "Help me Sarah... I'm trapped in here" and then go back to the game after a few seconds as if nothing had happened.
Ah, how we laughed (after her nightmares stopped)...
I volunteer at a local Coder Dojo and there's nothing to give these kids who want to fiddle around like that. Scratch is the closest I've found (with the bonus of not having to necessarily be able to read or type), but it's still cluttered with logins and passwords... and, being a GUI, it suffers when the kid's computer doesn't have a big enough screen to manage the complexity they eventually create. It's a shame. I tell kids who've grown tired of Scratch that they can "graduate" to Stencyl, a game engine that uses a similar visual programming metaphor but lets you drop down to the Haxe beneath. It also compiles natively to desktop or mobile, so that's cool too.
Python, ruby, and JS are all really close to the ideal "type and go" environments, but they're also littered with speedbumps. Installing packages and keeping the environment sane are difficult enough for some professional engineers, let alone kids who just want to mess around and make cool stuff.
The woman who started my local Coder Dojo got her son started with his own Linux computer at a really young age and he's a whiz at it, so maybe there's no real problem here and I'm just underestimating the ingenuity of these kids. They'll get it done if they really want it, I guess?
EDIT: Kinda apropos, but check this out! http://beagle.applearchives.com/the_posters/ I would've killed for these posters when I was a kid.
https://www.raspberrypi.org/blog/celebrating-50-years-of-bas...
There is newer, multi platform implementation called QB64 http://www.qb64.net/
I managed to make it solve second-degree equations in less than 33 steps (using the RST jump to re-run part of the program on modified data). Without the trick it'd require, IIRC, 35 steps, which were beyond the limits of that model.
http://www.freebasic.net/
After loosing my memory, I have to relearn programming nearly from scratch. I took a challenge to do specific program in around an hour, from language to toolchain to solution. Had to be system-like language. Got bogged down by toolchains, IDE's, whatever. Said screw it: why the hell is it so hard when I faintly recall starting lightening-fast on QBASIC? Found a BASIC, FreeBASIC, that was just like it with simple command to launch stuff made in text editor and good documentation. Maybe half an hour of my challenge gone.
Next, time to apply lessons I remembered from high-assurance and Wirth. First, subset the language to minimum necessary. Used docs to test each in isolation to develop template & functions for using them, esp file I/O. Wrote formal spec in English & pseudocode of my problem with decomposed functions. Mapped almost 1-to-1 to FreeBASIC as expected. Did one refactoring. Executed code for first time to see successful run & solution to problem.
Yeah, BASIC is friggin awesome. I stretched industrial BASIC's, esp 4GL's, really far back when I was a hacker as they did rapid iteration, safe-by-default, and ran fast. Today, I'd say do a Wirth language like Oberon or Component Pascal instead. Still, BASIC has lessons to teach us and a painless bootstrapping for developer that many modern tools lack outside of scripting.
Wow, so you forgot how to write code? May I ask how that happened?
But, yeah, lost most memory except stuff I repeated most along with muscle memory anx hand-eye. (Shrugs). Supposed to be thoughtless drone but I do well here on many topics despite working with pieces and little short-term memory.
Since then, although my condition hasn't changed, I've at least pursued that hardware research to get very far. One thing was finding where SW and HW connect with those FSM's as I predicted. Already have 2-3 methods to express software that (a) can integrate with verification tech and (b) can auto-generate hardware from it. So, slow but steady progress toward grand challenges and such. :)
My first QBASIC/FreeBASIC program I've managed to write some 15 years ago: https://bitbucket.org/tarballs_are_good/nibbles-and-bits/raw...
[1]: http://smallbasic.sourceforge.net/
FreeBASIC has multiple dialects; there's the qb dialect that supports most of QB except some audio and real-mode DOS-related commands, and the modern fb dialect, which is all of C plus half of C++ with BASIC syntax. And it does improve on C and C++ in several ways, like much better string support and a "preprocessor" that looks like the C preprocessor but is far more powerful (it's not a preprocessor, so it knows about types and variables, etc).
Of course it's not better than QBasic in every way: it's not interpreted with that awesome edit-and-continue ability that QBasic had. And the compiler can be quite buggy.
There are also a number of other QB successor languages, like QB64, which has a focus on the QBasic IDE and supporting all of the audio-visual stuff QB had fully. But (after comparing the codebases) will say FB is written far more like a professional product.
That efficiency on arbitrary hardware is something industrial BASIC's and Wirth languages have in common. Only Go can touch it these days but still not low-level as Wirth stuff gets.
First, I think it's really cool that he's exposing a young mind to programming. But I'm also old enough to have installed QBasic from floppy disks and part of me thinks his statements I quoted are romanticizing QBasic a little bit.
I think that Javascript in today's browser is a fine substitute. I've had good experience with children that age by going to the browser, pressing F12, go to Console tab and start typing code. It can start as simple as:
And boom, you get a popup. You can also show the kid he can type in arithmetic stuff like "2+3" and he'll get back the answer 5. You can then show him how to modify the existing web page. You can ramp up a slight bit of complexity by showing how to create a text file and writing Javascript and then having the browser run it. The 8-year olds I've seen can handle this no problem.What I like about the Javascript-for-kids approach is that it shows them that programming isn't some other universe where you install QBasic in a vm. Instead, the initiation into programming/experimentation is just 2 keystrokes away. There's something about the immediacy of F12-Javascript that keeps it from being an esoteric dark corner. The kid can also get more mileage out of his "programming" knowledge because he can use his Javascript console tricks at his friend's house on any web browser. On the other hand, playing with QBasic today is more isolating. The use of QBasic in 1980s had more utility because the syntax of '10 PRINT "HELLO"' also worked on Apple II, Commodore 64, Radio Shack TRS-80, Texas Instruments TI-99, etc.
The problem is that as soon as you go beyond "write a series of statements and run them" and in to actually trying to write something interesting and fun with a little abstraction or actual software design then JS very quickly stops being a good choice. You can quickly hit synchronicity problems, weird scoping issues, data typing difficulties. Those are things that could easily frustrate an interested person.
A hour or two of JS as an introduction followed by learning a BASIC variant is probably a really good bet.
No. It's a language to scare - and scar - young programmers for life.
true == 1 → true
true == "1" → true
false == 0 → true
false == "0" → true
false == undefined → false
false == null → false
null == undefined → true
"\t\r\n" == 0 → true
"\t\r\n 16 \t\r\n" == 16 → true
"\t\r\n 16 \t\r\n" == "16" → false
var a = "foobar"
var b = typeof a → 'string'
var c = a instanceof String → false
[1] https://whydoesitsuck.com/why-does-javascript-suck/
I think this is something you need to blame UNIX for. Or who knows, maybe something made even earlier.
That said, there is a logic behind that. Days we usually represent with numbers. Months we often represent with names. So the month numbers are returned as an index of a sequence of names. (Not saying I like this logic, but it sort of makes sense.)
Continuing forward with bad designs doesn't absolve you from them, though. Plenty of languages avoid this--look at how .NET handles dates and times, it has no real relation to the underlying OS on either Windows or *nix.
When I taught my daughter about programming I actually installed an old copy of Visual Basic 6.0 and it was really good for that. You draw the UI and the interact it with it mostly procedurally. She created a small useful application out of it. It's kind of crazy that in 2016 all our programming environments are more complicated than VB6.
In Python it'd look like
I've been thinking of switching over to some other environment the next time we do that. The immediacy and integration into an environment he already uses every day are compelling advantages, and it'll be a shame to lose them. But it does feel like the downsides easily outweigh the benefits.
And then there's interfacing the other way around, which the Canvas doesn't help at all with or makes even more complicated. It's somewhat easy to explain an onClick handler for a HTML button; doing a useful onClick handler for a canvas, or body-level onKeyDown handler are again much more complicated affairs.
That observation is fascinating to me. Isn't it possible that we're judging it with adult eyes? To me, kids can filter out "ui complexity" that's not relevant to whatever exploration they are doing. Examples I think of:
A microwave oven[1] might have 25 separate buttons on it but a 6-year old will know the 2 buttons to press to heat up the popcorn. Yes, the keypad complexity handles more advanced techniques of 2-stage cooking with different power levels etc but the child just ignores all of that.
Or, how many of us grew up with those multi-component integrated stereo racks?[2] The front panel has all those buttons, sliders, knobs, and lights. And yet, a small child knows how to turn the FM knob to find his favorite radio station or rewind a cassette to replay a song.
I also see video games[3] that 6 to 8 year olds play (even if the game wasn't intended for that younger age group). To me, the screenshots show a complex "dashboard" at the bottom of weapons or other status. (I'm not a Starcraft player and it all just looks complicated and confusing to me.)
I think kids can look at the "complex" F12 screen the same way as microwave ovens, stereo receivers, and Starcraft screens: ignore the non-relevant UI elements and just type "alert ("hello");"
[1]https://www.google.com/search?q=microwave+oven+keypad&source...
[2]https://www.google.com/search?q=integrated+stereo+rack+turnt...
[3]https://www.google.com/search?q=starcraft+ii+screenshot&sour...
This is what I miss about older technology - especially dumbphones. The input always worked, and always worked with the same timing. I could operate my Sony Ericsson K800i without looking at the screen because my brain memorized the sequences of buttons and timings of common operations. Joystick press, up, up, press, down, press, wait about a second, press, done. Compare with Android phones which routinely ignore or misinterpret input ("that was a swipe, not a press!"), and hang at unpredictable moments for unpredictable amount of time (usually also ignoring input while hung).
(At least every microwave I ever operated was pretty loud when cooking.)
Most of appliances provide functions expected from devices of their class and follow obvious patterns that you quickly internalize. I have a running bet with my friends that I can operate any electronic appliance without a manual. The hardest case I've ever had so far was setting the clock on a microwave that provided alternative functionality under "START" button when the oven doors were open. It took me a few minutes to crack that one.
[0] - https://xkcd.com/627/
I believe the timer is clockwork.
Touch-sensitive membrane buttons like the ones the use on the front of microwaves are much cheaper than mechanical timers.
$c00000 - FAKE FAST LOCATED
What miss most is using tools like ExoticRipper to grab music modules from memory after reset, to then play them at leisure and examine/change them with a tracker. Or playing around with the "Action Replay" modules I-III, that blew my mind too. Making a pause toggle by connect the mass of the case to a specific pin of the extension slot, haha, I was so scared doing it and so shocked it actually worked. I may not have learned so much I ended up still using (except today I prefer Renoise to all other DAW), but I sure learned a lot about learning, that is, wildly poking around to figure things out.
I decided I wanted to learn to "program" when I was 8, but I had no mentors, and no adults I knew could tell me how programs were made. I found QBasic lurking in the C drive, and got some books from the library, but without anyone to help my 8 year old brain couldn't get far alone. I got it to switch resolutions and draw some static pictures, but nothing else. I was frustrated.
Eventually I found and started playing with Games Factory, then Multimedia fusion from Clickteam, which is is sort of related to this, programming without typing. It was something my 10-year old self could understand on its own! I got a solid intuition of thinking in logic, and. Being able to set up some crazy causes and effects myself was really exciting. I made some "cool" stuff, for a 10 year old.
Once I found that limiting I tried to learn text-based programming again and by that time I was able to read code and puzzle out what it did from the concepts I learned. Maybe being a couple years older helped too.
I can't stand using tools like that as an adult, but without visual programming, I probably would've given up. Yet I paid my way through college writing Java/AS3/C, and now I made a living in games.
Almost almost all modern programming environments, including JavaScript in the browser, require a lot of work to produce a simple visual.
However, Scratch feels like it does too much and becomes more like solving puzzles rather than creation.
You could create GUIs and easily share self-contained exes with your friends. Also very cool was the documentation, complete, offline and and with lots of examples.
I initially got into programming through Apple HyperCard/HyperTalk on the outdated school computers, but it was rather clunky and limiting in what you could do without going through the C interface.
I think 'online' [1] is the word you wanted to use. ;)
[1] https://en.wikipedia.org/wiki/Online_help
I think you can still download the whole MSDN help library for offline use, but I don't believe that nowadays that would be enough for daily work use. Lots of useful info and example use is scattered around blog posts and StackOverflow answers now, instead of being a part of the documentation itself.
Not really. The VB6 exes required a huge runtime to be installed. Plus all the visual controls lived inside of OLE DLLs als native code and you had to ship these too (and register them on the target machine)
This was the biggest motivator for me to move to Delphi because that actually produced self-contained exes and allowed you to call any Windows API directly without any COM wrappers in between.
And you had a real type system. And pointers. But you still had an easy GUI editor and a very good class library that was incredibly easy to use.
I've since learned a few more languages, and I don't particularly enjoy writing complex JS programs, but I'm very glad it was there when I got started.
How's that?
https://github.com/davebalmer/turtlewax
http://berniepope.id.au/html/js-turtle/turtle.html
2) typing your code (on this page) ... nothing happens. Element was added at the bottom of a very large page, element was not visible, so I didn't see anything happen.
3) the added element is a white box on a white background. Grand total indication of it getting added was a small adjustment in the (hidden by default) scrollbar on the right of the page ...
4) after that you want to start people out with paths and stroking and state storing and evaluating ?
Making a program like this that responds to keyboard input at all in javascript is dozens of lines, and you have to know DOM, properties, and event handlers in addition to the base language to make anything happen. Getting keyboard handling good enough to have a simple game ... let's not go there. Hundreds of lines. And of course, doesn't work on your friends machine (different browser ...).
I hope you can see that this is less than optimal to get people exited.
I am one of those guys that thinks web programming sucks, that it's far inferior for most programs as compared to Qt/QML and even to Delphi/VB like languages.
The howto could be a whole lot simpler it seems, see this example, helpfully provided by neckro23 https://news.ycombinator.com/item?id=11637866
http://www.bing.com/search?q=sarcasm
I sincerely wish that the post you linked was sarcastic as well, but it was probably serious which makes the (former) QBasic programmer in me a little bit sad.
I thought it was a well intended explanation that just wasn't detailed enough.
There are also clumsier ways to draw lines, like with DOM manipulation in SVG or drawing stuff on a <canvas>, and those might be desirable for the extra flexibility they give you. But you don't have to start with them.
Depends on the browser. IE > 8 doesn't support it.
[0]https://developer.mozilla.org/en-US/docs/Web/HTTP/data_URIs
I cannot think of a more complicated way to introduce someone to programming. Yes, you can use `alert` and print things, but that's about where the ease of interaction ends.
All the primitives are there and I've never written any code with much GOTOs in them. Just did not feel the need even when I was 10 years old.
What this article clearly lacks is
Seriously, unsurpassed easiness of programmable graphics. Even by javascript, which is otherwise better for teaching.The python way is to import pygame and get mired in page flipping, creating canvases, creating your own event loop, etc.
The javascript way is to create an HTML5 canvas, learn how to get page elements and store them in a variable, and where to put your code so it will run at the right time, etc.
Both have so much scaffolding before you can just create some procedural graphics and begin to reason about x and y coordinates in a way that's fun and shows the power of programming visually.
My hobby with QBasic was making variations on Conway's Game of Life. So easy and fun in that language compared to anything else.
http://processingjs.org/
You can put pixels on screen, draw lines using simple functions and later do 3d stuff in it...
I really miss the simplicity of QBasic sometimes.
[1] http://www.qb64.net/wiki/index.php/SCREEN_(statement)
And for the record, I don't think using gotos as a child sabotaged my ability to write structured code later in life. "GOTO considered harmful" gets taken way out of context!
GOTOs are certainly not harmful on their own. But they offer a power that leads to unmaintainable and unreasonable [0] code. Like the spaghetti mess that is callback hell today. Languages which offer structured constructs that are really just syntactic sugar over GOTOs are better [1]. Structured use of GOTOs are feasible. But it requires a discipline that is not found in the community at large. If you're responsible for any project involving more than yourself as the developer, you cannot assume that discipline is present.
With regard to assembly, yes, the branching and jumping instructions are the gotos Dijkstra was talking about. No, he wasn't wrong. The thing is, they have to be used in a disciplined manner or the outcome is extremely fragile code. Which was one of his biggest hobby horses. He viewed programming as a branch of mathematics. Where programs could be derived from first principles. GOTOs, as commonly used, necessarily broke that process. They also make it nigh impossible to understand poorly disciplined code. Same thing with magic numbers, weak type systems, and a number of other topics. They aren't bad on their own. They're bad when used in practice because they make undisciplined code trivial to produce.
[0] In the sense that the code cannot be reasoned about.
[1] In a strict sense, they're equivalent. In a less strict sense, they remove or minimize the ability to make unreasonable [0] code.
However, like many others, QBasic was not my first experience with a BASIC language. Prior to that was GW-BASIC on PC (it was part of our introductory course to Computers at high school), and before that was Sinclair BASIC, which I learned in part from a book called "Peek, Poke, Byte and RAM"
http://www.worldofspectrum.org/infoseekid.cgi?id=2000269
But my first encounter with a programming language was Logo:
https://en.wikipedia.org/wiki/Logo_(programming_language)
I'm sure there was a BBC Kids show that featured Logo programming (yes, they drew shapes with the turtle), but I can't remember the name. What I liked about Logo was that, as a child, it seemed very intuitive, and I felt like that even without having touched a computer I knew what programming was about, which is a lot more than I can say for any other language I've worked with.
https://en.wikipedia.org/wiki/3-2-1_Contact
Below is an example of it draw dialect:
Many more drawing examples can be found here - http://www.rebol.com/docs/draw.htmlI learned to programm with BASIC [0] before on a Spectrum ZX clone, however that GORILLA.BAS [1] was a good programming lesson. I remember even now, after 25 years, figuring out the algorithms and the parameters of the flying banana.
[0] https://en.wikipedia.org/wiki/Sinclair_BASIC [1] http://www.jefflewis.net/archive/programming/gorilla.bas
[1]http://www.stuffaboutcode.com/2014/05/minecraft-graphics-tur...
Electrical Age doesn't have computers. (Yet; I'm working on a PDP-11 simulation.) But it does have a functional DC electricity simulation, and "signal processors" that let you do amazing things with simple functions, as well as OC integration. If you're interested, I could show you around the setup on my dev server.
(Or you could join. High quality players are always welcome. And of course we've got both mods, if you want to experiment... :)
Plus who doesn't love writing software to create spirograph graphics.
I think I'll fire it up again this weekend - any hints?
Turtle Geometry: The Computer as a Medium for Exploring Mathematics
http://www.amazon.com/Turtle-Geometry-Mathematics-Artificial...
...and I've not yet tried it, but netlogo sounds interesting.
https://ccl.northwestern.edu/netlogo/
I've toyed with writing my own GW-BASIC interpreter for yucks (because I've never written an interpreter) but never gotten around to it. Perhaps I should... I've been meaning to learn Rust, maybe that'd be a good excuse?
Never learned it well, will always have fondest memories.
But you have other BASICs such as the one for computers such as the ZX Spectrum.
Python in my opinion can also be used to teach programming, since many high level constructs are optional and syntax is simple.
Why do we need to install 50 frameworks, tell a window how to spawn, basically create a universe just to start experimenting with creating computer graphics? It's a (Width x Height) matrix of RGB values-- why can't we get a simple way to create a simple 100x100 box for kids to draw in?
No reason your son couldn't tell a screen to print colored pixels in RGB value with the right syntax.
Logo is cool because you see the things you tell the little cursor to draw being drawn-- how could a kid implement something like his son's program, though, where a user is prompted to type their name and hit enter-- then a smiley face is drawn if their name is noah and a sadface is drawn if their name is anything else?
Handling hardware, give them primitives to write to and read from devices. Build up the code on top of that to handle more complex situations like manipulating external servos over a serial port.
I absolutely love Processing. It's a subset of Java with a dead simple IDE. Bonus points for exporting to Android, javascript, and executable jars for the desktop. Comes with excellent examples. The community is generally quite supporting and open as well.
And to answer your question "why can't we get a simple way to create a simple 100x100 box for kids to draw in?"
Here's the processing code that does exactly that:
void setup() { size(100,100) }
That pops a blank 100x100 box onto the screen. Drawing a line is line(start_x, start_y, end_x, end_y).
Adding interactivity and animation is as simple as adding:
void draw(){ ... do stuff ... }
You, and everyone else, should check it out.
Scratch https://scratch.mit.edu/
CodinGame https://www.codingame.com/games
Squeak http://squeak.org/
Logo (even in browser https://turtleacademy.com/)
JsFiddle if you want to go for somewhat longer javascript https://jsfiddle.net/
Alice http://www.alice.org/