r/Python • u/n3buchadnezzar • Jan 14 '22
Discussion Python is a hammer, and we are carpenters, building houses
Something I struggled with for a long time is beginners, and it might just be a personal bias, but particular Python beginners. Both online and offline I see so many questions weekly that roughly fall into two camps
- Are there any universities that teach undergraduate CS purely using Python?
- How do I become a data analyst using Python`?
- What should I learn to get a job as a python developer?
- How do I make quick money using Python?
While the other camp is roughly along the following lines
- I want to build a Python application that calls me and ask if I have taken my medicines.
- How do I build a website only using Python?
- I am playing game X, how do I train an AI to play the game perfectly?
- How do I make Python buy and sell crypto currency based on tweets?
I am not saying these are bad questions (from beginners), but they irked me. I was struggling to explain to beginners what the issue with questions such as these are. Is there an easy to understand analogy which would help. Finally, last night it struck me.
Python is a hammer, and we are carpenters, building houses
Lets rephrase the initial questions with this background instead to show how absurd they become
- Are there any universities that teach carpentry only using a hammer?
- How do I become a roofer, framer, ship carpentry etc., only using a hammer?
- What should I learn to quickly get a job using a hammer?
- How do I make quick money using a hammer?
Now we see that the fundamental issue with the first sleeve of questions is that Python is a tool, we as programmers use, to solve problems. Limiting our toolbox to only using a single tool would make it impossible for us to work. In addition we are offered jobs based on how well we are able to solve problems, not on the particular tools we know. If I am adding someone to my team I am 99% sure they have never worked with our framework, and I could not care less if they are Thor the god of hammers. What I care about is if they can learn our framework, flow of work and seamlessly fit our team after half a year or so of on-board training.
Instead we should first look at what we are trying to do, and then pick the right tool for the job.
Similarly the issue with the second handful questions is unfamiliarity with programming and the amount of work required to make something. What I like with the carpentry analogy is also that it is easier to visualize the scale. A real life program (or a house) is a big project, something that requires multiple people, several weeks or months to make.
Maybe the carpentry / hammer analogy will help next time someone asks:
"Hey I got this idea for a website, and I know you know Python, can you make it for me real quick?"
View all comments
51
u/czar_el Jan 14 '22 edited Jan 14 '22
I agree with your points and overall perspective. But an explanation for why beginners ask the questions they do is they are beginners, and you're not considering their context.
Your points seem biased to the experienced/professional side of Python users. Would you train a new homebuilder by saying "Don't focus on how hammer works, there are so many other tools we'll need to build this house. Today's lesson will cover hammers, miter saws, concrete stampers, electrical wiring tools, plumbing wrenches, insulation sprayers, and roofing nail guns. If you ask a question, make sure it's not about just one tool." No, you wouldn't, because each of those tools is in a different homebuilding discipline and you'd teach them in phases. But that's kinda the equivalent of your post. You're critiquing beginners for asking about the tool they're learning in the context in which they want to learn it, and telling them to think/learn bigger. Beginners sometimes need to go one step at a time, like how the new homebuilder won't master carpentry, electrical wiring, plumbing, foundations, and roofing all at the same time. They may eventually learn them all, especially if they move up in the industry or decide not to specialize, but not as beginners. The questions you mention having a problem with are the one step in their journey, not their lifelong approach to Python.
Another bias with your post is that you're coming at it from a programmer/comp sci perspective, but some Python users aren't full developers, they may just need Python for quick visualizations or basic statistics, not full stack UI and web dev. Would you train someone interested in building furniture by saying "Hammers will work here, but they are also often used alongside concrete, electrical wiring, plumbing, and insulation tools -- be sure you ask about them too." Of course not. So it's OK that a Python learner asks about their context and not about Python in relation to the whole ecosystem of approaches to problem solving, because they need to learn their context first and may not need the extra context yet. Again, they may eventually need to branch out, which is when your advice would apply. But not when they're still beginners.
Your points make the most sense for someone who is just past the beginner phase. They now know the basics of a language, and need to follow your advice so they don't begin to see every problem as a nail. Depending on their needs, they need to decide whether to go deeper into Python mastery, or prioritize learning another language/framework with a complementary pro/con list to Python.
tldr; you're right, but beginners may have legitimate reasons to ask the questions the way they do because they are beginners.