Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save numberwhun/c1f6a30a52250dee4c99 to your computer and use it in GitHub Desktop.
Save numberwhun/c1f6a30a52250dee4c99 to your computer and use it in GitHub Desktop.
Borrowed from: http://stackoverflow.com/questions/2573135/python-progression-path-from-apprentice-to-guru
I've been learning, working, and playing with Python for a year and a half now. As a biologist slowly making the turn to bio-informatics, this language has been at the very core of all the major contributions I have made in the lab. I more or less fell in love with the way Python permits me to express beautiful solutions and also with the semantics of the language that allows such a natural flow from thoughts to workable code.
What I would like to know is your answer to a kind of question I have seldom seen in this or other forums. This question seems central to me for anyone on the path to Python improvement but who wonders what his next steps should be.
Let me sum up what I do NOT want to ask first ;)
I don't want to know how to QUICKLY learn Python
Nor do I want to find out the best way to get acquainted with the language
Finally, I don't want to know a 'one trick that does it all' approach.
What I do want to know your opinion about, is:
What are the steps YOU would recommend to a Python journeyman, from apprenticeship to guru status (feel free to stop wherever your expertise dictates it), in order that one IMPROVES CONSTANTLY, becoming a better and better Python coder, one step at a time. Some of the people on SO almost seem worthy of worship for their Python prowess, please enlighten us :)
The kind of answers I would enjoy (but feel free to surprise the readership :P ), is formatted more or less like this:
Read this (eg: python tutorial), pay attention to that kind of details
Code for so manytime/problems/lines of code
Then, read this (eg: this or that book), but this time, pay attention to this
Tackle a few real-life problems
Then, proceed to reading Y.
Be sure to grasp these concepts
Code for X time
Come back to such and such basics or move further to...
(you get the point :)
I really care about knowing your opinion on what exactly one should pay attention to, at various stages, in order to progress CONSTANTLY (with due efforts, of course). If you come from a specific field of expertise, discuss the path you see as appropriate in this field.
---------------------------------------------
I thought the process of Python mastery went something like:
1 Discover list comprehensions http://en.wikipedia.org/wiki/List_comprehension#Python
2 Discover generators http://en.wikipedia.org/wiki/Python_syntax_and_semantics#Generators
3 Incorporate map, reduce, filter, iter, range, xrange often into your code http://docs.python.org/library/functions.html
4 Discover Decorators http://wiki.python.org/moin/PythonDecorators
5 Write recursive functions, a lot
6 Discover itertools (http://docs.python.org/library/itertools.html) and functools (http://docs.python.org/library/functools.html)
7 Read Real World Haskell (read free online) http://book.realworldhaskell.org/read/
8 Rewrite all your old Python code with tons of higher order functions, recursion, and whatnot.
9 Annoy your cubicle mates every time they present you with a Python class. Claim it could be "better" implemented as a dictionary plus some functions. Embrace functional programming.
10 Rediscover the Strategy (http://en.wikipedia.org/wiki/Strategy_pattern#Python) pattern and then all those things (http://rads.stackoverflow.com/amzn/click/0596007124) from imperative code you tried so hard to forget after Haskell.
11 Find a balance.
------------------------------
Understand Introspection
- write a dir() equivalent
- write a type() equivalent
- figure out how to "monkey-patch"
- use the dis module to see how various language constructs work
Doing these things will
- give you some good theoretical knowledge about how python is implemented
- give you some good practical experience in lower-level programming
- give you a good intuitive feel for python data structures
-----------------------------------
Forcing yourself to work in Python will be unforgiving if you use brute-force algorithms. This will teach you how to lay out large datasets in memory and access them efficiently with the fast language features such as dictionaries.
From doing this myself I learnt:
File IO
Algorithms and techniques such as Dynamic Programming
Python data layout
Dictionaries/hashmaps
Lists
Tuples
Various combinations thereof, e.g. dictionaries to lists of tuples
Generators
Recursive functions
Developing Python libraries
Filesystem layout
Reloading them during an interpreter session
And also very importantly
When to give up and use C or C++!
All of this should be relevant to Bioinformatics
Admittedly I didn't learn about the OOP features of Python from that experience.
------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment