Codea Enhancements: Learnable Programming

Summary

I found a great article tonight that I think outlines some great approach to making programming more learnable that could and should be leveraged by Codea to make it even easier to use and encourage broader adoption of Codea as a teaching tool. I’ve recently started to teach my 7 yr old daughter to code and have been thinking a lot about such things lately and its an area that many people could benefit from.

Please check out the following article and give feedback on what you think! :slight_smile:

http://worrydream.com/LearnableProgramming/

Details

I’m a long time programmer who started to learn programming at the ripe age of 8 years old with a Commodore 64 back around 1982. I’ve started to teach my very bright 7 year old daughter how to program and so far she and I are having a blast working together using Codea to make a game she’s titled “Super Kitty Girl!”. :slight_smile:

I’ve been thinking a lot about how to teach programming so I can help my daughter learn the ropes as I did so long ago. Unfortunately, its next to impossible for her to learn the same way I learned because modern computers are so incredibly powerful that there are few constraints on what you can do. Back then, on a C64, I had 16 colors to work with. I had 8 sprites. I had 3 audio channels.

I couldn’t be endlessly distracted much by the game art, or music, or 3D projection modes. It was pretty easy to focus because of the constraints. There was enough to learn without modern day distractions and the bar being set so very very high especially for game programming. Thankfully, simpler games are making a resurgence via mobile platforms. Angry Birds could have been done on a C64, a NES, an Amiga, a SNES, etc. The mechanics of some of these mobile games are very clean and lovely, something that isn’t a supreme technical challenge, but has been very well executed by those companies by leveraging good developers and artists to make a polished game.

I believe its an incredible challenge for new programmers to know what to focus on in a way that sets them up for success, so I’ve been thinking hard about how to approach the issue with my daughter and other new coders. Codea is one of the best applications I’ve found so far when it comes to teaching my daughter how to program. :slight_smile: Touch and gravity inputs make it fairly trivial to map cause and effect. First thing we did was map gravity / tilt sensors to moving a sprite around. Its very simple and intuitive and offers a fine degree of control. I’m teaching her about geometry, coordinate systems, that the little sprites have “personal space” (collision boxes), functions, code commenting, etc. :slight_smile: (We’re also reading the book Lauren Ipsum right now, introductory CS material for kids, that reads like Alice in Wonderland and is pretty funny)

All this in mind, I came across a fantastic article tonight posted on Hacker News that is directly relevant to reaching goals of making modern programming easier to learn and there are several suggestions directly applicable to Codea itself:

http://worrydream.com/LearnableProgramming/

There are many concepts that could be applied from this article, but I think the low hanging fruit are the “Make meaning transparent” and “Explain in context” sections. I, an expert programmer, definitely find it cumbersome to go into help to look up the parameters for all of the functions, so having something even just tell me the name of the parameter would be helpful for jogging memory or helping me figure out how to use the method for the first time. My daughter has no mental model for navigating help / documentation systems, so she has a very challenging time finding the right help - even I do sometimes.

I think Codea is an awesome tool, I’ve been impressed by the progress so far and I think there is room for it to get even better. I hope our discussions and support can help drive that forward. :slight_smile: In the meantime, please take a look at the article on Learnable Programming and give feedback on your impressions. :slight_smile:

-Xavian

Wow thanks for that, I’ve been trying to teach my brother the little programming I know but he automatically decides lotsOfTyping = hard that website really helped.

Thanks for linking Bret Victor’s fantastic article. I’m glad to have read it.

Several of his ideas are things that I have been wanting to put into Codea for some time now. As he says in his essay, the underlying concepts are far more important than any specific feature based on them.

I’m thinking hard about where his philosophy aligns with my own, and how that can be represented in Codea.

Great Simeon, I’m glad you liked it! As you said, the underlying concepts are the most useful and his way of outlining them is immediately accessible. It occurred to me after I posted that you might have some of these things outlined in the roadmap already. I think Codea is a great platform to build upon and I’m looking forward to seeing how things develop. :slight_smile:

I recommend this video on the same topic by the same person. :slight_smile:

https://vimeo.com/36579366

