Ask HN: Essential skill needed to be a programmer?

144 points by catwind7 ↗ HN
In the book Coders at Work by Peter Siebel, he asks peter norvig this question:

"So is there any essential skill needed to be a programmer? Different domains obviously have different requirements but ultimately is there some commonality to writing code regardless of domain?"

Peters answer to this _really_ resonated with me - his first two sentences were "You've got to be able to make progress and then improve on it. That's all you need to be able to do in life."

How would you answer this question?

192 comments

[ 3.2 ms ] story [ 214 ms ] thread
Thinking. It's the _only_ skill programmers need. Everything else will follow.
Just thinking is not enough, you also have to be attentive. Yet another essential skill is to hear and see what is really there and not what your mind tricks you into seeing.
Most anyone can learn how to write code, however adding different skills can increase both the quality of what you produce, and the breadth of problems you can solve. You don't "need" to learn things like program complexity, but knowing it can help you write more efficient programs; you don't need to know math, but it helps if you want to work with encryption, and in a way testing, too.

What does that all boil down to? Probably curiosity, practically speaking. If you're genuinely interested in programming, and it's not just about money, status or proving some point, you'll be drawn to learn different things and have different discussions, over the whole course of your career, that will make you a good programmer, rather than just a passible coder.

No particular skill is needed.

Sincere interest is.

I've met plenty of programmers who had no sincere interest, but just saw it as a job they did 9-5 and then never thought about computers outside of those times. Programming was simply seen as a skill that could lead to comfortable, reasonably well paid job, and that was all the incentive they needed to learn the minimal amount needed to get said job. Basically as long you have an incentive to want to learn and a bit of tenacity you almost certainly can.
This would be the worst job ever if I didn't love it. I can't imagine doing it otherwise.
I don't especially enjoy my work, but the people I work with are decent and it pays the bills.
Yeah, there are so many different motivators for work. I really enjoy programming as a hobby, but I also wish we would stop treating that as if it's a pre-req to doing good work.

You can't be effective at your job if your manager sucks and you work with rude coworkers.

I quite enjoy programming new stuff from scratch, but most of the time my job is keeping other peoples crappy code running.
I had a friend who said he would never consider this type of work because there's way too much sitting... and I'm like wow that's actually one of the _easiest_ problems to solve!
Being able to memorize things.
i've come to appreciate how useful it is to just remember basic stuff from stlib instead of having to look things up. Makes getting into flow much easier.
Programming as a whole is too wide to have a single answer.

It depends on the problem domain. If you're writing low level code for a microcontroller that might require you to be able to do problemsolving on a whole other level than say writing CSS or arranging pre-built React components in a modern web application. In the same way styling those components might require a very different skillset in terms of taste, A/B testing etc.

y, just being able to take the plunge and try, innovate and improve is the first step.

I think it also helps if you have a skill for quickly deducing what's wrong when there is an error.

So being able to troubleshoot an error or bug quickly is my favorite coding super power.

Being able to Google a solution or something close to your coding problem/challenge and being able to adapt it and make it your own is a huge plus as well.

There are many skills (curiosity, persistence, willingness to improve, etc) but IMO the most essential is being able to deal with your own frustration.
when I get frustrated that's often a cue for me to take a break haha. It's been a nice way to deal with frustration for me.
For years I couldn't recognize when I was starting to get frustrated and kept pushing until it was too much to bear.

What I've found works better for me is identifying when things are barely starting to get ugly and calm myself. I tell myself that this suffering is temporary and remind myself I've been able to solve pretty much any problem I've faced.

> remind myself I've been able to solve pretty much any problem I've faced.

I think this confidence is really important and part of it seems to come from having solved lots of problems in the past / working through frustrating periods. That's why "write lots of programs" is still my favorite piece of advice because it's a lot like "show up to the gym" if you want to get stronger.

Google hacking or Google in general is very useful
Learning what questions to ask into Google is a critical aspect. Most of the time, coding is the process of writing some code, and then debugging it. Knowing to ask, my graphql endpoint is failing with a status of 500, vs. my graphql doesn't work. The first will help you narrow down the issue, the second is far too generic. I have been coding for over 20 years now, and I feel it is rinse and repeat in terms of hitting a roadblock, and finding the answer. Also, a lottttttt of patience. You might take two hours to figure out something that ends up being really trivial, and then you have that moment of feeling good that you solved it, and then you are right back into the next hurdle.
Google falls down flat unless you know "magic words". Example... let's say you want to be able to mark up a web page to highlight some aspect of it, like using a highlighter on a newspaper... you can't google hypertext markup... you have to go for "annotation"

Growing Google-fu is like getting good at smelling bad code, it takes experience, which you get via frustration and the application of gumption.

I've noticed myself scrolling farther and farther down search results. There's so much SEO'd garbage at the top of the fold now.
I would say curiosity..
Yep me too. Not only a genuine curiosity. But also a desire to quench the desire by learning.
I think some of my favorite programmers exhibit this quality in spades
Tenacity is the short version of what Norvig is saying.

A curious thing that happens every time I write code is that some unexpected error occurs. Sometimes it's trivial stuff, other times it's deep structure. Either way, you have to be bothered to make changes and test them. Sometimes this tree gets very very deep. See an error, Google it, find an example that mentions a new keyword, explore that cave for a day, return to previous branch, etc.

Something about this is related to addiction, I think I'm somehow fortunate to be addicted to something useful rather than just some molecule.

Couldn't agree more. You might be highly intelligent and/or creative, and those things should help for sure, but if you don't have grit, nearly a masochistic attitude to keep striving when you're flat on the ground or when you're at a dead-end, you won't make it.

To me, writing solid code is like combat.

Critical thinking is the most essential skill in my opinion to be a good programmer
It’s applied problem solving. I often think of programming as invisible legos that you put together that build some sort of Rube Goldberg machine.

At many times during the process the formation isn’t expressed in code yet, so it’s up to the mind of the programmer to keep the pieces fitting together as intended until the code can be written and take a little bit of the lift from the programmers brain to expressed code.

The single greatest benefit to my career as a developer has been learning to draw.

I draw on whiteboards, in moleskins, on printer paper, on the back of resumes... anywhere and everywhere. I do this because I need to convey complex ideas to important teams who are NOT programmers: Product, Marketing, People Ops, and the C-suite.

Helping people understand my ideas through illustration creates buy-in from them and trust in me. You can be a great programmer, but if people don't know and don't trust in what you're doing you'll never be given the space to execute.

What level of drawing we talking here?
- Communication skills

Being able to clearly explain why your solution will solve a given problem better than the alternative and listen to your colleagues when their suggestion is better than yours, will save you an incredible amount of frustration. It is in my opinion the most important skill I have learned

- Asking why when debugging

Finding the code that's causing a bug is only the first step. The next is preventing a similar one happening again. By constantly asking "why was this choice made", you end up finding the actual weak points in both the code and your process. Whether it's because a hack some other place forced you to write another hack, that then failed or because there was a deadline so the commit was made at 3am, there is an important lesson to be had. If you combine that with good communication, you can talk to the team about changing things, so you avoid creating similar bugs in the future. (Pro-tip: 99% of bugs are there because there wasn't time to do things better)

I don't know the sense of OP, but there's a difference between 'programming' and 'software development'--the latter is done in a team. Often the terms are used interchangeably but the skills to make one a good solo software writer only overlap with developing in a group.
I agree with the difference between programming and software development, though I'm not entirely sure on why you're pointing this difference out. Do you think my answer is not answering the OP's question? :)
I intended it to be pretty open ended. Mostly interested in skills that are useful for _both_ solo and team work. I agree that there are some things that can be very useful for team work that are not as essential for solo work when it comes to programming. For example, being able to justify technical decisions to higher ups. Lots of communication skills are essential for teamwork.
The examples I gave obviously requires being part of a team, but even programming on your own, I think it's one of the most important skills.

I'd be happy to elaborate on that argument if you have any examples of one or more situations where you wouldn't consider communication important? :)

I totally agree - I think I'm probably coming off as disagreeing with you though.

I think the difference for me is that the importance of communication for solo programming is a bit of a sliding scale depending on what your goals are. There aren't many exceptions when you work on a team. When I use the word importance, I'm tying it to a notion of necessity in relation to some goal. Team goals trump individual goals in organizations.

if you have no intention of making your code available for someone else to read / use / modify, the benefit for having readable code is really for yourself in six months and nobody else.

you also don't need to tell anyone what you're doing, so being able to clearly / succinctly explain what it is and why it's useful isn't a necessity. Does that make it an unimportant skill? No, it's just that the goals are different

I would extend the term "communication" to also include how we speak and listen to ourselves

I don't think I am able to explain it clearly without writing a very long post. There's a really good book by Marshal Rosenberg, titled non-violent communication, which gives a better explanation than I can right now. I would recommend it to pretty much anyone, if only for the very healthy way of treating oneself that it provides. Mileage may vary, but it fits my mental model pretty well

As an aside, I'm very glad to read through the replies to your post and see all the constructive you've engaged in. I've gotten mare than a few new thoughts and ideas because I chose to get involved in this post - thank you :)

Ah, I see. Thank you for clarifying that. That book sounds interesting, I'll check it out.

Thanks for taking the time to engage! I've also learned quite a bit reading through everyone's responses.

>99% of bugs are there because there wasn't time to do things better

For a very narrow definition of 'better', maybe. I'd argue most bugs are there because the cost of a bug is less than the cost of developer time it's take to prevent such bugs. There are industries where the cost of a bug is very high, but mostly bugs are like unemploymency rates: it's almost never economically feasible to get them down to zero.

I think we're saying the same thing in two different ways, so I agree with your point. What I'm reading is a good "why" - why wasn't there time to prevent this bug.

Better is a subjective word, so I think I could have made my point more clear by instead writing "99% of bugs are there because there wasn't allocated enough time to prevent them"

Do you agree more with that statement than the one I originally posted? :)

> I'd argue most bugs are there because the cost of a bug is less than the cost of developer time

You make it seem more planned and reasoned out than it really is. I mean, you can make a meta-argument, that market evolution and pressures push things towards that optimal cost-benefit spot, but on the micro scale it often just happenstance.

Again, the meta-argument can be that even doing the cost-benefit analysis is not worth the cost, but it's quite handwavy.

What counts as "better" anyway? From the engineering perspective it's about efficiency, bug-freeness, elegance. From the company perspective, profits. From the manager perspective, looking good and getting promoted.

You can often game the system by rushing a subpar product out the door, downplaying and not even caring about the defects, wooing customers into buying in with clever sales tactics and marketing, then moving on before things start crumbling down. In some sense this was worth it in terms of your personal costs and benefits and all was done in the best possible way.

the ability to communicate well is an essential skill.

If you think about it, software is driven by business requirements in most cases. But business requirements are open to interpretation. How do we know what people really want? This comes down to good communication.

Pessimism. Expect everything that can fail to fail and code defensively to deal with it gracefully. Doesn't make you much of a joy to work with though
haha there's a man thats been doing this for a long time. Every bug I have is an 8 man meeting (me being the only one who actually does anything) to explain why my TPS report cover wasn't there and how we can prevent bugs in the future.
Programming is a funny mix of deep pessimism and irrational optimism. After coding for a long time, you see two themes continuously and they train your behavior:

1. All kinds of things that you never considered go wrong all the time. This trains you to consider what could possibly go wrong in the long term deeper and ever deeper. I find this carries over into non-coding activities.

2. You are continuously faced with problems that seem completely unsolvable. And, you keep solving them day in and day out for decades. This trains you to be (perhaps rationally) optimistic about what can be done. Because every problem starts out devoid of clues and devoid of clear ways to get clues. No idea what's happening or even where to look. But, it always turns out to be something! It's never evil magic. You might be left with the mystery of "How did this ever work?" But, you solved it. You committed the 3-line patch that took 3 days to write. And, you'll move on to the next unsolvable problem right after lunch.

For me, this is the attitude that there is always something wrong with the code, there are always errors, and it's a question of whether I've found enough errors so the program is sufficiently reliable.

But, I don't think this is the main skill in programming. Good programming is the iterative application of concision and honesty, tempered by the ability to interrupt overfocus so as to find the right balance between perfection and getting something done.

Core skill: Being able to read and write documentation.

After the inception of stackexchange, the ability (or motivation) to read man pages seems to have have plummeted.

To simply be a programmer, one must only write a program, nothing more. The essential skill I guess would be literacy, knowing how to read and follow directions, knowing how to use a keyboard, not much.

To be a good programmer, if I have to pick only one "skill" I would pick systemic thinking/understanding. This starts with the ability to learn and eventually understand how a system works. The next level is the ability to create a working model of that system in ones mind. Someone who can do that will be very successful at programming anything in any language on any platform given sufficient documentation.

literally true!

I agree - so much of our time is spent coming up with working models of systems

i always call this exact distinction the difference between programmer and software developer. in my case, actual programming is 10% of the time, maybe 20% if you count staring at logs and/or monitoring trying to figure out what the hell happened. interns do the most programming since that's the easy part, the hard part is figuring out what interns should program next.
Yep, the ability to construct a mental model is the most critical. If you can then keep it organized when you translate it to code, I'd say you're well-suited to the work.

I wonder how many people have this ability, especially when reading about organizations like the one that went to Appalachia to teach people in depressed areas to program.

> systemic thinking / understanding

I was going to phrase it as "simultaneously seeing the forest and the trees."

The vast majority of my programming career has involved (1) taking a huge amount of information (specs, code), (2) building a mental model of it at 2+ levels of detail (high-level to fit a simplified holistic system in my mental swap space, and detail to have all the details about this problem at hand), (3) identifying the needle in the haystack, & (4) coming up with a simple solution.

As the parable goes [1], it's knowing which bolt to turn & how far.

[1] https://www.snopes.com/fact-check/know-where-man/

Yes. Literacy.

I saw many beginners who treat a compiler like a black box and attempting hand fuzzing until it happened to match the well-formed syntax and behaviour they wanted, while they literally holding a paper text book or opening a browser tab for a tutorial which clearly explain how it works and what they should write in a plain natural and native language of theirs.

One time, I was told by a beginner who copied an example code from a text book that it doesn't work. I looked at it. It was a fizzbuzz code, less than 10 lines. And she typed it wrong. Not just an ordinary typo. She conjured up really strange ill-formed syntax she believe it works somehow. There is a parse error message but she ignored. I pointed out the place on display with a finger and she still didn't get it. I place a text book beside the display but it requires a considerable effort convincing her the cause of the error.

Other time, I was asked why for(;;) ; else ; doesn't work in JavaScript. I kept saying because there is no syntax like that in JavaScript. You have to accept it as is or create your own language.

Sometimes, I wonder some people read natural language text by simple keyword pattern matching. People like above example weren't dumb. Far from it. They are smarter in their field than me. Yet, they failed at this basic literacy level.

I've focused on learning on a want/need to know basis. This has allowed me to make things I want or get paid to make, but I think you nailed the "essential skill" spot on.
The base skill to effectively write code is the ability to think abstractly, to be able to reason about and create what can't be seen. A surprising large number of people really can only reason about the concrete things they can see and manipulate.
Empathy. You need to be able to empathise with the user. That user might be the person giving you requirements. The person using your product. The user reading your code in a year's time.

That's not all you need, obviously. No one thing is the magic bullet which will make you a better programmer. But the worst programmers I've worked with only write code which works on their machine, for their specific use-case.

Communication is probably the biggest skill needed if you're trying to be an employed programmer working on a team.

If you're just trying to be a hobbyist and do stuff for fun then I'd say you need some things that aren't necessarily skills like curiosity, a love of challenging problems, and ability to easily retain information that you read.

One issue with learning to program,many people think learning the syntax of a particular language is programming. The one thing all programmers need is a way of thinking about problems and systems. Hard to teach.
You gotta be smart and able to think abstractly. You are building virtual legos and keeping that all suspended in your brain and that's hard to do. I hear people throwing out general terms like literacy and communication. Not really. There's a certain type of brain that's built for programming if it comes easy to you. If it doesn't come easy just bail now.
Discipline. It powerfully affects code and documentation quality, time management, operations, and interpersonal relations, just to name a few.