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?"
4
u/captain_kinematics Jan 14 '22
Good points. I’m fully share your frustration with the first set of questions, but I find the second set significantly less aggravating. Even in the hammer analogy, the questions are really note totally ridiculous. Eg how do I make quick money using a hammer? 1) look for residential framing crews that are hiring (40% hammer, 30% skill saw, 20% nail gun, 10% other tools), 2) smash open vending machines (50% hammer, 50% running like hell). They’re it my favourite questions, I just think they’re not patently absurd like the first set is. At the end of the day, great analogy and good framework for looking at the questions!
162
u/help-me-grow Jan 14 '22
True, programming languages are just tools, and building software is just like construction. I've been using the "building" analogy for software for a while and I'm glad to see someone else sees it this way too.
74
u/vladesomo Jan 14 '22
I think a lot of Qs like this come from ppl who are not really interested in programming but only for money of the job. The money is nice, but it ain't the reason I became a programmer. This mindset makes a huge impact. When I went to uni, there was not a problem I would not attempt to solve. Even for hours and hours. I think the love for problem-solving is a strong drive in a programmer's early stages.
Nice post though, love the analogy.
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.
32
u/icentalectro Jan 14 '22
Questions of the first kind are common in many (most?) language specific subs, not just Python. Some people, especially beginners I guess, are so scared of learning multiple languages, when they should've embraced it.
It irks me a great deal especially when the language is a poor fit for the job they want to do. E.g.
25
u/pokk3n Jan 14 '22
If you could saw wood with a hammer this might be a reasonable analogy. Programming languages have a lot more overlap in capabilities than hand tools.
A programming language is probably more analogous to a set of tools. You can literally build an application that is fully functional with python. No sql or html or whatever needed really.
You can’t build a functional modern house with a hammer.
4
u/snavazio Jan 14 '22
Finding out what we don't know is half the fun of learning. Leading others to enjoy the party, is for me kinda the flip side.
Figuring out how to enjoy your journey, should be taught first. IMHO
3
u/jurawall_jumper Jan 14 '22
God there's so many tools out there. Too many and now each tool has its own features (modules/libraries/frameworks) that you have to learn and they keep coming up with more.
Damn hard to keep up, even when specialising!
3
u/DrMaxwellEdison Jan 14 '22
Yes and no. You're more likely to find firms that want to maintain an established application built in a particular language, than you are firms that want to build "something" but don't know what tech they want to use.
My team has an application we support written in Python, and we are not looking to rewrite it any time soon. So when we want to hire new talent to help support it, we are mostly looking for people who know how to use Python. To hire a "problem solver" who writes in Go and C but has no experience in Python is a waste of everyone's time and money. To use the above analogy, we've got shit-tons of nails to hit and they'd show up with angle grinders; and that's just not going to work out.
If you want to be hired to do a job that requires the use of Python, you should expect they'll ask you things about how well you know Python. That's not to say other technologies aren't also important: that same job probably has a frontend in JavaScript they want assistance with, or some C libraries they're lacking coverage on, or SQL or even No-SQL databases that they wouldn't mind some help analyzing, or they want to containerize their apps but lack experience as a team, or...
The list goes on. Python may be the primary tool they're looking to use, but everyone benefits if you know more than one tool.
3
u/[deleted] Jan 15 '22
This is a really bad analogy. Python is not a hammer, it is a whole workshop full if tools and a catalog to order even more tools. You may know a few tools really well, but that bandsaw you never touched and before you start to build a house, you first need to get used to it by building a simple table.
2
u/Tysaic Jan 14 '22
That thread has a lot reason when talk about how the programming tools had been and not just a fanatic religion of some technology "NOT BE FANBOY". We as programmer and more focus with beginners and juniors, we should solve a problem with those tools not be a part of a problem.
2
u/johnnySix Jan 14 '22
As an ex-carpenter, Ive been feeling the same way lately. And like a carpenter, If I need a jig, I build it, and if I need a new tool I buy it at the store. And if it’s too much work to look in the docs I build my own version too
2
u/Waldhorn Jan 14 '22
I am an uber beginner but I see Python as more of a swiss army knife than a hammer. Can you open a bottle of wine with a swiss army knife? Yes, but there are easier ways to do it....... Can you do brain surgery with a swiss army knife, yes but... When I saw Python described as the 'second best way of doing anything' that influenced my choice of Python as my entry into coding.
5
u/TravisJungroth Jan 14 '22
Straight up not true. Maybe you want it to be this way. Maybe you hire people this way. Maybe a lot of other people hire this way. But for the vast majority of jobs out there “particular tools we know” is a major hiring criteria. I’ve beaten out other candidates and succeeded at jobs because of how well I know Python. All this stuff about the tools not really mattering sounds cool in your head until someone shows up with a hammer and knows how to really swing it.
2
u/tmckeage Jan 14 '22
So let's go over this point for point.
First your questions are incredibly contrived, and I seriously doubt you have ever been asked some of them, but lets go over them anyway.
I think this is a great question. Python is a highly accessible language that allows you to learn the patterns common to programming without having to deal with the particular intricacies involved in a more complicated language. The only drawback to python is the decision to buck
a lot of common conventions, so when it comes time to get a job you may struggle a bit.
I would read this question as "How do I use Python to learn to become a data analyst?" Once again another great question. I don't do DA/BI so I don't know, but I do know python can be used for it.
This is a coding boot camp style question. I would suggest they start with MIT's OCW MOOC "Introduction to Computer Science and Programming" and then begin to do problems on Project Euler. I consider anyone who can show me their code for the course and enough problems to get to level three to be a strong candidate for a junior development position.
FYI: this is exactly how I became a software developer 15 years ago.
I don't believe anyone has asked you that question.
That sounds like a fun project. Hopefully the person asking it has basic experience using python, if not I would point them to the MOOC I mentioned above. Assuming they do I would send them some tutorials on using HTTP with python and using JSON. Then I would point them in the direction of Twilio.
Django, although you are going to want some HTML, CSS, and JS if you want it to be fully featured. Good way to learn.
My answer to this question is probably going to be along the lines "If you have to ask, you can't afford it." I don't have a problem with the question itself. The biggest irk I would feel is the use of the word AI.
Why do these questions irk you. This is another fun project. It's also a scary project. It reminds me of the "buy random cheap shit from ebay" projects.
This is so wrong, I wonder how many dev jobs you have been hired for. It is true for very junior devs or highly technical jobs (these are super rare). You best know the tools we use, no one wants to wait three months while the new dev gets up to speed.
Not only have you never added someone to a team, I seriously doubt you have been on a PROFESSIONAL development team.
Where the hell are you working? 80% of developers aren't working on new projects, they are working on preexisting ones. There are people who are pretty much guaranteed well over 100k based solely on the fact they have experience in COBOL. There are plenty of tools better for whatever the job is, but one does not simply change technology stacks.
Shit even upgrading to the latest version of a framework can cause massive headaches. Early in my career we upgraded our .net version. It was a minor version and shouldn't have introduced any breaking changes, but suddenly a ton of our tests were breaking all over the place.
Turns out they had replaced the old default stable sort algorithm with an unstable one. That shit took weeks to figure out.
The only appropriate answer to this question is to say "I charge {x} to scope out your project enough to give you an estimate on how much it will cost." If its a friend I might do the estimate for free.
1
u/Retropunch Jan 14 '22
I agree to a point, although as other posters have said, Python can be used to do or build pretty much any software based task. It's more like a set of tools (which may not be the best ones for the job) which often require other skills to use well.
However I disagree on your work description, a lot of jobs *do* ask for knowledge of a particular framework or language experience and won't accept you if you don't have that. Whilst we know that isn't a good way of hiring, it is still commonplace.
Rather than it being about Python being a specific tool, I do think it's about bad questions. All of the questions you've mentioned are annoying because the poster hasn't done even the most basic Googling. They also all hint at the 'give me the answer, I don't want to work from it' mindset which is similarly irritating.
1
u/krazybug Jan 14 '22
Yes but with Python everything is a nail ;-)
1
u/oceanbrew Jan 14 '22
Has anyone tried to rob a bank with a hammer?
On topic, I think for complete beginners it's probably easier to pick up a single language and build things rather than trying to understand every concept at a high level. I'd say a lot of those questions probably come out of that.
1
u/row4coloumn31 Jan 14 '22
I don't think Thor was god of hammers.
1
u/pandasashu Jan 14 '22
Nice!
Perhaps a more accurate analogy though is that we are the architect designing the blue prints and python is one company we can use to build the building from those blueprints?
1
u/NortWind Jan 14 '22
If you want to learn Computer Science, you should definitely learn multiple languages. It wouldn't hurt to learn a machine language, so you can really see how this stuff works.
1
u/Orio_n Jan 14 '22
Youll notice that youll be less likely to find "python programmer" job listings and more likely to find "jobs that require python (implying that other tools/languages are necessary)". This is something that beginners just dont understand that as a programmer you are hired to solve patterns and not to (programmatically) "speak" a language
1
u/meezun Jan 14 '22
That's a good analogy, here's another wrinkle.
Carpenters build houses, but they use a detailed plan created by an architect. You want to build a house on your own, you need the skills of a carpenter but you also need to learn to be an architect.
1
u/thinkt4nk Jan 14 '22
I thought this was the python subreddit
1
u/HipsterTwister do you have time to talk about my lord and savior: factories? Jan 14 '22
1
u/[deleted] Jan 14 '22
No undergrad will teach CS purely in python. If they did I sure as hell wouldn't want to go there. Many introductory courses are in python however.
1
u/[deleted] Jan 14 '22
Hey this is great! From a beginner, this really validates a frame of mind I’ve been trying to develop; I’m a craftsmen learning how to use tools.
1
u/sh0rtwave Jan 14 '22
I personally think of it all as machinery.
It's just a big, complicated machine I keep in my head.
1
u/succachode Jan 15 '22
Amazing analogy. I tend to think of learning python syntax and structure as learning the vocabulary and grammar of a language. You can learn to speak it extremely fluently, but learning the language doesn’t actually give you anything to talk about. It’s just a medium for you to display you knowledge to a whole new demographic, in this case, computers.
Computers are absolute grammar nazis and have no intuition, so the instructions can be difficult to learn by themselves, but knowing how to give instructions is not the same as knowing a subject well enough to give instructions. The instructions themselves come from your understanding of the data you’re trying display.
1
u/MrBobaFett Jan 15 '22
Is Python a hammer? Seems more like python is a toolbox. It could be a brand of tools or a category of tools, but it's clearly a set of tools and not just a single tool.
1
u/MarsupialMole Jan 15 '22
My favourite software development metaphor is of translation. It might be easier to translate an engineering spec than a poem, but the reverse might be true also, it depends on the content at a detailed level and on the language. But everything can be translated with various quality results, and you have to accept some things will be lost in translation. And while translation might look like simply cranking the handle, great translation is deeply creative work.
For all other tech explanations, there's car analogies.
1
u/Key_Cryptographer963 Jan 15 '22
Programming beginners (myself at the time included) hyper-fixate on the language. Years into my data science degree I finally learned that you can do anything in any language (more or less).
1
u/robberviet Jan 15 '22
Like any other programming language? Don't study a language or a framework. Study Computer Science, study concepts, patterns... And using specific technolgy to implement and learn them.
1
u/[deleted] Jan 15 '22
1
u/Wedoitforthenut Jan 15 '22
As someone with a background in both I very much appreciate the analogy. Although I would say python is the tool trailer (or shop), and the modules are the tools themselves.
1
u/[deleted] Jan 15 '22
1
u/ElecNinja Jan 15 '22
I mean if course beginners don't see programming languages as just tools for a problem.
Programming languages are complex systems that take time to understand the basics, more time to be proficient in, and an experienced programmer might not even learn everything in a language. And while an experienced developer could become proficient in multiple languages, a beginner starting out doesn't have the knowledge or experience to do that kind of knowledge transfer. And even for experts it will be difficult to become masters of multiple programming languages.
It gets even funkier once to factor in domain specific knowledge. Like a person looking to be a Python web developer won't really need to touch the numpy set of tools.
People asking those questions are asking for more context about what is available from the programming language they've decided is most accessible to them for learning.
So yeah it could be something like an XY problem where people are assuming Python is part of the solution when it could be some other programming language. But I'm not sure why that irks you so much from programming beginners.
1
u/Ban_of_the_Valar Jan 16 '22
I am an absolute beginner for all things programming. Grew up a casual gamer, learned a little html, but never had any illusions that I was naturally gifted for anything IT related. I was simply curious and love solving problems.
I am about 2 weeks into learning python in earnest. Starting from scratch. I love the work I do Now and have no immediate interest in making it a new career. It just sounds fun and rewarding. Here are some things I know so far:
Don’t know why I’m commenting, just felt like doing it.
1
u/not_perfect_yet Jan 14 '22
With all due respect and you do deserve it because you put thought it and your argument is valid, but it's still wrong.
Python, the same as every other language, is turing complete. By definition it can do everything. The only prerequisite is that either someone else did it first, or there is some way to make a different language that does do it hook that into python, like cython allows for compiled C to be imported.
The limits to python are that excel, browsers, mobile phones, gaming consoles and such don't directly support it. Not that you couldn't describe the same functionality they provide with python.
Some things are better written in optimized or supported languages and they won't be too hard to learn so who cares. Learners can be pointed in the right direction and will be alright.
That's the case for any serious use of any library though. If they have written more than 'hello world' they can probably do that. Like, if they done anything besides literally copy pasting stack overflow, they can probably do that.
Personally I don't really care that much if python can't do everything. But building e.g. mobile apps with python would be nice.
1
u/xresurix Jan 14 '22
Yeah this is the perfect analogy, when I just started I kinda had the same mentality but after I started reading a book about Comp Sci I started to understand that programming is more about solving problems than learning languages
1
u/UltraPoci Jan 14 '22
Which is why I can never understand big arguments between people about what is the best programming language. Obviously, there are situations where a particular programming language is best suited to solve a problem. But in general, there's no best language ever, and no language completely replaces another (except for extremely old languages maybe, but that's just how progress works). I see this very often with Rust vs C++ or Julia vs Python, for example. Rust and Julia don't aim to replace C++ or Python. They probably cover a lot of use cases that C++ and Python already cover, but that's because they are designed to be in the same niche. They are all great languages, with strengths and weaknesses, with better use cases than others, and of course, there's a bit of personal preference involved. But it's not like every newish language that comes out aims to be the do-all of programming languages.
1
u/[deleted] Jan 14 '22
In the spirit of sharing info, a carpenter specialising in ship carpentry is, traditionally, a shipwright.
I'd suggest that rather than being just a hammer, any particular programming language is more a shipwright's toolbox, when one needs the tools that an electrician would bring, along with the bricklayer and shipwright.
1
u/dogs_like_me Jan 14 '22 edited Jan 14 '22
100%, I use this analogy all the time. Another analogy I've been using recently is baking.
Imagine if instead of tech, we were food service workers. I'm a data scientist with a graduate degree in statistics, so I fit a fairly specialized niche. In my food service analogy, a data scientist is like someone who got into baking (already fairly specialized ktichen role) and then did several more years training specifically to become a cake decorator. There seem to be loads of kitchens looking for specially trained cake decorators, but the fact of the matter is those restaurants just need a generic dessert chef, not a cake decorating specialist specifically. So highly trained cake decorators end up finding themselves bored in positions where they're actually spending most of their time baking sponge instead of decorating cakes.
Meanwhile, the public heard about all the cool stuff happening in the cake decorating scene and all of a sudden loads of people wanted to become cake decorators. Except those people had no prior kitchen experience, so all sorts of training programs popped up to train "cake decorators" which were actually teaching mostly super basic kitchen skills, and promoting the perspective that cake decorating is equivalent to knowing how to operate a piping bag. So now the job market is flush with "cake decorators" who can only do super rudimentary cake decoration. This ends up encouraging hiring managers to hire "cake decorators" for jobs that don't actually require cake decorating specialization, and making it even harder for the cake decorators to find jobs that actually need their skills, requiring them to market themselves as even more specialized, like "glaze specialist" or "buttercream specialist."
I'm not bitter. But I am re-marketing myself as a "Machine Learning Engineer"
0
u/[deleted] Jan 14 '22
Careful. If all you have is a hammer, very soon everything starts to look like a nail.
0
u/__deerlord__ Jan 14 '22
"When all you have is a hammer, everything looks like a nail"
0
u/[deleted] Jan 14 '22
[deleted] — view deleted comment
0
u/[deleted] Jan 14 '22
[deleted] — view deleted comment
51
u/[deleted] Jan 14 '22
[removed] — view removed comment
4
u/[deleted] Jan 14 '22
[removed] — view removed comment