Thanks @xavian for this excellent link. I have a similar background like you, started with C64 BASIC, then assembler on Amiga. In the next few years I will also face the challenge to teach my kids some coding, I hope some of the ideas of Bret Victor will then be reality :slight_smile: Sometimes I think it is harder to learn new languages today than learning assembler back in the eighties. So I can only agree with your explanation, that the possibilities were so limited, that we could focus more on the code and therefore had a quicker learning curve. I can see it now with Codea: I started 10 projects at the same time and it is hard to focus on one as there are so many ideas and possibilities.

Projecting the article on Codea I think there is one thing which would make things for beginners a lot easier: Just showing a label with a functions arguments when opening the bracket. A second thing would be a debugger, but I understand, thats much harder to develop. Of course, what Bret Victor shows in his videos as debugger is incredible, but a simple debugger would be a start :slight_smile:

@tnlogy, great video, thanks! @KilamMalik Ah yes, I had a similar journey, basic and machine code on C64 (I didn’t have an assembler) and then eventually got an Amiga, then switched to PCs for years, and finally Macs.

I’ve started so many game dev project, but eventually I tend to get paralyzed or bogged down a bit by all of the possibilities especially since I really like the media side of the work as well as the programming side. But I discovered something on a lark that makes it easier. I was playing a game called “Harvest Moon: Save the Homeland” on the Playstation 2 when I noticed the actual game mechanics were simple enough it could work on something old like a C64. I was between jobs at the time so I spent some time with a C64 emulator, had a C cross-compiler and started porting a Playstation 2 game backwards to the C64. It was great fun, but I got a new job and never had the time to complete it. The insight I had, however, is it was much easier to focus on the core game since everything else was so very limited. I got pretty far despite the limitations:

Harvest Moon - Back-Port

Codea with the built in sprite() support coupled with the PlanetCute artwork really take me much closer to such an experience. I have visually attractive artwork right out of the box so I can focus on mechanics like spinning stars or making a touch joystick. I love how trivial it was for us to make this for ‘Super Kitty Girl!’ scene.

Super Kitty Girl Game

Give us artwork that looks decent enough that we can play around with it and focus on the basics without getting distracted. My daughter loves changing the sprite around, and thats a very cause effect sorta thing. I couldn’t as easily had her engaged if I moved a circle around the screen and said “OK, now imagine that circle is Super Kitty Girl…” This is much much easier. :slight_smile:

Hogwash.

I grew up with CBM64 and BBC Basic as well. What I did was copy code from magazines, often without a clue what it did. Then I got ambitious and started changing things and finally I ported a CBM64 fractal program to fortran on our shiny new 286 (with Hercules monochrome graphics card).

The article makes some good points, but what is missing is the role of the teacher in all this. A well-designed IDE (if that’s the right term) certainly helps but more important is a guide who can engage the child in the process of learning.

And if you change Codea to be more “learning friendly” I’ll complain so loudly you’ll look back on the furore about number spinners as a mild disagreement.

@Andrew_Stacey, your opening gambit is combative and uninformative. What exactly are you refuting? The role of teacher is a critical one, but that doesn’t nullify the usefulness of offering visual affordances, especially when someone will be engaged in independent learning. Outside of Run or Compute! magazine articles, most of us didn’t have the benefit of a teacher. If you are balking at the concept that I’m advocating making Codea more “kiddy”, I am not advocating that. An interface that is more informative should benefit everyone, experts and novices alike. Just because I use Emacs for development does not cause me to suggest other coders, especially new coders, should use that approach and forgo graphical IDEs or things that have intellisense. What are your actual objections to a more learnable interface? What are the downsides? I didn’t see you list any outside the threat of your protestations.

I am all about getting more people interested in learning how to program, and I think some of the ideas in that video might be helpful. I am a little skeptical, given the way I (and pretty much every other programmer I know) learned how to program, but that doesn’t mean that it’s not possible for something like that to be helpful to teach programming concepts.

If Codea featured a “learnable interface”, I would have no objections as long as it could be switched off. If everyone is forced to use it, it would seriously get in the way of those who already understand programming and aren’t using Codea to learn how to program. Perhaps that’s some of the sentiment @Andrew_Stacey might be trying to express.

