top | item 34854160

Ask HN: How did you master the art of programming?

31 points| shivajikobardan | 3 years ago

Who qualify to be a master programming?

Anyone who can create websites, games, from scratch with their own brain and google help without following tutorials line by line.

So, how did you mastered the art of programming? If it was practice, what did you practice?

I was talking to a guy and he said to me that he has finished a DSA book thrice(fcking thrice) and solved same 500 problems thrice. That's how he mastered programming. Now he is able to solve any kinds of new programming problems He has built a game engine and physics engine of his own.

That too in c++.

I liked how honest he was about his journey. Most people seem to be telling "well I am just good at it..." and trying to hide their hard works.

What's your secret sauce?

57 comments

order
[+] butt___hugger|3 years ago|reply
Reading that book a million times won't make you a master programmer. Reading it a few times will make you an intermediate (i.e. not a novice) programmer. But you become a master by solving many different problems many different ways, as opposed to solving the same problem the same way over and over.

I consider myself a master programmer because I have seen so many problems and solutions that there isn't a 1:1 connection between them. A diversity of problems and solutions means that you will see what underlying principles are common or contrasted between each approach. Then you can apply those basic axioms to make your own algorithms that are custom-suited to each problem.

I think a master programmer should have knowledge of the following areas:

- Something like Python (primarily dynamic types, primarily imperative)

- Something like Haskell (static types, purely functional)

- Something like Scheme (dynamic types, minimalism, lambda calculus)

- Something like Rust (static types, imperative, lower-level)

- Something like Prolog (logic programming, constraint-based)

- Something like Forth (stack and concatenative programming)

I would compare this to learning to be a chef. You can learn a lot of recipes from the best cookbook, but that just means you can cook a meal. To be an expert, you understand each component of the recipe and can mix-and-match, create substitutions, to create exactly what you want.

[+] ipnon|3 years ago|reply
First thing I thought after learning Haskell and Prolog was “where the hell is my enlightenment?”
[+] 29athrowaway|3 years ago|reply
I recommend Rust as a day to day language, but for learning, I don't think Rust exposes you enough to the low level.
[+] JohnFen|3 years ago|reply
What do you mean by "master"?

I'm quite skilled, but I have a whole lot more to learn. I think that's true of every expert programmer I've ever gotten to know.

I've been programming professionally for 30 years or so now, so the basic honest answer of how I gained the skills I have is that I've just done it a whole lot.

But I think that leaves out too much. I truly love programming and computers, and am curious about everything related. I would not be doing it any less if I weren't being paid for it (and, in fact, I have never stopped programming recreationally).

So I've spent countless hours studying, reading, experimenting, and just generally doing, because all of that was play, not effort.

When people ask me how to learn to program well, my answer is basically "just start programming". Pick a language, it doesn't matter which, and start. Branch out from there, learn other languages (especially ones that use different paradigms -- learn object-oriented programming, learn procedural programming, learn parallel programming, etc. Once you have learned how to work in a given paradigm, the difference between the languages in it becomes mostly a matter of syntax, and so they're easier to pick up).

Read constantly, and a wide variety of authors. Read programming-related things that are unrelated to the stuff you're currently interested in. Read other programmer's code. When you see something cool, take the time to look over how they did it -- even if it's in a language you haven't learned. You'll understand more than you expect.

Be a generalist. You'll probably have a favorite language, a favorite type of programming, a favorite type of problem, and so forth. Make yourself tinker with the stuff that isn't your favorite, and especially the stuff that is new. Even if you never do more than tinker, you'll learn new things and approaches that will improve the skills you've already honed.

Avoid ruts. Avoid doing the same thing over and over.

And realize that all programming is essentially an exercise in complexity management.

[+] btschaegg|3 years ago|reply
You've put most of my thoughts into words more eloquently than I would have :)

If I'd add another point, I'd say that many skills of a good programmer don't necessarily relate to programming itself -- even still on the technical side.

> And realize that all programming is essentially an exercise in complexity management.

I think this gives us a hint at this. If we're building more and more complex systems to solve problems (and that's what our job is, not producing compiling code!), there's also tremendous value in reasoning and extrapolation skills that allow us to "mentally leap into the future".

In his first session of "Beyond the Goal", E. Goldratt elaborates on four questions he insists one must ask about new technologies:

  - What is its main power?
  - What limitation does it diminish?
  - What are the old rules that accomodate that limitation (and should thus be abolished)?
  - What should we do instead?
Along those lines, often we're given a problem and an existing system; and the best thing to do is just to identify why there is a problem (the limitation) and what (ideally simple) steps we can take to get rid of it. So less thinking along the lines of "add another form/button/algorithm/yaml file" and more "hang on, this problem just goes away if I correct some preconceived notion we just inherited without introspection".

Edit: I have encountered situations where the last bit resulted in me mostly getting rid of code (and complexity) instead of adding more to a project.

[+] zwkrt|3 years ago|reply
If someone told me that they worked through a whole data structures and algorithms book I would be impressed but I would not be under the impression that they had 'mastered programming' in the sense that I would not be comfortable working with them. I would rather work with someone who has large gaps in their knowledge but is curious and motivated.

I 'mastered' programming by your definition by having a 2 year long internship at a hardware company where I was asked to make a website, write code that interfaced with non-standard networking protocols, and automate the company's garden. I had a whole lot of help from some graduate students that were there working on hardware design and were kind enough to answer the 1000 questions I had.

[+] hinkley|3 years ago|reply
I have mentioned before that I worked as a bike mechanic in college. I came into it able to do my own repairs, and even build a few wheels. But there's a difference between being able to complete a task and being able to complete a task for money. I had to get a lot faster than I would have been at my own workbench, and even then I wasn't really fast enough to be the 'typical college student working in a bike shop'. What I was was thorough when I needed to be, so they put me on fixing returned repairs (nobody wants a customer to come back for a third time) and on Hail Mary wheel repairs, because I knew a few tricks that only the most senior folks knew, but the hourly rates didn't math out.

What I've learned from years of rubbing elbows with other skilled labor is that there's nothing special about bikes or software. It's all the same sort of problem all over. Intellectually understanding a problem is not knowing it in your bones. It's not acting on reflex and intuition without having to exhaust yourself thinking about what to do next.

[+] Kranar|3 years ago|reply
This is so weird. Someone self-studies a pretty challenging book on data structures and algorithms and you don't think that makes them curious and motivated to the point that you'd not feel comfortable working with them?

What do you consider to be curiosity and motivation if not someone taking the time and effort to work through something like on their own? The way someone smiles?

I feel like too many people in this profession put down the hard work and effort people go through to study this kind of stuff, as if there's some kind of insecurity towards those who know data structures and algorithms, are good at leetcode, have side projects.

It's like all that matters to people is whether someone comes across as a nice guy they'd like to have a beer with and talks nicely.

[+] vba616|3 years ago|reply
Can you elaborate on what it is that causes you to judge someone as incurious and unmotivated?

The fact that I did not learn data structures & algorithms 101 well enough to pass a FAANG quiz means I would probably have self-identified as less motivated than many people.

[+] airbreather|3 years ago|reply
Programming isn't really the problem, most of the time.

Understanding the problem at hand such that it can be broken down into smaller and smaller chunks is really the problem.

After that it is refinements for robustness, maintainability, speed, size and so on, depending on the application, platform, language and approach.

The mastery defines the difference between a workable solution and an elegant solution.

[+] riknos314|3 years ago|reply
Mastery is not a binary state.

Either you have the skills to solve the problem at hand in a satisfactory way or you don't - but where exactly that line is is different for every problem.

One can display mastery over one set of problems and simultaneously have no mastery over another - maybe you know everything that can possibly be done using a tree data structure, but have never even heard of a bitmap.

Don't worry about "mastering programming" but rather worry about having sufficient knowledge of the right tools to solve the problem you need to solve.

[+] quanticle|3 years ago|reply
There's a saying: "There's a big difference between ten years of experience, and one year of experience repeated ten times."

Someone who's just repeated solving the same problems over and over again, has the latter, especially if they've only done it in a single language.

