DISQUS

The Last Starfighter: The Last Starfighter

  • Adam Blinkinsop · 1 year ago
    Eric, if you could expand on this a bit, that'd be good. Do you mean an actual series of languages, or perhaps subsets of an existing language, or series of programming problems?

    As to the series of languages, what about SICP?
  • Eric · 1 year ago
    Way for me to not proofread my comments. I meant a series of programming _lessons_. Not languages. The languages I'll be using is Python. I just opened up SICP, it looks like that might be a lot of what I need.

    Basically, I don't want to dive straight into deeper things like data structures and Big-O notation. I want a quick and dirty way to get your hands dirty. I'm remembering how I learned to program (and I think you followed a similar path). I started by typing random stuff into QBasic until it finally capitalized one of the words, meaning I'd guessed a key word. From then on, I read a bunch of the help files and started writing my own text-based Final Fantasy clones. Eventually I also started hacking Nibbles and Gorillas and stuff like that, and finally this evolved into Space Wars. and on into binary trees, object oriented programming, 3d graphics, etc.

    Anyway, I've decided I completely reject the idea that you need to dive first into Java and Object Oriented programming. Not even seasoned software engineers care about UML diagrams, let alone someone who's never written a line of code in their life. I think a good place to start is something where you start typing instructions into computers and in 20 seconds you can say "Look at what I made the computer do!" In other words, if "Hello, World!" takes more than one line of code, the language isn't a good teaching language. I think this rules out most things, except for QBasic, Python, Ruby, and Perl. I like Python, since it's a clean language with low initial overhead, but it also scales up to object oriented and functional programming too. Ruby probably does about the same, but I haven't gotten around to becoming fluent in Ruby yet.

    I think a good test for an initial programming exercise is the wife/four year old test. After our first lesson, will my friend be able to take something home to his wife or four year old (who has played WoW since he was three...) and have them be excited about what he's learned how to do.

    I'm thinking Turtle graphics is a good starting point. I really want to pull in recursion and fractals, but I think that should wait a while.
  • Adam Blinkinsop · 1 year ago
    I think that time-to-cool (how long does it take to get something interesting running?) is definitely the most important metric for learning a language. Figure out what he's interested in, and figure out the "hello world" of that class of applications. It's a shame that writing games has so much more overhead now than it did when we were in school, or that'd continue to be the best way to do things.

    Perhaps it's not so bad, but Pygame and Pyglet take way too much work, imho.
  • Eric · 1 year ago
    Yeah, I've looked at doing some Python games before, but Pygame and Pyglet have more overhead than I want. One of these days, I'd like to make a simple tile-based sprite engine, so I can just say give me a 20x10 grid of 32x32 pixel tiles and let me create little creatures that walk around in them. That'd be really useful if you wanted to throw together a quick computerized Robo Rally or something like that.

    I was thinking about this a while ago, how now there is Visual Studio Express and all kinds of awesome development tools available for free, which seems like if I were growing up again I'd be able to program a lot bigger things on my own. The thing is, the overhead to start hacking is a lot higher now. In a way, it sort of feels like I grew up with the development tools.

    Anyway, Python has a built in turtle graphics module, so I think I'll probably start with that. Maybe start with Hello World, then do some cool turtle designs. I'll probably introduce os.system fairly early too. He says he wants to learn programming, but the applications he has in mind are things like scripting system admin tasks and building dynamic web pages.

    What do you think would be a good set of topics, in what order, and some good exercises to practice each topic?
  • Adam Blinkinsop · 1 year ago
    I think that if he's interested in admin tasks and dynamic web pages, you might have him start with something like Django, TurboGears, or Pylons -- get something up and running right away. This will, of course, need him to have a goal in mind for the pages he wants to write. Make sure that his goal isn't too complicated. Something simple (that ideally has him pulling information off the server box -- perhaps a remote process list?) that requires very little would be best.

    That's my thought: find a simple web app, work with him to implement it with a framework. (Perhaps even App Engine -- sign-ups are free now.) The important part here is to teach good project management principles; unit testing, source control, automation, etc. Build things from the bottom-up, learning as you go.

    Does that sound like it would be good?
  • Eric · 1 year ago
    I think for where he's at now, that would be information overload. However, I think you're right, I need to keep his end goal in mind. I've kind of been pursuing two milestones so far. The first is teaching him enough that he can understand and write a fractal like Koch's Snowflake or the Hilbert Dragon (I think those are the names anyway. The second is going down the text processing route, suitable for building dynamic web pages. I think the first is better for someone pursuing computer science, since it gives you a good grasp on recursion, but the second seems like it will be more useful to my friend in the long run, and probably more interesting. I think project management principles are important, but teaching them at this point would be like teaching someone how to draw up floor plans and get a building permit when they don't even know how to use a saw.

    We had our first meeting tonight, and it seems like it went pretty well. He was sort of getting sucked into what he was working on, and he sounded genuinely excited, which I think is important. I covered os.system, so he can now write all the .BAT files he's ever written in Python instead. Then we got into turtle graphics. He started trying to write a program that would draw his son's name. I think it will take him a while (he got the first two out of five letter done tonight). His son's name is Corbin, so he drew a C, and then started working on the o. The o was basically a rectangle, so I showed him how to make a for loop, which made the rectangle take three lines of code instead of 8. Finally, we briefly covered variables, the input function, and how to concatenate strings. We spent only a couple minutes on it. I meant for it more as a "If you get bored of forward, left, right, backwards, pen up, pen down, you can start playing with this." I also showed him a Koch snowflake script I wrote and a script that prompts for a number, n, and then draws a regular n-gon. Anyway, we briefly covered enough that he could write a regular n-gon program if he wanted, though it will probably still take a lot of work for him the figure it out.

    He looked pretty excited about everything. Even though turtle graphics are pretty basic, it gives you probably the most bang for the buck as far as quickly giving someone a set of blocks to play with and experiment with. He seems pretty excited about figuring out what pictures he can draw, and it's good practice for decomposing big problems (How do I draw a C?) into manageable parts (Go up, up, right, down, up, left, down, down, down, down, right, up). I'm excited to see what he comes up with before next time.

    I'm kind of thinking a good next step will be mad libs. Start out by writing a program to prompt the user for each word ("Verb? Verb? Noun? Adjective? Plural noun?"), and then substitute those into the write part of the mad lib. Eventually you could build up to making a simple markup language ("The $(adjective) $(animal) jumped over the $(adjective) $(animal)."), writing a program to parse the strings out, prompt the user for the correct blanks, and then performing the appropriate substitutions. Eventually, you could make this a dynamic web page that builds a form that asks for all the information, then renders a mad lib for you.

    Anyway, we're definitely starting from pretty much 0 at this point. He has written a couple of .BAT files, but they usually just do something like mapping a network drive. His HTML experience consists of "Save as HTML" in Microsoft Word. From my experience working on my church's web site, and mentoring a newbie developer there who even had some Java, C#, HTML, and CSS experience, a full blown web framework and source control can be a lot to take in at once. I definitely like the idea of building from the bottom up, but we need to start with smaller blocks in this case.
  • Adam Blinkinsop · 1 year ago
    Awesome. Sounds like he'll be joining the ranks of the Pythonistas relatively soon.