19 comments

[ 2.5 ms ] story [ 44.0 ms ] thread
so why do people learn this way?

i am an old fogey. i wrote my first program on a piece of paper after watching my fiend use his zx spectrum. i didn't do exercises - i knew i could make this awesome spinning prism (dude! a spinning prism!) and so i just bugged the hell out of my friend until i found out what commands did what.

isn't it obvious that you should start by building something fun? what's so wrong with people that they think they need to do exercises first?

what is wrong with culture when programming is a "task" that requires "exercises" rather than something awesome you're going to make happen?

are these people that are being made to program (when they don't want to)? do they have no imagination? are they scared? why are they spending their lives doing exercises rather than things they want to do? don't they know they will die?

"i just bugged the hell out of my friend until i found out what commands did what."

That works great when you have a friend to bug. And nowadays, you can Google for solutions, so this kind of "I'll learn it when I need it" strategy works reasonably well.

But what doesn't work is when you have no friend to bug, and you don't have enough knowledge even to know what Google keywords you should be using. That's the point at which you really want to spend time acquiring fundamental concepts without regard for how useful they'll be in the near term.

Let's say someone was trying to learn physics, and they didn't yet know algebra. Which strategy do you think would work better: making a dedicated effort to learn algebra first, or diving in to physics and only learning algebra as they needed it?

Learning something and applying what you've learned are fundamentally different tasks. When you're a kid learning to read, reading is tough. But once you've got enough practice, it becomes easy. Coding is the same way--it's difficult for everyone in the skill-acquisition stage. Frustration is normal. But once the skill is acquired things become a lot easier.
It's the same as almost anything, learning to walk, learning to talk, learning to drive a car. Eventually, information gets pushed into your subconscious, and instead of fighting with every new piece, you take some of the pieces of information as real and don't question them any more. This reduces creativity, but makes you more 'productive' (you essentially become better at pushing symbols, rather than thinking of what symbols could be). When it's in your subconscious, that's one less thing you have to juggle to get further. When you're stuck on syntax, you can't really make full sentences. When you're able to complete full sentences, you're able to write novels, or this comment.
I agree that simple coding exercises can be boring, which is why I'm making http://codehs.com

I've been teaching at Stanford for the last 3 years for the intro classes, which are the most popular, most well liked classes at the school, so I've learned how to make coding really interesting for beginners.

We start off by teaching Karel the Dog, which lets you focus on problem solving by teaching a dog some tricks using code. Then, we quickly get to graphics, animation, and games... all in the browser.

We know learning to code can be hard, so we focus on providing help from real people along the way, so you know that while you're learning online, you're not alone.

I'm looking at running an intro to CS/programming short course for biologists (graduate students) at my university. I may drop you an email at some point to pick your brains, if that's OK?
Tell us how it goes. Specifically, if the class ends with all of them saying, "Holy shit ... we can automate all of that!"
yeah for sure. just email zach@codehs.com
Is this a course you have to be enrolled at the University to take full time or is it possible to take these as a single course?
>It Gets Easier

Yes, except for Haskell. I did a fair amount of CL back in the day and I'm relatively comfortable with Clojure now...but Haskell is pain incarnate.

BSDM, pain, discipline, whips, and chains programming language of the century. That crown was stolen from Ada and covered in thorns and lambdas.

GHC: BWAHAHAHA! Infinite Types? YOU FOOL! THAT IS VERBOTEN!

On a more serious note, Haskell is fantastic until the moment you exceed its sweet spot. Once you leave that realm you have entered the world of pain, functional reactive programming, monad transformers, and true horror. The slope for "affordances" compares poorly with Lisp's knack for letting you spin a DSL or solution to a problem that reduces pain and improves expression. The laziness and space leaks are an unnecessary horror too. I'd rather something like a more powerful OCaml, given the choice.

Haskell is painful for "real" programming because people have been doing "real" programming in C-like languages for decades, whereas the state of the art for a lazily-evaluated, extremely statically-typed functional language influenced by category theory is still a bit immature.

Haskell is a great language, but I understand hesitancy on taking it into production.

Clojure and Scala are a joy to work with. Scala's problem is Java-culture hangover but the language itself is excellent (and may be what you're looking for in "a more powerful OCaml", although I'm not sure I'd describe it quite that way).

>and may be what you're looking for in "a more powerful OCaml"

Scala is neat, but the time I couldn't get sbt to run because it kept running out of memory, after having had no trouble with it for months, I decided it was time to rm -rf my scala install.

I have a lot more background with Clojure (Lisps, really) anyway. I'd enjoy something with a more informative/helpful type system but Scala and Haskell are too broken, irritating, and unproductive for me.

For people like KirinDave who've crested that mountain with Haskell, more power to them.

I have to ship product ASAP and don't have time to wrangle with parser combinators just to read some XML though.

What have you used Haskell for? My experiences learning and using Haskell professionally have been nothing but pleasant, especially for DSLs. It’s been difficult at times to wrap my head around a new concept, sure, but sometimes you just have to work through it. That’s how programming is. I will grant you, though, that GHC’s strictness analysis is sometimes a bit too conservative, so I have had problems with memory usage in the past.
Huh, I totally disagree with this! I learned to code automatically. As soon as I discovered programming, it started a chain reaction, I couldn't stop, the ability to code came to me instead of me having to do any effort to learn it. I was so interested in it, did so much stuff, loved it so much. It was like I had found exactly what I was made for.

Also, he says you need to write songs with your code. I disagree, you need to write graphics with your code! Those give the best possible immediate reward.

Nice post for me (a non-programmer). I like the description on your site of the various levels you can try as you "build something interesting" Any comparisons of writing plugins for WP vs Bootstrap? which would be better for building a site that uses crowdsourcing, bidding, etc.? Thanks
Trying to learn how to code before learning how to program is what makes it so hard. Coding is the act of writing down the program in the computer. Programming is a collection of multiple steps, of which the aim is to reach an automated solution. Coding is writing down the recipe. Programming is figuring out what to put in it. Anybody can program. But not everybody will. It is true for programming, true for cooking. True for music and dancing. The focus on making everyone these days a coder is just wrong. What we must focus in is to make automating computing tasks simple. Its the year 2012, and we are still programming as if it was the 1950's. Though we are not using punch cards anymore, the truth is that there is too much "coding", and too little automation. This does bring a nice point to ponder. Will the programmer out program itself from existence? No. But just like my 67 year old mother fixed a clogged drain this evening by herself, programming will be made easier and easier until people like her can just pick up a computing device and automate a computing task.
Writing code, learning languages, figuring out new approaches, and struggling with foreign concepts until you finally get it... that stuff's awesome. I never noticed if it was hard or easy because I enjoyed doing it.

The part I dislike about software is reading bad code, dealing with inadequate documentation, and learning junk complexity that has no general-purpose value. Learning "to code" itself was a lot of fun.