I don’t think we would ever make those interface elements mandatory because we are seasoned programmers and enjoy using Codea as much as anyone. That said, I think its important to bridge the gap between the absolute beginner and the intermediate programmer. Something I feel is very much missing right now.

Well, part of me feels like this could become a question of focus: Is Codea meant to be a tool primarily for prototyping (and even publishing games), or is it a tool primarily for teaching? Of course there’s no reason that it could not be both to some extent, but trying to be everything to everyone will likely result in something that truly pleases no one. I for one would rather you guys not spend your time implementing a “learnable interface”, because it would take away from the already limited time you guys have to maintain and add other useful features to Codea.

I feel like an environment like the one suggested in the video would best be pulled of with a tool that was solely meant for teaching.

@toadkick, I understand your skepticism and I would like more control in preferences about which things are enabled. It could work similar to how some games work like Civilization V or SimCity that has popup tips that you can disable at will. I’d be mighty annoyed if anyone forced me to use a particular IDE other than what I am comfortable with, but as long as those aspects are configurable, I do not see the harm.

@John Yeah, thats along how I was thinking about it. Even from the standpoint of a new Codea user it could be helpful. I’m not new to programming by a long shot, but its been years since I’ve touched Lua (I used to use it for WoW UI plugins?) and I am not familiar with all the non-lua Codea specific functionality. If it took me a little bit to become familiar with what can be done with Lua, I can only imagine what it is like for someone brand new to programming altogether. I have a friend who is interested in learning to program for the first time at the age of 40, he is no child but he could definitely benefit from assistance until he gets the hang of things.

@toadkick, I think Codea is most useful as a tool for rapid prototyping, which provides access to a wider demographic of experts and novices alike. I find it a bit easier to concentrate on prototyping on the iPad with Codea or Pythonista than my laptop is with instant messagers and email and facebook, et al. I find it a great tool for rapidly banging out ideas. I have very little free time at this point in my life, so I really enjoy a tool like that that can let me prototype at will.

I don’t think it has to be solely one thing or the other. Television remote controls were designed to help people with disabilities control the TV without getting up. Guess what? Able-bodied people loved them too. Now people don’t even KNOW they were intended for handicapped people. Same with XO brand kitchen utensils, initially intended for arthritic users. Bam, people without arthritis found them much easier to use.

A good tool is helpful to have whether you are a novice or an expert. A good tool does not get in the way of what you are trying to accomplish. In that way I think Codea can be an excellent prototyping tool that can be both powerful and easy to work with.

My goal with Codea has always been to allow creative coders to get their ideas on the screen with minimal hassle.

Bret Victor’s Learnable Programming essay focuses a lot on learning core programming concepts — something that I’m not interested in teaching (though I wouldn’t want to deter anyone from using Codea as a teaching tool).

However there are lots of good points in Victor’s essay. The absolute key issue for me, right now is the following:

The API can’t be opaque. I run into this myself when using Codea — sometimes i have to check the documentation to remember whether saveGlobalData accepts a key as its first or second parameter. Sometimes I forget return values. I’m experimenting with a solution for this.

.@Andrew_Stacey I have no intention of making Codea about learning how to program. But I feel that a well designed tool shouldn’t hinder learning, and should still be able to handle advanced uses. Codea could do with (and is getting) some upgrades in this regard.

By the way @xavian, that Super Kitty Girl scene you rendered looks fantastic.

@Simeon Aw, thanks! :slight_smile: I’ll post a completed version of the game as we get further along. :slight_smile: Right now we’re working on the hero gathering the treasure when they intersect and getting points. I am considering going back and writing up a tutorial on the steps involved one we get to the end of this.

(btw, how are you getting the @username to turn into links? I cannot find it in docs)

Damn, I was in the process of writing a long post about the difference between a tool that is “easy to use” and a tool that “teaches”, but @Simeon pretty much summed up everything I was going to say, and much more succinctly.

.@Xavian The point I was trying to make is that I would hate to see TLL’s focus (and limited time) shifted away from making Codea more powerful for people who can already program, and toward making Codea a tool intended to teach programming concepts to a non-programmer. I believe that doing so would achieve neither, and would be detrimental to Codea.