newby poject

Peter Hansen peter at engcorp.com
Wed Sep 22 22:41:05 EDT 2004


dit wrote:
> I want to start something small, like a learning program. I've been 
> looking and learning python for about 4 months; and I think that I have 
> the basics under my belt... is it worth trying my own project, or is it 
> better to continue with the py tutes?

After four months you should definitely be trying to build something
rather than just going through tutorials.  There's a difference
between the sort of "passive" learning you get from a tutorial,
even an interactive one, and what you'll learn by actively attempting
to accomplish something.  (And I use the word "attempting" deliberately.
It's often the case that the first few projects someone undertakes
don't ever actually get anywhere, but they're worthwhile nonetheless
just for the active learning you'll get out of them.)

> Also if I was to start, how do I pose myself the question of what am I 
> actually trying to achieve / what am I trying to make?

The usual response is something along the lines of "what problems
do you have that you would like to try to solve using your computer?"
Some people want to organize their [insert favourite collectible here].
Others want to create a game, though what "problem" that solves is
uncertain.  Take a look through any site like SourceForge and you'll
discover the wide array of possibilities, many of them with
eighteen simultaneous attempts to accomplish the same goals...

By the way, there's a possible "in between" stage that you might
not have considered, after doing tutorials and before attempting
your own project.  Take the source code for some existing program
and figure out how to munge it to add a feature, fix a problem,
or just mess with it.  Doing this with games ("Star Trek" in BASIC,
for example) was how I learned more after reading a few books
long ago.  If you wanted to learn more about wxPython and GUI
programming, for example, you could hack on the wxPython Demo
program and change the way things work.

Not only will you learn a number of the same things you would
learn trying to write something on your own, but you will also
learn about a variety of programming styles (some good, some bad)
and about code maintenance.  If you learn the right things by
trying to maintain someone else's code, you will someday be
the sort of programmer whose code is seen as a model of clarity
and elegance, because you'll know just how *bad* code can be
when it's written poorly!  Never pass up the opportunity to
learn from another's code.

It's also not quite as disheartening to toy around this way
with an existing program, and ultimately accomplish little,
than it is to undertake your "first big project" only to
find, as many of us have, that for various reasons it doesn't
get far.  Maybe others have had different experiences, but
I found it somewhat disturbing how often my early attempts
failed to be finished, until I learned more about the realities
of software development, and became well-rounded enough that
I had a hope of getting most of the way through a project.

-Peter



More information about the Python-list mailing list