Advice for a beginning programmer
May 19, 2008 8:08 AM   Subscribe

Programming as a hobby. Rewarding for the non-professional programmer?

I'm interested in learning to program. This would primarily be a new hobby for me as I have no interest in switching careers (medicine currently). I would consider myself a advanced Windows user and an intermediate Linux (Ubuntu) user (I'm comfortable issuing commands in shell, no bash scripting, etc.). My last experience with any type of programming was BASIC in high school (~20 years ago). I've settled on Python and am currently reading/following along in Learning Python (loaned to me by one of our IT guys). I'm a quick study and I've been a successful autodidact in other areas. Realistically, I have about 8-10 hours a week (nights and weekends) to devote to coding and another couple a week for reading.

Obviously I'm pretty far from being able to develop any GUI applications, but I do have a few smaller projects in mind. I'd like to use the smaller projects to work on specific things (SQL, images, etc) for a larger project that would be a long-term goal/project. These smaller projects would be things that could help me in my professional life too.

- Do you think that this could be a satisfying/successful hobby for someone who has never coded professionally, nor is ever planning on it? Or am I setting myself up for a high level of frustration.
- Any anecdotes or advice or 'best practice' tips for someone setting out to avoid building bad coding habits?
- Good linux IDE's for Python?

Disclaimer: I don't anticipate being as good a programmer as the professionals, just enough of one to get a few helpful things done
posted by i_am_a_Jedi to Computers & Internet (18 answers total) 26 users marked this as a favorite
 
I think learning how to program can be an immensely rewarding thing, for a non-professional. One huge thing you gain is that in whatever other interest you have, you'll now have an extra tool to approach it with, instead of having to make do with whatever off-the-shelf thing you can find.

I'm a "professional" developer but outside of work, knowing how to program has added a lot of interesting facets to my hobbies and life.

If you'd like to avoid frustration I would advise spending a good bit of time on the logical aspects of programming and ignoring for a moment the added on stuff (GUIs, OS interaction, fancy libraries, etc). Find some practical problems and make your own solutions to them. The one expection I might make is if python has a "canvas" widget that you can draw lines, points, circles, etc on - there are tons of interesting basic graphics things that are very fun to do - my start in programming had a lot to do with programming some basic graphics stuff.
posted by RustyBrooks at 8:30 AM on May 19, 2008


Do you think that this could be a satisfying/successful hobby for someone who has never coded professionally, nor is ever planning on it?

Yes.

Any anecdotes or advice or 'best practice' tips for someone setting out to avoid building bad coding habits?

Follow the coding style in PEP 8. This will help you more immediately understand the way most experienced Python programmers code, and vice versa.

Good linux IDE's for Python?

No build process means you don't need an IDE. A good editor does help though. I highly recommend Emacs 22. If you are more familiar with vim or Eclipse, they should work too.
posted by grouse at 8:30 AM on May 19, 2008 [1 favorite]


Sure, I think it's very rewarding, especially if you are working on a project that you think will be useful to you. Nothing like being able to exert control over something and see the fruits of your efforts. I think you will soon learn that "it ain't as hard as it looks.", for the level of programming that you want to do.

Best practices - take your time. Don't be afraid to refactor (meaning, redesign chunks of your code after you do something the wrong way the first time (because you will)). Running ahead with a poor design happens all too often, and since it's a hobby for you, you have the luxury of taking your time and getting it right.

Read other people's code. This is probably more useful than books, after you get the basics down (how to write a loop, how to control flow, etc.)

Use source control, or at least make regular backups. This will allow you to do "dangerous" things, secure in the knowledge that you can get back to a usable state if things don't work out.

There are multiple IDEs and GUI libraries out there, and I'm not up on them, so I'll let someone else answer that.
posted by rhys at 8:32 AM on May 19, 2008


I think it would actually be a great hobby!! It will definitely be empowering to know, and you might have a lot more fun with it than if it was a profession where others tell you what to do. Instead, you'll be able to do what you want!

Regarding tips, one good thing about Python is that it forces you to code in a readable format (it won't work if it isn't spaced correctly, for example), which will definitely help with reading other people's code.

I always have used a plain ol' text editor (or vi if I'm playing on a linux box) when I'm programming in Python.
posted by tittergrrl at 8:33 AM on May 19, 2008


Do you think that this could be a satisfying/successful hobby for someone who has never coded professionally, nor is ever planning on it? Or am I setting myself up for a high level of frustration.

Programming isn't really something that you need a degree or work experience to do, or even to do better than most people. If you read the various tutorials, wikis, books, etc. that are out there, you will be using the same reasources that pros like me use in their day-to-day work. You have to love programming to be a good professional coder, but you don't need to be a professional coder to love programming.

