How to become a better programmer?

I was wondering if anyone can give me (a CS major in college) some advice on how to improve my programming abilities. I know for a fact that as a programmer/software engineer, i must become a better problem solver and become more familiar with different programming languages, but i need some advice on doing just that.

any advice will be appreciated

(as of right now, i am trying to solve some coding challenges on hacker rank, do you think this is a good start?)
As with many other things, the only way to get good at programming is to do it a lot. A university course can teach you new algorithms or techniques, but no one can teach how to program well. At best, one can point at a piece of code and say "this is good programming" or "this is bad programming"

Knowing many programming languages is not critical, IMO. If your experience is diverse among several problem domains you'll likely pick up different languages according to the situation, and you'll also have a wider toolset to approach problems. Just knowing many different programming languages won't do the same.
In other words, good programmers may know several programming languages, but not everyone who knows several programming languages is good.
I always feel pretentious answering stuff like this. I'll give it a shot anyways.

become more familiar with different programming languages

Too many people learn Java then C++ then C#; all of these languages are very roughly the same.
These languages mostly encourage the same kind of procedural and vaguely object-oriented thinking.

This is no good. You will find the most significant and immediate benefit from correctly learning tools which encourage entirely different approaches to problems. To this end, you should strongly prefer to learn the most varied languages you can.

When asked for suggestions, I usually respond with these 5 or so items. I intend that specific languages should be taken categorically, not as specific recommendations.

- C++ or any applications language;
- Common Lisp or Scheme or any DSL-focused macro language;
- Haskell or ML or any pure-functional language with a focus on type theory;
- Python or Perl or any scripting language;
- Some assembler dialect

Other interesting languages include Forth, which is different enough to learn (it's a fascinating stack-based language), and APL, which is a ("matrix-based" language). I know Forth, but I can't find a free APL implementation to play with. This is a shame, because this advice in fact is credited to Kenneth Iverson, who created it.

You can read the paper:
http://www.jsoftware.com/papers/tot.htm
Last edited on
Oh, these are good tips and an article!
mbozzi wrote:
I can't find a free APL implementation to play with.

Modern APL descendants (A+, K, Q) happen to be non-free which adds to the already high barrier to entry, but there's always J to play with.. and to solve programming competitions in the shortest amount of code.

PS: speaking of programming languages to broaden the understanding of programming, don't forget Prolog
Last edited on
yes

Prolog's an important one. Maybe it should replace Python or Perl or maybe even assembler. On the other hand, I think it's important to have those on the list.
Last edited on
While you're at it, it might be beneficial to pick up a query language. While it might not provide the same benefits as any other language suggested here, it can help in thinking about how to organize data.
Topic archived. No new replies allowed.