How can I practice coding? (PS How can I tell if I suck at it?)
February 22, 2013 9:15 PM   Subscribe

I'm pretty much a Kindergarten level Python learner. Basically, I'm on Exercise 41 in Learn Python the Hard Way (and confused), and I'm in a 100-level class learning Python. I am not a math person, although I do like formal logic (if that means anything). My biggest problem is that I think I try to solve problems too creatively, i.e. I always try the most complicated/convoluted solution possible, which is usually wrong.

But anyway, what are some fun/easy ways to practice coding that will actually keep my attention (and preferably has solutions)? For instance, I've tried Codecademy but it was really dull and I hated the in-browser console, because it only allowed for one right answer (for me that's a big deal! My answer is almost never the "teacher's answer"). I liked the way Code School does it (videos and then challenges and badges...and it breaks it up into small chunx which I really liked), but I ain't got no $25, and I don't think they have Python anyways.

I've tried/didn't like:
Project Euler: This is way too math-oriented and advanced
Singpath: Reminded me too much of Codecademy
LearnStreet: Same...a disorganized site doesn't go well with my disorganized mind too, you know?
Khan Academy: I don't get it?
Checkio.org: Really interesting concept, but it looks too advanced for me
Python Challenge: Seemed more about figuring out the author's intentions and less about coding
Those pseudo-programming sites where you move that stupid turtle

I liked:
Learn Python the Hard Way: I liked how it breaks it up into small pieces and just tells you what to put into your own IDE...it did just tell you what to do, but it also told me why/how it works (which is rare, apparently?)...also, like Code School, breaks it up into very small chunx, one concept at a time
Python.org tutorials...seems like a lot to read though! clean layout though, good job python!

I'm thinking of trying:
Pygame
Django/google's app engine*
Any sites/programs that actually teach Python as a game? Keywords actually teach. Codecademy/LearnStreet were just confusing and just TOLD me stuff, aka not teaching. I don't know. Maybe they work for other people, just not for me.

*Apparently it doesn't have python 3 support, but that's OK I guess. I don't really know how to use it, but it could be interesting. I'm not that interested in web development, but it might be good practice?

I'm getting really irritated with not knowing what/why I am learning or how it's used IRL. I think I would really like to just jump in and start making stuff, because I think I would learn best that way and I really just want to start doing real-world coding, but sadly I don't think I really know enough to be able to do much of that...

TLDR:
I'm about to finish LPTHW and don't know how to continue in a fun and enjoyable manner. I'd prefer something I can just work all the way through (like LPTHW). Thoughts?

Thanks.

***1,000 extra points for pointing me towards anything that has to do with music/audio programs***

Extra questions:

I am just starting out and I am vaguely interested in audio programming and just things that aren't web development/user databases in general (aka what I learned in my brief stint with Rails for Zombies...I shudder to think of the Twitter for Zombies databases...). What should I think about doing down the road? I noticed on github that a lot of the audio programs I like are written with C#. Should I learn that next or something? I don't really know what Python is "used for." I love this stuff!

Do I suck at programming because I am confused? I just came from a CS lab where we had to encrypt a string of letters into new letters. I was lost for an hour until the TA gave me his own answers. I would have never guessed the answer on my own. We didn't exactly learn it in class. Does that mean I'm terrible? It seemed like everyone else needed less help than me...
posted by lhude sing cuccu to Computers & Internet (17 answers total) 96 users marked this as a favorite
 
What are you trying to do? Seriously, write it down or something, make a plan.

Maybe try processing.org or cinder. Lots of cool stuff out there for vizart. But you won't get good until you get consistent, so find something to get good at and get good at it.

It's easy to feel left behind in tech because everyone is being left behind in tech, and it's a total shitstorm. But getting really good at a few things is way more impressive than being clever or sucking at a million languages or following all of the tutorials. Programming is work.

Check out Google summer of code, too.
posted by oceanjesse at 9:45 PM on February 22, 2013 [1 favorite]


Best answer: You need a project!

How about making a GUI calculator? It's the perfect sized project for learning how to make something, the requirements are obvious, and there's still room for experimentation.

I expect you're retching at that suggestion, but hear me out. You are probably not learning as readily as you hope because your assignments and challenges are not integrative enough for you. It's like you want to build houses, so you're learning the perfect hammering technique, but you haven't ever tried to build even a birdhouse.

So make something. But make something really simple and well-defined to start. If you have grand ideas while you're building the simple thing, write them down, but finish the simple thing. Do it your way, and get away from tutorials as much as possible. You'll gain an appreciation for how everything fits together. And once it's working, you can use it as a framework for learning more. (For example, you can add some audio tricks, like adding sounds to button presses or generating tones based on the currently displayed answer or.... But I'm getting way ahead of myself. :-)

I guarantee you know enough Python to do this. Read the docs for wxpython, ask questions on stackoverflow, and have fun with it!
posted by rouftop at 9:58 PM on February 22, 2013 [4 favorites]


Also, your profile indicates that maybe you should reach out to the #pyladies community. The resources section is really great on their website, and the people I've met in that org seemed really nice.
posted by oceanjesse at 9:59 PM on February 22, 2013


I think C++ is what most real hardcore audio signal processing code is written in. I wouldn't rush off to learn C# unless your main goal is to learn Windows programming.

You sound like you are pretty motivated to learn and I hope you don't get discouraged from things like your lab. You should really work to figure out what you weren't seeing - ask the TA to meet with you. CS is hard and it's OK to not get everything right away, not everyone is a genius. The path to success is patient hard work and humility to learn from your mistakes.
posted by thelonius at 10:00 PM on February 22, 2013


You might like How to Think Like a Computer Scientist, which is available for free in HTML or as a PDF. It's a Python book, but more important, it gets into some of the basic concepts and vocabulary that a lot of tutorials and introductory courses skip over.
posted by guybrush_threepwood at 10:01 PM on February 22, 2013 [3 favorites]


Best answer: Let me start with some emotional stuff.
It's surprisingly common to find people who ascribe a status to their ability at programming ("Do I suck at programming. . .") and think it an ontological status of being, instead of something which gets better with practice. Carol Dweck has a few psychology books out on this, and there's a lot of articles on this also. You may also want to consider if you have stereotype threat, which is where you think you can't do something because ___ people just can't do something. The way to cure that is to sit down and read this, and think about it.

I recall that Peter Norvig once said that the things Google lacks most in programmers is the stuff that they should've learned in kindergarten, which is how to play nice. Then, he went into how playing nice involves source control, unit testing, and continuous integration. In that order of importance.

I don't know how kindergarteners are supposed to learn how to work in a software engineering firm, but there are books about it. Only pertinent if you want to do this with other people, which you presumably want to do.

Here's something. (the full video will come online 1 April 2013; till then, you can look at the trailer)
Here's something else. If you can't access it, I can pirate it.

Onto the actual recommendations.

Now, if you're willing to spend an epic amount of time thinking about this stuff, here's a thorough treatment of what people should know from a computer science education, from a CS prof. It's a listing of many textbooks. You may feel that this will take far, far too much time for you. This may be true. You must consider whether it actually will take too much time, or whether the problem is that you feel as if it will take too much time. Because that feeling can be cured: people come into, say, mathematics as undergrads all the time with no real ability to read a proof and come out of it able to read. It is incorrect to see a 1200 page textbook and think that you will read it at the same pace as a 1200 page novel. This is because you will find yourself needing 30 minutes to an hour to understand a page of material, many times. So expect to need an hour, and be pleasantly surprised if you only take 50 minutes. But don't panic. You will gain patience as you need it more and more.

There is some old stuff which you may find useful, in figuring out where the pernicious idea that programming is some facet of being came from, and why you shouldn't believe it. I recommend this, and the esr goodness, and the Norvig goodness. Cultural stuff. This cultural stuff is important to learn how to go from point A to point B. Of course, you will be told to have projects. But you must gather gumption and an attitude towards having projects which you get from a programming culture. If you don't get told all the time to do more side projects, then move yourself to another culture where you do.

