DEV Community

mrick
mrick

Posted on

Reflections on 10,000 Hours of Programming

This post originally appeared in my free daily newsletter on startups and engineering.
You can join 200+ subscribers here: https://matt-rickard.com/subscribe/

The key to achieving world-class expertise in any skill, is to a large extent, a matter of practicing the correct way, for a total of around 10,000 hours — Malcolm Gladwell in Outsiders

Well, I'm certainly not a world-class expert, but I have put my 10,000 hours of deliberate practice into programming. Here are 31 of my reflections on programming.

These are reflections only about pure coding — no lessons sum up to "programming is about people" or "how to be a senior technical leader" (arguably more important to a career, but not the topic of this post).

These reflections are just about deliberately writing code for 10,000 hours. Most don't apply to beginners. These reflections are not career advice. Think of them as lessons on being a technical guitarist, not about being a good band member. They are about becoming a better programmer for yourself.

  1. Browsing the source is almost always faster than finding an answer on StackOverflow.
  2. In many cases, what you're working on doesn't have an answer on the internet. That usually means the problem is hard or important, or both.
  3. Delete as much code as you can.
  4. Syntactic sugar is usually bad.
  5. Simple is hard.
  6. Have a wide variety of tools and know which ones to use for the job.
  7. Know the internals of the most used ones like git and bash (I can get out of the most gnarly git rebase or merge).
  8. Build your own tools for repeated workflows. There is nothing faster than using a tool you made yourself (see: software I wrote.)
  9. Only learn from the best. So when I was learning Go, I read the standard library.
  10. If it looks ugly, it is most likely a terrible mistake.
  11. If you have to write a comment that isn't a docstring, it should probably be refactored. Every new line of comments increases this probability.
  12. If you don't understand how your program runs in production, you don't understand the program itself. In my experience, the best engineers know how their program works in every environment.
  13. The above rule applies to the build pipeline as well.
  14. Use other people's code religiously.
  15. Corollary: Most code out there is terrible. Sometimes it's easier to write a better version yourself.
  16. A rough rule of thumb: never take a direct dependency on a small library that you could easily rewrite or a large library that should have been small.
  17. Know when to break the rules. For rules like "don't repeat yourself," sometimes a little repetition is better than a bit of dependency. 18.Organizing your code into modules, packages, and functions is important. Knowing where API boundaries will materialize is an art.
  18. Pick the most efficient tool most of the time, but also pick what you know. Is Arch Linux the most efficient operating system for the modern developer? For me, it is, but for most, probably not. Should you use acme? Only if you're Rob Pike.
  19. Avoid cyclomatic complexity. Novice coders don't even know that they've tangled the dependency graph until it's too late.
  20. Avoid nesting conditionals deeply. Have common sense about your conditional tests and naming convention.
  21. Name variables correctly. Again, an art.
  22. While rare, sometimes it's a problem with the compiler. Otherwise, it's always DNS.
  23. Use esoteric language features sparingly, but use them when you're supposed to, for that is the point.
  24. Technology does not diffuse equally. For example, there is a lot that frontend developers could learn from low-level engineers (especially now that everything is compiled). 26. Likewise, there are UX and usability features that JavaScript developers could teach cloud engineers.
  25. As a result, different kinds of engineers look at the world differently.
  26. Some programmers are 10x more efficient than others. I know because I've been both a 10x programmer and a -1x programmer.
  27. There's no correlation between being a 10x programmer and a 10x employee (maybe a negative one).
  28. Good APIs are easy to use and hard to misuse. The configuration cycle goes from hardcoded values to environment variables, to CLI flags, to a configuration file, to a templated configuration file, to a DSL, to a generic bash script, and back to hardcoded values. Know where you are on this Heptagon of Configuration.
  29. All layers of abstraction are malleable. If you run into a fundamental wall, sometimes the answer is to go down a layer of abstraction. You aren't confined to the surface.

Where did I put in my 10,000 hours? Well, I've been programming for about 15 years. Most recently, I worked as a professional software engineer at Google on Kubernetes and Blackstone, the private equity firm. Before that, I spent most of college in the library writing programs for my own projects instead of writing proofs (which I should have been doing as a math major). And before that, I was hacking away at all sorts of things — running a botnet on RuneScape, writing a Latin translation app for the iPhone (so I could do better on my Latin exams), creating a web clipper, or ricing up my desktop.

What did I do for the 10,000 hours? The most recent work was in distributed systems, but I've written code across the stack. Languages like PHP, JavaScript, Go, Ruby, Python, C#, Java, Swift. Frontend, backend, mobile, kernel, cloud, ops, and even some IT. I've worked on large-scale open-source projects like Kubernetes and maintained subprojects, which allowed me to have my code peer-reviewed by some of the best engineers.

Top comments (9)

Collapse
 
momander profile image
Martin Omander

This is an amazing article: very useful and to the point. I found myself nodding along to many of the items, and discovering several new things I should investigate. For example, the configuration cycle in item 28 gave me something to think about. Thanks for sharing, Matt!

Collapse
 
mrick profile image
mrick

Thanks! Forgot to link it, but I also wrote an article on the heptagon of configuration! matt-rickard.com/heptagon-of-confi...

Collapse
 
momander profile image
Martin Omander

Excellent! What might be an example of a domain-specific language used for configuration, per your heptagon? What might it look like? I don't know if I have ever used such a language myself, and I had a hard time visualizing what it is from the Wikipedia article.

Collapse
 
gregiven profile image
GregIven

Underrated post

But seriously, you should a special last addendum.

  • Hard work pays off and there are no shortcuts so don't short change yourself
Collapse
 
seokjeon profile image
Se-ok Jeon

Thx for this! This is really what I wanted. Helped A LOT.
Can I translate in Korean this article? If you don't mind, I wanna share this awesome information in Korean. Surely, There will be a link directing to this original one.

Collapse
 
mrick profile image
mrick

Sure, go ahead!

Collapse
 
momander profile image
Martin Omander • Edited

As I'm re-reading this top-notch article, I was again surprised by "4. Syntactic sugar is usually bad". Would you mind telling us a bit more about why you think this is the case?

Collapse
 
mrick profile image
mrick

Maybe "usually bad" was an exaggeration. There are many cases where it is clear and useful. But, if it leads to any ambiguity or is lexically close to something that would be a bug, you might want to just favor verbosity. The Go language takes a lot of this to heart in its design, like with golang.org/doc/faq#inc_dec

Collapse
 
momander profile image
Martin Omander

Makes sense. The explanation you linked to in the Go FAQ helped clarify as well. Thanks!