I have been programming for a long time now. I have learnt many languages, and am even having a crack at designing one. This page collects my thoughts on languages, general programming practices, and specific hints for working with a few languages that I have a lot of experience with.
I am a great believer in getting the compiler to do as much work for you as possible. I always enable as many warnings as I can and I much prefer static typing over dynamic typing. I try to always unit-test my code, and generally provide lots of tests. I find that writing my tests at the same time is the best approach; sometimes the tests inform the structure or specification of the code, and sometimes writing the code makes me realise that the expected behaviour I wrote in the tests is wrong.
Haskell is a wonderful, statically typed functional language. The functional aspect is complemented by monads, which are a nice way (once you have got your head round them) of sequencing operations for things like I/O, or carrying around state. I find writing Haskell code fun; I seem to spend a lot more time writing code, and less time fussing over awkward aspects of the language. Here are my tips for Haskell:
C++ is an oft-misunderstood language. It is often thought of as either "C with classes" or "Java with bloat". My opinion is that it is a language that takes a very long time to master, but it is a powerful language that supports all sorts of different programming styles: OOP, functional, imperative, procedural, meta-programming and probably more besides. One problem is that (either because of their background, or because they need interoperability) programmers often write C++ in a C style. The best way to write C++ is making full use of the STL and Boost libraries, with all the power of classes and templating. I aim for my C++CSP2 library to follow this advice. In my opinion, problems with C++ are:
This is a quick run-through of languages and things I do and don't like about them: