Live data from Hacker News

Ask HN: Tips to become a great programmer

news.ycombinator.com

31–40 of 41 posts

Re: Ask HN: Tips to become a great programmer

#31
post #2

Writing too much code can make you a worse programmer. The real way to get better is to pick an area of study and research the shit out of it, even non-technical aspects if applicable. Go back as far as you can and read every canonical book you can find on the subject. Even if it's outdated information, it will help you see how we arrived where we are now (as long as it's not a purely technical reference). Read those…

I disagree with this. I read every software engineering book I could get my hands on when I was in school - GoF, Refactoring, SICP, Pragmatic Programmer, XP Explained, Implementation of Functional Programming Languages, TAPL, Basic Category Theory, On Lisp, Art of the Metaobject Protocol, numerous textbooks I wasn't assigned. As a result, my code ended up overcomplicated, with a bunch of cool algorithms, a lot of OO…

I was having a similar discussion with a friend of mine.

When I was a teenager, I wrote small C projects, then I discovered the world of OS development and set myself to write a minimal operating system from scratch. It was an amazing experience, with a lot of head-scratching, hours spent debugging weird hardware issues, reading other people's code and just churning out badly engineered (but working) code.

Now, 10 years after, after playing with Haskell, OCaml, Scheme, learning about best practices, variants, typeclasses, static vs dynamic typing and data structures, every time I set myself to write something more than 100 lines I just get stuck: which language is best for the job? How should I refactor this to be more clear and concise?

My programming life definitely got worse (as a C/Python programmer) after I discovered variants and the Option/Either monads.

As I said to him, ignorance is bliss.

Re: Ask HN: Tips to become a great programmer

#32

Code Complete: A Practical Handbook for Software Construction is considered one of the language agnostic classics on computer programming. It focuses on higher level concepts as they relate to the process and sequence of writing code. It covers just enough architecture and design to provide context and allow one to think intelligently about it. [affiliate link] http://www.amazon.com/gp/product/0735619670/ref=as_li_tl…

I would highly recommend this as well. BUT - don't try to dive too much deeper into code patterns. The last decade has a massive spike in patterns and I can remember a lot of meetings wasted debating patterns.

Re: Ask HN: Tips to become a great programmer

#33
You've taken the most IMPORTANT step already - You care about programming. Keep this up. Join forums, read books on programming, follow programming blogs.

Next, do not fixate on languages and frameworks. Aspire to make this irrelevant to you. Great developers often can work with multiple languages and frameworks.

Be prepared and excited to learn every single day of your life as a programmer. The best programmers I know are always learning. This is an investment you will need to make regardless of work pressures and schedules. I've seen far too many developers have their skills atrophy because they've not invested in improving.

Use the Rubber Duck debugging model - http://en.wikipedia.org/wiki/Rubber_duck_debugging.

One simple way to do this is that whenever you get stuck, go to stackoverflow and start explaining the problem.

I have found my solution innumerable number of times by forcing myself to explain it to someone else with no context. It makes you confront your assumptions and understanding.

Re: Ask HN: Tips to become a great programmer

#34

There's a great presentation on the topic by Angelina Fabbro www.youtube.com/watch?v=v0TFmdO4ZP0 with matching slides http://afabbro.github.io/jsconf2013 . The title says javascript, but it's really a platform agnostic guide that sketches out what mastery looks like and lays out actionable steps to get there. Seriously, listen to the talk and/or check out the slides. But 90% won't, so here's her actionable steps: 1.…

13 is easier said than done. Maybe this is just me trying to rationalize, but it feels like if you don't have some level of impostor syndrome, it's almost hubris.

I think the trick is to shed your imposter syndrome, but remain humble. You can be confident and humble at the same time. It can come with accurate self-assesment. Keeping your weakness in mind helps a lot.

Re: Ask HN: Tips to become a great programmer

#35

Earlier quoted context omitted.

I disagree with this. I read every software engineering book I could get my hands on when I was in school - GoF, Refactoring, SICP, Pragmatic Programmer, XP Explained, Implementation of Functional Programming Languages, TAPL, Basic Category Theory, On Lisp, Art of the Metaobject Protocol, numerous textbooks I wasn't assigned. As a result, my code ended up overcomplicated, with a bunch of cool algorithms, a lot of OO…

But that's not what the post you replied to said to do. The post said to pick one area, research all of the shit right out of it, e.g., focus . Your list (and I assume it's abbreviated) is the opposite of that. I agree you need to code (and a lot). I disagree (vehemently) that you need to fuck, then un-fuck, your code in order to progress.

Focus helps, of course. But my list (and other reading material..yes, it was abbreviated) was actually pretty focused - it specializes in programming language theory and implementation, particularly for functional programming languages.

The problem with reading a lot before coding is that you learn the knowledge ("what to do") without learning the wisdom ("when to do it). Even if you specialize in one area, there's a large body of practical knowledge that people do unconsciously when they're working on a problem, but don't think to write down in a book. Or if they do write it down in a book, you won't understand the context for it until you've been in several situaions where their advice has both worked and not worked. When I was studying this stuff in college, I read multiple books on each topic, it "clicked", I knew when to use each technique - but I didn't know when not to. As a result, my designs tended to be jam-packed with features. It takes experience to realize "Oh, metaclasses are really handy in this one situation...but most of the time, you are better off banning them because the cost in understanding your code is greater than the code simplification they give you."

Re: Ask HN: Tips to become a great programmer

#36
I have three basic tips:

1) Find problems first, then solve them. It sounds obvious, but so many programmers find solutions and then go look for a problem. That's backwards. Problems, then solutions.

2) Test your solutions as much as you can. Does it actually solve the problem? Is it too slow? Is it confusing or cumbersome? Nine times out of ten, it's better to take an extra hour to test something than to rush it through. There are very, very, very few instances in which you legitimately do not have time to test. For all practical purposes, you ALWAYS have time -- you just aren't making it a priority if you don't test. Make it one. It's far more important to deliver solid code that works than it is to be the first one to submit your code.

3) Don't reinvent the wheel. Stand upon the shoulders of giants. Use what others have done and get ahead. There are two major exceptions to this tip, imo: 1) if you're reinventing it as a learning exercise, or b) you are absolutely, positively, 100% convinced you can bring something new to the table.

Also, just for kicks: tabs, not spaces. runs away

Re: Ask HN: Tips to become a great programmer

#37

Earlier quoted context omitted.

I disagree with this. I read every software engineering book I could get my hands on when I was in school - GoF, Refactoring, SICP, Pragmatic Programmer, XP Explained, Implementation of Functional Programming Languages, TAPL, Basic Category Theory, On Lisp, Art of the Metaobject Protocol, numerous textbooks I wasn't assigned. As a result, my code ended up overcomplicated, with a bunch of cool algorithms, a lot of OO…

I was having a similar discussion with a friend of mine. When I was a teenager, I wrote small C projects, then I discovered the world of OS development and set myself to write a minimal operating system from scratch. It was an amazing experience, with a lot of head-scratching, hours spent debugging weird hardware issues, reading other people's code and just churning out badly engineered (but working) code. Now, 10 ye…

It does get better - write a lot of code with the new language features and you'll get a sense when they're not useful, or how you can apply them to more mundane languages. You can define a decorator in Python to do Maybe monads, for example:

  def maybe(decorated):
    def worker(*args):
      if any(arg is None for arg in args):
        return None
      return decorated(*args)
    # Standard decorator machinery
    return worker
(This doesn't mean you should; this usage is pretty non-idiomatic and will do strange things in edge-cases. That's my point though...the only way to figure out when it's worth it is to try it out in a few situations and determine when it makes the code simpler.)

Re: Ask HN: Tips to become a great programmer

#38
You need someone more experienced than you who can read your code (and look at your architecture). They will say things you don't want to hear. Listen anyway, and try to pick up where they're coming from.

Programming well requires judgment and taste. It takes years to develop these well (at least, it did for me), but it helps to have people who have more than you explain why they wouldn't have made the same choices you did.

(Note well: Not everyone with more experience than you has better judgment. You need someone with good coding judgment, not just someone older.)

Re: Ask HN: Tips to become a great programmer

#39
Experience.

A lot of being a good programmer doesn't have to do with technical skills.

Take a compilers course. This was required at my school and I figured it would be boring (I mostly likely the theory classes). I was wrong! Writing a compiler really made me understand what they do. I had seen a lot of people who were trying to appease the compiler. Instead, the compiler is now my slave.

Re: Ask HN: Tips to become a great programmer

#40

You've taken the most IMPORTANT step already - You care about programming. Keep this up. Join forums, read books on programming, follow programming blogs. Next, do not fixate on languages and frameworks. Aspire to make this irrelevant to you. Great developers often can work with multiple languages and frameworks. Be prepared and excited to learn every single day of your life as a programmer. The best programmers I kn…

+1 Rubber Duck
Post reply on HN