How to Get Good at Python
How Grass & Trees Become Enlightened
During the Kamakura period, Shinkan studied Tendai six years and then studied Zen seven years; then he went to China and contemplated Zen for thirteen years more. When he returned to Japan many desired to interview him and asked obscure questions. But when Shinkan received visitors, which was infrequently, he seldom answered their questions. One day a fifty-year-old student of enlightenment said to Shinkan: "I have studied the Tendai school of thought since I was a little boy, but one thing in it I cannot understand. Tendai claims that even the grass and trees will become enlightened. To me this seems very strange." "Of what use is it to discuss how grass and trees become enlightened?" asked Shinkan. "The question is how you yourself can become so. Did you ever consider that?" "I never thought of it in that way," marveled the old man. "Then go home and think it over," finished Shinkan.
A Reality Check
Let's start with a truth bomb: no amount of reading will make you better at Python (or any programming language) unless you actually create something. Reading without doing is like preparing to swim by reading about water—it doesn't work. The only way to improve is to write, run, and debug. Now I'll get straight to the point.
A Must-Read Book
Byte of Python by Swaroop C H is my top recommendation for beginners. But don't just read it—write down every single line of code in the book and run it. This hands-on approach gives you a feel for Python's syntax and quirks. It's the best way to internalize the basics.
Read the Official Documentation
Once you've got a handle on the basics, it's time to dive into the official Python documentation. When I started, I read the Python 3.6 docs thoroughly. This habit helped me understand every new Python release since then. The docs are a goldmine—seriously, read them.
Listen to Raymond Hettinger
Dive into Raymond Hettinger's brilliant playlist on Python. Hettinger's talks are packed with wisdom, covering topics from idiomatic Python to performance tuning. They are essential viewing for anyone who wants to write "Pythonic" code.
Keep Up with the Python Community
- PyCons: Follow the latest talks and discussions from PyCons. They're treasure troves of insights, showing how Python evolves and how people use it in real-world applications.
- Twitter: Follow Python developers and enthusiasts. The Twittersphere often shares tips, tricks, and news faster than blogs or official announcements.
- Avoid the Noise: Stay away from "LeetCode gurus" and overpriced courses promising to make you a Python expert in days. Python mastery comes from consistent practice, not shortcuts.
Expand Your Toolbox
Python is just one piece of the puzzle. To truly excel, you need to master the tools and technologies around it:
- Terminal & Shell: Learn the ins and outs of bash, zsh, tmux, and vim.
- Automation: Understand cron jobs and basic scripting & ssh.
- Web: Understand basic web concepts, HTTP, and REST. Learn some HTML, CSS, and JavaScript.
- Databases: Learn SQLite.
- Data Science: Learn pandas, numpy, and scikit-learn.
Build Projects Without Git (At First)
The best way to learn is to build projects. Avoid Git initially. Yes, Git is vital, but beginners often struggle because they don't yet have the context to appreciate it. Start without it. When managing files becomes painful, you'll naturally understand why Git is useful—and learning it will be far more rewarding.
Learn the Ecosystem
- Semantic Versioning: Understand how versions work (e.g., major.minor.patch). It'll save you from dependency hell.
- Readable Code: Instead of comments, focus on writing self-documenting code.
- Documentation: Learn how to write clear, concise documentation. It's a skill that separates good developers from great ones.
Break Through the Basics
Once you feel comfortable with Python and auxiliary tech, you might hit a plateau. That's the time to branch out. Here's what I recommend:
- Haskell: Read Learn You a Haskell for Great Good!
- Rust: Dive into The Rust Programming Language
- JavaScript: I started with JavaScript for Kids and later explored The Nature of Code for creative coding inspiration.
Some Good Advice
Here are some thought-provoking talks that challenge conventional programming wisdom. They might make you uncomfortable, but that's often where growth happens:
- Stop Studying Programming - A reality check on the difference between studying and doing.
- Handmade Hero on Getters/Setters - A passionate take on why some "best practices" might be holding you back.
- Why Learn Haskell - Understanding the value of functional programming perspectives.
- Jonathan Blow on Productivity - Unconventional wisdom about programming efficiency.
- More Jonathan Blow Insights - Additional perspectives on software development culture.
- Social Media's Impact - Understanding how social media affects your learning potential and focus.