[+] rqtwteye|3 years ago|reply
Not necessarily. You can solve the same problems over and over again, but do better every time. No need to change language. Just improve every time.
[+] stevefan1999|3 years ago|reply
Having been introduced to programming since Grade 5, I would strong recommend you say you would never master it. There are new things everyday for you to learn, so while you could be "high-handed", trying to call yourself "master" makes me feel like you are a con artist
[+] Cerium|3 years ago|reply
Agreed, master is a title for those you respect and not for yourself.
[+] yCombLinks|3 years ago|reply
Data structures are only a very tiny part of programming, and all of the core data structures are already available in libraries with highly optimized implementations. This says nothing about the ability to structure large programs, or even interpret the purpose / needs of a program.
[+] 29athrowaway|3 years ago|reply
You still need to know when and how to use them.
[+] thecodrr|3 years ago|reply
I think one question eludes everyone and I have often felt that the whole tech space just kind of skipped past it. What constitutes a master programmer?

Once I thought that there's no mastery in programming. That you just learn and kept of learning until you were ashes and bones. But that isn't true just as it isn't true for chefs, blacksmiths, painters, and other artists. If they have a certain standard where a practitioner becomes a "master" then so should programming.

I don't have a lot of experience/knowledge of how masters in other areas are judged but I see one common theme:

If you give a piece of rusted metal to a novice blacksmith, he wouldn't know what to do with it. Or even if he works it, it won't be something to be proud of. Give the same piece to a master and you won't believe what he makes of it.

Similarly, give an egg and some onions to a master chef and see what magic he brings.

Sure, knowledge about the trade matters and years of experience as well but if you strip all of that away, you'll see this steady confidence to be able to do anything (not bravado or foolhardiness) in their trade regardless of the resources and tools.