Any anecdotes or advice or 'best practice' tips for someone setting out to avoid building bad coding habits?

Don't worry about writing bad code when you start, just worry about getting things written that you can use. Seeing your code in action, doing the things you want it to do, is what will keep you motivated. Think about it like this: don't worry about being Micheal Jordan the first time you step on a basketball court, just get out there and play.

With that said, there are some simple things you can do to make your life easier. Write code in little steps, if you are making a program that takes in commandline parameters, first just write code to grab the user input and test it, then write code to echo the input back and test it, then write code to call different functions based on the parameters, etc. Don't copy and paste code, write a function for that block of code and call it from two different places (possibly with different parameters). Give your variables helpful names and put comments in your code that you think will actually help you later. Also, if your code gets to a certain amount of complexity and starts getting hard to change, don't be afraid to completely rewrite everything from scratch. Especially when you first start, you won't figure out how to organize your code until after you're mostly finished writing it.

Good linux IDE's for Python?

IDLE and eric4 are both good. When you're just starting out you can just use a simple text editor and a terminal window if you want though.
posted by burnmp3s at 8:34 AM on May 19, 2008


Programming as a hobby. Rewarding for the non-professional programmer?

Definitely yes!... Now for more details...

<aside and motivation>
This is what I've done, on and off, for the past 4 years or so. My first "serious" program was a GUI based one (rurple.sourceforge.net) which was a bit of a challenge. My second (code.google.com/p/crunchy) is a "web app" (which means using some javascript [blech!] as well as Python) which has been developed in collaboration with another programmer.

Why do I mention these? Because a significant number of people have found them useful which shows that you don't have to be a professional programmer to write "neat" programs using Python.
</aside and motivation>

In terms of IDE, I found that SPE: Stani's Python Editor (http://pythonide.blogspot.com/) had all the features I needed to make my programming life easier. I am now using Komodo, which works better on a Mac. Have a look at
http://wiki.python.org/moin/IntegratedDevelopmentEnvironments for more choices.

As others have suggested, (plan to) learn to use a source control tool. I use subversion, but I have read good things about mercurial, bazaar and others. Using a tool like this may seem overcomplicated at first but it will make your life easier on the long run.

My advice to you would be:
1. write simple programs that you find interesting.
2. After having gotten your feet wet, read about unit tests and try to write code using "test driven development".
3. Don't be afraid to ask questions on either comp.lang.python or the python-tutor mailing list. There are many very friendly knowledgeable users out there.
4. Above all: have fun!
posted by aroberge at 8:56 AM on May 19, 2008 [1 favorite]


I'm not a professional programmer, but I've learned enough over the years to make software that helps in my teaching profession. I find it immensely rewarding, and just plain fun as well.
posted by SpacemanStix at 9:05 AM on May 19, 2008


Do you think that this could be a satisfying/successful hobby for someone who has never coded professionally, nor is ever planning on it? Or am I setting myself up for a high level of frustration.

Aside from the generic benefits of "stretching your brain" and doing something that's pretty different from your daily work activities, hobbyist programming can also provide greater insight into how all the devices we use daily function.

Any anecdotes or advice or 'best practice' tips for someone setting out to avoid building bad coding habits?

Lots of good advice upthread, so I'm just going to emphasize how important it is to comment your code. There doesn't necessarily need to be any formal procedure, just make some notes in clear English that you understanding. Should the time come to revisit an older project, this will be immeasurably helpful. Should you ever end up collaborating with another person, clearly commented code with secure their eternal respect.

Good linux IDE's for Python?

I also suggest emacs. It takes a little while to understand its ins and outs, but once you do, you'll find it tremendously useful.
posted by Nelsormensch at 9:05 AM on May 19, 2008


Once you have some working code, show it to an experienced programmer (or post it to a Python forum or to AskMe) and ask for feedback on how to improve it. The main way people fall into bad coding habits is through the reasoning "Hey, it works, so I must be doing it right. I'll do it the same way next time."

I also recommend this book on debugging. Familiarizing yourself from the outset with some good heuristics for debugging (in the abstract, not tied to a specific language or environment) will save you an endless amount of grief down the road when you're trying to figure out why your program's not working.
posted by staggernation at 9:15 AM on May 19, 2008


Agree with Nelsormensch on commenting. Although I think it is best to write your code so that as few comments as possible are necessary. Many people make comments when they should be writing readable code instead. Instead of something like
# three pancakes for a short stack
# multiply 3 times the number of pancake plates
cook(npp * 3)
it is better to do something like
PANCAKES_PER_PLATE = 3

cook(num_pancake_plates * PANCAKES_PER_PLATE)
When in doubt, add the comment.
posted by grouse at 9:24 AM on May 19, 2008 [1 favorite]


IDLE is fine for an IDE. Also, it's actually really easy to write GUI apps in Python straight out the gate! Check out some docs on tkinter, Python's "default" GUI library. Seriously, it's very simple. For an assignment, I went from zero knowledge of Python -> a working GUI'd sudoku handler/solver in a night, and I'm kind of an idiot.
posted by nicolas léonard sadi carnot at 10:05 AM on May 19, 2008


Just to throw it out there, consider taking The Python Challenge while learning.
posted by Green With You at 10:28 AM on May 19, 2008


My boyfriend does a lot of Python programming and swears by Komodo.
posted by peacheater at 10:36 AM on May 19, 2008


Programming is intrinsically rewarding because it is frustrating. Do you like solving puzzles?

Also see related threads:

Coding alone in a fog I think the frustration I'm feeling is not being able to find the "bridge" (middle ground) between "Hello World" and "Look!, a functional program/web-app".

Compiler instruction Whats your function I want to conquer my apparent inability to comprehend or write code. I'm looking for stories (or real life applicable tips from those of you who write code for a living) where you had the "A HA, I understand this finally" epiphany moment.

Help me I'm a late adopter How do I learn new programming languages and start using modern web apps without getting frustrated and angry?
posted by nemoorange at 11:46 AM on May 19, 2008 [1 favorite]


My advice: Go straight to GUI apps! They're so fun, and fun = motivation. A button that, when clicked, moves itself to a random position on the screen is halfway to a game!

And, as pointed out by carnot, GUI apps are actually very easy to make. For example, I just made the random-button-mover-arounder program in Visual C# using exactly 3 mouse clicks (the first two of which were to open Visual Studio), then 3 double clicks, then 1 line of code.

Now, to paraphrase Principal Skinner, I can count how many times I can click the button in an hour, then try to beat that record! (Perhaps I should add a counter and a timer. See? GUI apps -> motivation.)
posted by hAndrew at 6:45 AM on May 20, 2008


Programming is often more rewarding for the non-professional programmer than for the professional.
posted by Zed_Lopez at 8:13 AM on May 20, 2008 [1 favorite]


- Do you think that this could be a satisfying/successful hobby for someone who has never coded professionally, nor is ever planning on it? Or am I setting myself up for a high level of frustration.

Yes, and yes. Programming is often about being frustrated for periods of up to 4 hours at a time, and then overcoming that frustration by finding a beautifully elegant solution. It's almost guaranteed you're going to be frustrated, but if you're the type of person who refuses to give up until you've fixed the problem, I think you'll find programming hugely rewarding.

If you're using python and are interested in web development, I highly recommend checking out django. It'll take most of the pain out of developing apps for the web, and you'll have an actual project you can play with very very quickly. Later on you can learn about all the nuts and bolts.

either way, make sure you have a project you're interested in; the best way to learn is by doing and failing. I have a friend who seems to spend most of his time buying books and struggling through them, they've yet to write any code. work through one tutorial example and then hit the ground running. As you butt up against stuff you don't know how to do, learn just enough to get it done. It might not get done perfectly, but you'll keep your momentum going. it helps to have a deadline somehow to keep you motivated to finish the work. if you can, collaborate with a friend in some way so they help to push you.

- Any anecdotes or advice or 'best practice' tips for someone setting out to avoid building bad coding habits?

here's some general strategies.

* If you learn well with books, reading Code Complete 2 (the second edition) may be helpful -- it provides hard rules of thumb about implementation that are generally pretty good and usable as a go-to answer when you are wondering if "you're doing it right". Ignore everything that doesn't make sense and re-read it again in a year. My local library had a copy, yours probably does too.

* Whenever you do something new, spend 10-30 minutes on google trying to figure out what the best practice way to do it is.

* Get a google reader account (if you don't have one already), and add any blogs on which you find answers to your RSS feeds; later on you'll find answers to questions you haven't asked yet.

- Good linux IDE's for Python?

vim is not necessarily an IDE, but it is awesome.
posted by fishfucker at 9:14 AM on May 20, 2008


I retired a couple of years ago from social work and as all retires I was looking for a hobby. Two months ago I decided to take a crack at programming. I am now in the last stages of completing a program which includes GUI . Complete novice to computer programming. So the idea of programming as a hobby seems to me to a great idea. No my program won't save the world, but it sure brought a satisfying experience. The programming language I used was Liberty Basic... A few more successful programming projects I just might try another language.
posted by ljrsphb at 8:24 AM on May 22, 2008


« Older Strong Eastern/Western Graphic Novel dramas?   |   Recommendations for science experiment book for... Newer »
This thread is closed to new comments.