Here's more books than I honestly think could feasibly be read.

One of the things I like about Software Carpentry is that it's for people who don't think that they are dumb but want to learn programming. This is important, because Codecademy does not think that the people who they are teaching are smart. Other interesting python resources include How to Think Like a Computer Scientist, which I see guybrush has linked.

Stanford intro courses are nice, and one of the most gender-balanced anywhere, I think. The intro course reader, and the slightly more advanced course reader. And the stone cold awesome c++-specific course reader. I put these in because Stanford starts with the lamer and significantly more used Java and C++ languages, instead of Lisp. For Lisp, there is SICP, which is the granddaddy of all CS books.

Google Code University is cool.

Eloquent Javascript is cool. Javascript: The Good Parts is cooler and harder.

Now, the only graphical programming language which I have ever found worth a damn is Max/MSP. The Wiki page on computer music has a fairly thoughtful take on things.

One thing that it doesn't explicitly say is that numerical methods and mathematics are pretty essential to all forms of computer music. The difference between mathematics and music is merely phenomenology, it is merely in the way we experience it. If you have a fear of math, it may just be an ontological orientation towards math.

One specific point is in recursion. There's a paper out there somewhere where professors found out the three sticking points in a CS education, the places where people drop out because they don't get it:
1. What, precisely, variable assignment actually is. AKA, the difference between pass-by-value and pass-by-reference.
2. Recursion.
3. Concurrency.

A large proportion of the lame programming exercises big companies give you are to see if you understand recursion or not. Because that's stone-cold important. I liked Godel, Escher, Bach for understanding recursion, but in case if you don't want to read an 800-page book about it, SICP and How to Think Like a Computer Scientist both go over it.

I keep a reading list on programming which is way too long and has a lot of academic crap and promiscuously mixes in random nontechnical books but may be of interest anyways.
posted by curuinor at 10:19 PM on February 22, 2013 [45 favorites]


Best answer: Here's an interesting book, although it may be the kind of book where you need an hour to get through a page. It's got ideas, but no code.

PyAudio exists. It's not the best.
Numpy exists. It's great for matrix computing. "What the hell does that have to do with anything?" you ask. Here's a thingy. Here's another thingy.

This got a bit long. If you need a tl;dr, here's one:
1. Morale matters. Don't think of yourself as inherently bad at programming, because nobody's inherently bad at anything.
2. What you're missing is just the next step in CS, which is data structures and algorithms. To learn that, read SICP or How to Think like a Computer Scientist (if you want to know difficulties, SICP is like twice as hard and four times as educational)
3. For audio purposes, anything non-trivial is going to require a lotta math. Don't panic.
posted by curuinor at 10:30 PM on February 22, 2013


I'm getting really irritated with not knowing what/why I am learning or how it's used IRL. I think I would really like to just jump in and start making stuff, because I think I would learn best that way and I really just want to start doing real-world coding, but sadly I don't think I really know enough to be able to do much of that...

Try scripting in blender, inkscape, or minecraft? Do up some generative art.

On top of the formal CS stuff that you need to look into, which people are going into above.

I am vaguely interested in audio programming

Figure out how to plot waveforms, and then tweak the same. Maybe get into some brian eno generative music?
posted by sebastienbailard at 10:50 PM on February 22, 2013


Since you're interested in audio, I would recommend simply installing a couple dozen packages from the Python in Music page and doing the equivalent of 'Hello World' with them just to see what kinds of things there are out there. When you find one that makes you want to do something cool with it, keep tinkering.

That's not the way to learn how to write elegant code, but it is very much the kind of exercise that makes people love programming.
posted by Monsieur Caution at 10:52 PM on February 22, 2013 [1 favorite]


I don't know about music programming, but you can try implementing the following 4 simple programs:

