5 ms·
I 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 overwhel
by mzs 11y ago
I 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 11y agoYou are teaching him awk? Are you trying to create a supervillain?
- e12e 11y 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 11y agoOr How to Design Programs with Dr Racket. Same effect.
- e12e 11y 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.
- mzs 11y agoRacket is a very nice scheme setup. As a SICPer I initially wondered if I should use a scheme variant for my oldest son but I thought back to my youth and decided against it. in HS I wrote a TP program that plotted functions for my math class. It would run through the line entered looking for whitespace operators like * and + and only keywords like sin before (. Then it would write a .BAS file and run it in qbasic to plot ;) Having later taken SICP in first year CS was mind opening regarding REPL, but I really appreciated having that earlier experience and honestly I needed a certain maturity for the mental abstractness. There's a time for scheme, about the time someone is ready for learning calculus.
- e12e 11y agoSure. But there's no reason one couldn't start with a BASIC-like language in Racket. Someone would just have to implement it and support it. It's crazy powerful, see eg: "Creating Languages in Racket - Sometimes you just have to make a better mousetrap." http://queue.acm.org/detail.cfm?id=2068896j http://queue.acm.org/detail.cfm?id=2068896j
- nickpsecurity 11y agoI originally started with BASIC, created a 4GL with it for productivity, discovered LISP, and re-implemented BASIC in it for incremental compilation & macros. So, yes it's doable. :)
- sn9 11y agoRacket has turtle graphics. [0] Realm of Racket might be a good non-school introduction to programming. [1] I feel like How to Design Programs would be better suited for the classroom, whereas RoR is all about having fun. [0] https://docs.racket-lang.org/turtles/ https://docs.racket-lang.org/turtles/ [1] https://www.nostarch.com/realmofracket https://www.nostarch.com/realmofracket
- e12e 11y agoAs far as I can gather, that module doesn't support traditional (non-lisp) syntax, along the lines of traditional logo graphics? Which could be why the tutorial section[1] prefers the (apparently more well documented) "#lang slideshow", which gives some of the same benefits (a simple syntax for graphics) with some of the same [ed: drawbacks] (an IMNHO slightly higher bar for entry, due to being Scheme, rather than an even easier language). [1] https://docs.racket-lang.org/quick/ https://docs.racket-lang.org/quick/ [ed: Ie: one can't simply cut'n'paste from: http://el.media.mit.edu/logo-foundation/what_is_logo/logo_primer.html http://el.media.mit.edu/logo-foundation/what_is_logo/logo_pr... and get pretty pictures, one has to manually compile (or transpile if you will) from Logo to Scheme first. Which is obviously a job for a computer, not for a brain.]
- Annatar 11y agoAWK is one of the best and simplest languages for a beginner to learn programming. As if that were not enough, it is lightning fast, small, and powerful. When Aho, Weinberger and Kernighan invented AWK, their intent was to invent the next generation C, without having to allocate memory or deal with pointers or data types, and in that, they were a success. AWK is C on steroids.
- ido 11y agoPython is nice, but pygame is just a wrapper around sdl. I am not surprised it was not appealing. How do you do graphics in awk? If you don't then using js and one of the html5/canvas based game engines might be a reasonable step forward.
- mzs 11y agoThe awk script just does terminal escapes, so no real graphics. Canvas is pretty complicated, I'm shying away from that and also since it's time consuming and orthoganal to create pretty pictures for modern hardware. JS is even worse when you try to teach enough to be fancy and portable. In any case I spent some time on it tonight for my son. I've made a little html file that is a nice harness for him to write JS so he does not have to know much of anything other than innerHTML. https://github.com/msliczniak/msliczniak.github.io/tree/master/jake https://github.com/msliczniak/msliczniak.github.io/tree/mast...
- ido 11y agoyeah, i agree canvas is too low level, that's why i suggested one of the game engines that use it under the hood (thus abstracting a lot of the complexity). Phaser is a pretty decent "batteries-included"-style engine (definitely easier to use than pygame, despite js not being as nice as python). A good summery/list in general can be found at https://html5gameengine.com/ https://html5gameengine.com/