Programming class

Userpic
Matt Arnold
September 20, 2007

I hope to audit a Python class, or at least some type of introductory programming class, in the evenings and weekends. Do you know any you can recommend?

How about flashcards? Do those help for learning the vocabulary and rules of a computer language?

For years, I have gone back and forth on the issue of learning a programming language. At first, I didn't know why I wanted to, since I felt I should not invest massive time, money and energy in learning a skill unless it's the sort of thing I would do anyway as a hobby. Given a free afternoon, it would never occur to me to spend it coding. It would simply never cross my mind. That's why self-teaching doesn't work and I need a class.

The best argument for learning programming has been that every project I'm interested in involves creating or altering code. The sheer quantity of time I have spent in recent years begging programmers has become more than sufficient motivation to take power into my own hands. I won't be the best, but I don't need to be. When others are taking a break, I just need to keep a project moving under my own power, no matter how slowly.

Comments


elizilla on Sep. 20, 2007 3:11 PM

Matt, flash cards are not useful IMHO. What you need from a programming language, is the habit of mind that allows you to break a task down into individual steps, and figure out what order to do them in. The real heart of programming is theoretical. The commands and syntax are just a means to an end. Once you have a grasp of the theory, you can learn any language pretty quickly, at least well enough to look up the commands you need and get along in it.


matt-arnold on Sep. 20, 2007 3:25 PM

Thanks, I see. The theoretical heart presents no problem though. I think I already have the habit of mind that turns things into flowcharts. But when it comes to any specific programming language, I just keep forgetting the commands and syntax. So I look at the text, and it's a block of gibberish, so I hit a wall because I feel like I have to look up all the tabs, words, and punctuation all over again. I guess my experience has been the inverse of yours.

I've been considering giving myself some practice by transforming this decision tree that I wrote into Python using this page.


wormquartet on Sep. 20, 2007 5:57 PM

What he said.

-=ShoEboX=-


matt-arnold on Sep. 20, 2007 6:54 PM

In any given learning session, it's just too daunting to relearn all the terminology I've forgotten since the last one. Ever had that experience?

When I attempt to read a piece of code, or want to figure out what punctuation error is causing my code to not run, it makes sense to look something up on the web. But that doesn't help if, during the interval since the last time I studied, I have forgotten the meaning of the words used in the help file.

I have a concept clearly in my mind, which is the thing between the parenthesis. I remember more or less what it is for. I just can't remember if the word for it is "parameter" or "argument". So I'm not sure what the help file is referring to by those words.

My solution is to create flashcard sets in Quizlet.com for Python programming using the glossaries of the chapters in "How To Think Like A Python Programmer". I've also made a set of most of the keywords and punctuation. Once the difference between the word "parameter" and the word "argument", the word "method" and the word "function", are in my long-term memory, I won't have to reinvent those wheels every time, and the chunks of effort will become small enough.


elizilla on Sep. 20, 2007 7:36 PM

This is what comments are for. Write lots and lots of them, telling yourself exactly what this piece of code does. Then when you go back to it, you'll have a good, detailed description. Plus the very act of writing the comments helps you cement it in your mind. You can't have too many comments.


Anonymous on Sep. 20, 2007 8:55 PM

I just took a quick look at that link. A couple comments...

Been programming for three decades. Pretty good at it. Had you asked me five minutes ago what the difference between a parameter and an argument is, I woulda waffled. Why? Those terms are used interchangeably. Whether that's right or wrong doesn't matter. It's how it is. You'll need to know what people mean even if they use the terminology incorrectly.

Since you've associated those two words you probably already know how argum^H^H^H^H^Hthings are passed to functions/methods/subroutines. Move on.

Don't get too hung up on how things are described in any particular document; particularly something you found "on the web". Conventions are different between languages, and even between documents describing the same language. And "found on the web" documents almost universally suck.

The one you linked to? Very dense. That it mentions how important the distinction between argument and parameter is in the fucking preface should not be seen as an indicator for how quickly you're supposed to learn. Note that, according to the note in the preface, someone had to remind *the author* to use the terms correctly.

If you take a class on introductory programming (as opposed to a specific-language class; don't know which you're considering) I can assure you file I/O will not be in your first assignment. Your cat herding program? Not the stuff of first programming efforts.

Go to Amazon and read the reviews for Python books. Pick one that is well-regarded and, according to the reviews, written in a way that suits your learning style. Having a professionally prepared document may aid your learning. And I find that seeing things in a single-document format and at a physical location within a physical book aids in memory.

It's not cheating to look things up in a book every single time you need them. Those things you do often you'll eventually remember. Only pedants care that you've memorized the rest.


users on Sep. 20, 2007 7:24 PM

I would like to point out one thing you might run into a roadblock on:

I won't be the best, but I don't need to be. When others are taking a break, I just need to keep a project moving under my own power, no matter how slowly.

Realize that most of the time, if you take on a project to keep it moving.. you now own the project. Most programmers that I know would be loathe to allow a beginner programmer to poke at their code for a while, then take it back over.

More importantly, it takes more skill than most beginners have to be part of a multi-person coding project. You have to not only be able to code, but to code in varying styles, following varying conventions... and that's all pretty tough for a newcomer.

A more realistic goal would be to learn to program so that you could write your own stuff if you wanted something done... top to bottom... or to maintain that which has already been written.

Further, knowing how to code will certainly help when trying to describe to another programmer what it is you need done.


matt-arnold on Sep. 20, 2007 8:47 PM

True. Baby steps into the elevator, Doctor Marvin.


users on Sep. 20, 2007 8:50 PM

:)


zifferent on Sep. 20, 2007 7:28 PM

If you can get the hang of variables, loops and conditional statements everything else is specific to the language.


matt-arnold on Sep. 20, 2007 7:37 PM

For me, it's the specifics that are the hard part.

One of my best friends in college was a comp sci major. We used to work on game ideas together. I described my ideas to him in terms of conditionals, variables, and loops, he said I was a natural. He never did program any of my games, though.


dragonsmith0 on Sep. 20, 2007 7:31 PM

You are the PERFECT guy to do programming! Consider it a way to play God in an environment...you control the horizontal, you control the vertical. Nothing quite like being able to change stuff to your specs. Muhahaahaha!! You can have fun with it for sure and do use the flash cards. Just like any other language you learn, start with words and then build sentences.

One day I may get back into it myself. Used to enjoy it quite a bit.

Ta for now


dragonsmith0 on Sep. 20, 2007 8:08 PM

I have another idea for you. There is a pseudo-code flow system out there that is used regularly for non-coders. It is great if you don't want or can't learn multiple languages because it is a function based system. Kind of like blocking for plays or movies. You can learn the one standard system that is easy to understand and it can be translated into any other programs by the guys in the know. I used it several times while trying to build applications for business groups that had no idea what was involved in getting the job done. Of course I can't remember the name of it at this time...overwrote that memory address hahaha. Good stuff though. I will update when I find it again.

DS


eilrahc on Sep. 24, 2007 2:34 AM

I think you should give PHP a try. It will literally take a weekend to learn the basics and there's plenty of online documentation and examples. Although the language does have a lot of peculiarities, I suggest this mainly because I know you get pretty jazzed up about web applications and PHP drives at least 90% of them.

Python is a good solid language, but I think it's more appropriate for people who have been programming for awhile and/or are computer scientists. Casual programmers like you and myself seem to have a harder time with it. In contrast, I learned PHP not by reading books or taking classes but by just jumping in and debugging code.


Anonymous on Sep. 25, 2007 2:51 AM — Learn by doing

Flashcards aren't likely to help. Or rather, you'll make a little progress, but nowhere near as much as you would actually writing code.

It doesn't take long to get the syntax down when you are actually writing code. From the things you are saying, it sounds like you are just leaving it too long between sessions. Don't expect to go a couple of weeks and then pick it up again in five minutes. It can take time to get into the right frame of mind for coding, even for experienced developers, so don't give up just because it doesn't immediately come back to you.

Don't try to do too much too soon. The decision tree looks too complicated for a beginner. Write simple things, like asking for two numbers and adding them together, then counting the number of words in a text file, etc. Not only will you get to practice your syntax, but when you come back, you can look at the code you have already written to remind you of how things should look.

Once you've written a few little programs like this, you shouldn't really have any problem with syntax. Python syntax is quite regular. You'll still have to refer to the documentation all the time to check which modules/classes/functions to use, but that's no problem. You'll learn the ones that are most useful to you quickly and the rest you don't need to memorise anyway.

At this point, you're going to want to try to write your game again. It's still not time. What will happen is that you will make a little progress at a time, write a load of spaghetti code, and end up stuck, with a lot of confused code that you don't know how to untangle and no way of moving forward. You need to *grow into* writing larger programs.

Slowly expand your skillset, while writing slightly more complicated programs each time. Your skillset, like how to access databases, how to read and write files, how to talk over the network, etc, is like your vocabulary. It's comprised of knowledge of modules, and you don't usually have to learn new syntax or concepts to use them.

But architecture is a different matter. Learning how to write larger programs is something that you can't easily describe/teach/memorise, it's something you get with practice. As you get more experienced, you'll look back on your previous programs and realise that it's a confused mess that weaves all over the place, and now you can rewrite it to be smaller and much more organised.

Once you start figuring out architecture, you are more able to spot the warning signs that you are creating a mess, and look for a better approach. It's at this point that you are capable of writing a game and actually completing the project.

It sounds daunting, but it really isn't. It's a series of small steps, one after the other. Try to run too fast and you'll fall over, but take your time and be sure of your footing, and you'll go places.

Unlike eilrahc, I recommend Python over PHP. PHP isn't significantly easier, it's more complex and irregular in many ways, it gets you into bad habits, and it's a much worse language for complicated stuff. While Python is used by many professional programmers, it's also been taught to kids in educational settings.

And, for what it's worth, I've been a professional web developer for about nine years, wrote my first program almost twenty years ago, and have a lot of programming languages under my belt.


Anonymous on Sep. 25, 2007 2:57 AM — Re: Learn by doing

One last thing I forgot to mention: most people assume that computers are smarter than they actually are. You are likely to approach a large decision tree, get halfway down it and realise that there's no function you can call to make a decision because the computer is dumb and can't figure big stuff like that out. Go the other way. Write small bits that you know you can handle, and then join them up into a larger program that solves a bit more of the decision tree. This is "bottom up" programming. "Top down" programming has its advantages too, but programming beginners are much better off with bottom up.


squeekyhoho on Oct. 1, 2007 3:18 PM

As part of my serial enthusiasm streak, I've decided that I want to write a book / website for teaching people how to program. As luck would have it, I've gravitated to Python for the language I'd like to teach. I have a drupal site set up, but it's under the cloak of "site maintenance" for now. If you'd like a peek at what's there, or would like to help out, I'd love to hear from you. It initially started out as a kid's book idea, much in teh same vein as Dr. C. Wacko, but morphed into something a little different.

The site is http://bit-twiddlers.com. Let me know if you're interested, and I'll double the efforts to get it up and running.

Good to see you again at OLF! Looking forward to Penguicon++!


matt-arnold on Oct. 1, 2007 3:33 PM

Yeah, I would get in on this. Please!


squeekyhoho on Nov. 8, 2007 6:22 PM

Well, the site http://bit-twiddlers.com is up, but not much content has emerged yet. I've got a few examples that I'm going to be putting in as part of the book, but for now it's there, and waiting. :)

Leave a Comment

Enter your full name, maximum 100 characters
Email will not be published
Enter a valid email address for comment notifications
Enter your comment, minimum 5 characters, maximum 5000 characters
Minimum 5 characters 0 / 5000