If we translate that to programming, we slowly realize that the toughest programmers are ones who can solve problems at every level, in any environment, under any condition. I am not saying that they are happy doing it (just as a blacksmith won't be happy working with rusty metal) but that they have the ability to just make things work and work in a good way.

All that may be very vague since its all just theory and I am basically thinking out loud but in these times when every one has the same access to the same information, I don't think it'd be a fair criteria to judge based on how many books you have read.

There's so much to be said on this to better classify the "mastery" of programming. In my opinion, masters of the trade are always rare. There are many who are close to this level of expertise but only a few you reach and surpass it.

Note: As I said, I am thinking out loud. I could be wrong and if so, feel free to point that out.

[+] bitwize|3 years ago|reply
I haven't mastered the art of programming, and I've been programming for 40 years!

"Mastery" eludes most of us because programming has a very, very high skill ceiling. No matter how good you get in one aspect, there are other aspects that you still have a long way to go in before you get proficient.

Don't worry about mastery. Leave that to Knuth and John Carmack. Get good enough to build that thing you want, and then see how you can build it better (or a more complex thing). If you were meant to be a master, mastery will come if you follow the path, and you may not even know it when it does.

[+] ipaddr|3 years ago|reply
You want to be a great writer..write. A great programmer write. A great song writer? Write.

Start with a quest and use tutorials along the way if necessary. At some point those tutorials get in the way, drop them then.

Your first movie is going to be horrible. Your first game will be. Keep at it, make it better and better. Learn how others approach parts of games like you and understand how to apply them to your situation. At some point you will invest new ways.. share those, learn from feedback.

A game either starts with an epic idea and a struggle to create that vision or a cool hook that a game is built around.

[+] 29athrowaway|3 years ago|reply
But if you only write in isolation, not publishing, and not reading what others write, your writing may be below average.
[+] norwayjose|3 years ago|reply
I've been programming professionally for 40 years but don't consider myself a master. I think the term is overused and applies best to people such as Ken Thompson, John Carmack, and Michael Abrash. I'd also use it for a handful of really bright people I've worked with over the years.

As others here have said, the key to being good at anything is to do it often. While it's useful to be able to solve problems on a whiteboard during an interview, during a long career you'll probably be asked to work on many problems which are new to you. Researching new protocols, architectures, software libraries, and peripheral chips may be required. Figuring out how to debug problems in new environments can be essential as well.

I'm an embedded firmware engineer and feel fortunate that I continue to find my job fascinating. I do lots of technical reading to keep up with the field. In addition to the documentation for the chips and tools we use, I read quite a few technical blogs via an RSS reader. I also follow a number of technical subreddits.

I've signed up for developer accounts at the manufacturers of chips we use. One of them has partnered with a company which provides free webinars as well as more extensive in-person training. While it can be challenging to get your company to pay for training, few will object to you taking a free webinar during your lunch hour.

[+] 29athrowaway|3 years ago|reply
If I asked you, "how do you master the art of communication?". Naturally, the answer would be another question: "Communicating what?"

What you consider "effective" will vary depending on context. Think about how these different occupations use language: comedians, politicians, songwriters, novelists, sports commentators, science communicators, cattle auctioneers, therapists, salesmen, corporate executives, lawyers, physicians...

Being an effective dark humor comedian won't necessarily make you an effective doctor, and may likely even cause you to lose your job or even your license if you communicate in the same way.

Likewise, think about how different fields approach programming: operating systems, device drivers, compilers, cryptography, compression, networking, cryptocurrency, web development, scientific simulations, embedded systems, math software, theorem provers, games, signal processing, machine learning, artificial intelligence, information retrieval, robotics, etc.

If you are effective developing firmware for pacemakers or insulin pumps, and then they move you to a startup and ask you to develop using JavaScript, HTML and CSS as fast as possible (or viceversa), that may not go well for you.

Domain knowledge, expectations of your role, what's considered "best practices" and development processes differ between fields.

[+] 78666cdc|3 years ago|reply
I echo others here in the sense that “mastering programming” is not well defined. It’s interesting to try to define what that might be though. For example, I know people who would qualify as “master Java programmers” if there ever was one, but that doesn’t make them “master programmers”.

I think that in my life I have met one person that I would call a master programmer. He was intimately familiar with C, C++, Java, Erlang, Perl, APL, Ruby, Python, Prolog, Haskell, Scala, and more. You could probably find a person that is more of an expert in any one of those, sure, but that’s beside the point. The reason this fellow qualifies as a master of programming, for me, is that he seems to have complete knowledge of where every language came from, how that influenced its semantics, what the pros and cons of each language’s design are, and could code more or less idiomatically in any one of all those languages and explain why it was idiomatic.

Based on that, I’d say that if there is such a thing as a “master programmer”, it’s probably someone so well versed in computational theory and language design that picking up a new language is just a fun afternoon.

I am sure others will have different viewpoints. This is my two cents.

[+] JohnFen|3 years ago|reply
"A master is one who transcends languages"? That sounds like a reasonable definition to me.
[+] analog31|3 years ago|reply
Well, I qualify by your definition. I just did a lot of it, starting sometime around 1981. I wasn't trying to learn programming per se, but actually trying to solve problems with it.

What I suggest is find some other interest that forces you to program. That way, the problems come from the subject matter, and you can't avoid the things that are hard. My interests were math, science, and electronics.

[+] Leftium|3 years ago|reply
I just made https://m.leftium.com in a few hours yesterday; imagined it the night before.

I think I just started with a natural knack for it. So it was fun to do, which resulted in a virtuous cycle of more practice which became more fun.

Compare to several classmates who wanted to major in CS just because it opened up doors to high paying jobs (right before tech bubble burst). They were not interested in programming itself. So they found it very difficult and many gave up.

By "natural knack," I mean I can decompose problems into smaller problems, imagine how things will work (especially what could go bad), and build bigger thngs from smaller units (like Legos).

At first, I didn't understand how the internals of the computer worked, but this understanding really helped later. Especially for languages like C.

[+] JohnFen|3 years ago|reply
It's wonderful how in all of these comments from different experts in our craft, there really is a large overlap in what we are all saying. So I'll add this advice to the pile: read what everyone is saying here, notice the common threads, and take those closest to heart.
[+] garyfirestorm|3 years ago|reply
Ah... the legend of a 100x engineer who can vomit any code at any time and build products overnight and solve any problem instantly without looking it up because he has 'mastered' the art of programming. Which one of you is this? What is your secret?
[+] mkyousayit|3 years ago|reply
I have tried and failed to read multiple programming books. Just cannot do it. That said, I proficiently code in Java, python, c++, c#, rust, javascript and then some for over 12 years.

Stop reading and start coding. Your brain literally grows when you make mistakes. Cant make mistakes if all you doing is reading.

[+] swayvil|3 years ago|reply
I used to hack up freeware games written in basic, to the point of destruction. And video and sound art. That's been my focus ever since, codewise.

I was drawn forward into mastery by my pleasure. I like code, glitchy crashes and trippy stuff.

It's easy to become a master of X when you like X.

So step 1 is to like X.