After C++, what with Python?

geremy condra debatem1 at gmail.com
Sun Jan 16 02:35:54 EST 2011


On Sat, Jan 15, 2011 at 9:30 PM, Aman <aman.6677 at gmail.com> wrote:
> Hey all, I am a college student, and at college, we did most of the work in C/C++. I kind of stopped using C when I learned C++ (simply because C++ seemed a natural/elegant choice to me, and had backward compatibility with C). I've had a lot of experience with C++.
> Recently, I was on the path to learn a new programming language, and after suggestion of some of my friends and consulting the web, I chose to proceed with Python. I've finished with core Python and now I'm going through the various inbuilt packages that Python provides. I have an inquisitive mind, and while programming, I always want/tend to make something that is out of the box. It would be great if you people could guide me as to what to proceed with and how.

Here's what I would do:

1. Start off slow; reimplement things you've written in other
languages until you're sure that you understand how Python constructs
differ from superficially similar things in C/C++.

2. Once you've done that, pick a few small tasks (things you would
expect to take about one or two weeks to finish), write all the
high-level architectural code, and then put together a test harness
for them using either unittest[0] or doctest[1]. Pick the one you're
most confident you can write the code for and keep at it until you
pass all your tests. Using the lessons learned from that, refactor the
code of the others and iterate until you feel comfortable thinking
about Python at a high level. As a bonus, you also now have a set of
medium-scale projects with good test harnesses to show off.

3. After you've convinced yourself you know how to write Python, learn
to read other peoples' Python code. Look for small projects (1-5 KLOC)
with 'easy' bugs, get familiar with them, and fix those bugs. It isn't
a race- make sure your work is high-quality, well-tested, and well
documented before you send it to the maintainers. As yet another
bonus, if those patches get accepted you'll be able to tell that to
potential employers.

At this point you'll probably have a much better idea of what you'd
like to do moving forward- you'll probably have found out what kinds
of problems you find interesting, which ones you have an aptitude for,
and what kinds of environments you like. In other words, you'll be
much better off than the vast majority of your peers ;)

Geremy Condra

[0]: http://docs.python.org/library/unittest.html
[1]: http://docs.python.org/library/doctest.html



More information about the Python-list mailing list