- a simulation of an elevator. each floor has a button, elevator has buttons that go to each floor, needs to keep a queue of floors it has to visit.

- a simulation of a street crossing with lights. cars go through, light changes, pedestrians cross, etc

- a simulation of a vending machine. a few products, accept coins, 1 and 5 dollar bills

- a simulation of an ATM


Once you finish a program, come back to it on the next day and try to figure out how to make it simpler, more modular, clearer. That's the way you really learn - not by doing but by refining and iterating.
posted by rainy at 11:21 PM on February 22, 2013


Supercollider is currently the most powerful language for computer music.
posted by victory_laser at 3:37 AM on February 23, 2013


Programming for the sake of learning programming is boring. It's like sawing random chunks of wood. A useful skill to learn, but you're not making anything, and ultimately, you're putting in the effort and not getting anything back from it.

Make something you need, or you think you need. If you don't need anything, find an open source project with a community and try and get involved. Start here for a list of python music projects you could get involved with.

That being said, I enjoyed the one Code Kata I've done. There's something a bit more fulfilling with trying to solve a problem in different or increasingly elegant ways. This may gel more with your "different" approach to problem solving.
posted by zoo at 3:39 AM on February 23, 2013


Best answer: How can you tell if you suck at it? You can't, and even if you think you know, you're probably wrong.

That being said - You don't suck. There's something out there for you. I've worked with some of the shittiest coders on the planet, and even they are capable of making something, or polishing something, or documenting something. There's nobody out there that can't provide value to a project.

The only people I've seen that actively harm projects are the ones who are super-smart *and* have an overblown idea of their own abilities. The sort of people who make code so complicated that they can't understand how it works, and nobody else can understand how it works or why it's broken.

Get involved first. Worry about your abilities after.
posted by zoo at 3:49 AM on February 23, 2013 [1 favorite]


I've tried Codecademy but it was really dull and I hated the in-browser console, because it only allowed for one right answer

I'm may be wrong but I'm pretty sure that's not the case - I think it only tests your output for correctness no matter how you arrived at it.
posted by turkeyphant at 4:08 AM on February 23, 2013


Best answer: Going for those bonus points (as quite a few in this thread have)... I've been meaning to spend some time with Music for Geeks and Nerds. It's a book teaching music with Python. I suspect the Python isn't so advanced that it is inaccessible. And if it is, it likely won't be for long. There's a PDF sample on the linked page, and 5 star reviews on it's Amazon listing.

...Ah, unfortunately I just reread your post about not wanting to spend $25, which this book is priced around. Still, it's one to add to your radar when you do have some dosh spare.

Good luck, and have fun!
posted by Shelduck at 7:42 PM on February 23, 2013 [3 favorites]


Everyone sucks at programming at first; the primary differences are in how they judge themselves while doing so, and how much focused time they put into it.

When you said "I never get the teacher's answer", this is a pretty well-established thing in programming; There's More Than One Way To Do It is pretty much the official motto of the Perl programming language. That said, I'd take a careful look at the instructor's answers, and start asking yourself *why* they did it that way; if you don't know, ask the instructor or assistant if your way was equally good, or if there's some hidden gotcha in your way, which is why the instructor did it their way. Getting different answers is often okay, and sometimes disastrous, and basing your learning on occasional disaster can bite ya in the end.
posted by talldean at 5:33 AM on February 24, 2013 [1 favorite]


I'm may be wrong but I'm pretty sure that's not the case - I think it only tests your output for correctness no matter how you arrived at it.

Actually, Codeacademy is very inconsistent about this. Some of the lessons are very good about testing things well, but for some lessons, it really does seem that you have to type in exactly what the author was dreaming of, and it is not always sensical. (The lessons are written by a variety of authors, but I didn't get into it enough to investigate which ones were doing a really nice job.)
posted by ktkt at 11:44 PM on February 24, 2013


« Older Can the (federal) government take everything...   |   Should I just not talk about online dating with... Newer »
This thread is closed to new comments.