I could say my principle language is C++ which I have a love-hate relationship with it. I love how you can write very efficient code with C++. I dislike it’s complexity. It’s an easy language to shoot yourself in foot with. You really have to work hard to stop your team from using every feature in the language. Template meta programming is a great way to transform time and money into nothing. I tend to advocate what I call C+ programming which is cutting things down to a very limited subset of the language. That tends to grate with experienced C++ programmers who tend to love to show their mastery of every part of the language.
Sadly I would say C++ is not suited for most commercial development. It’s good in that it’s an open standard language and supported in many environments.
I’ve done a lot of Delphi development since the entire Chameleon GUI was written in it. It’s a pain though that it’s now stuck in 32 bit form of a declining platform, WIN32. For its time Delphi was impressive. It’s still one of the fastest strongly typed language compilers I know of. Its biggest drawback is it’s owned by one company.
I’ve done a smattering of C# and Java since we needed to implement stub code support for them from Chameleon.
Lua on the hand has had a long time to be carefully honed and refined over time. It’s surprisingly widely used in applications where performance and having a small memory footprint is important. Lua is about the most simple a dynamic language could be without losing it’s power. I’ll have more to say about it later.
In general at this point in my career I think you could program ‘good’ code in just about anything. For me good code is about keeping things simple, modular and decoupled. I try to use as few features of the language as I need to. The most challenging part of programming is always to get a good understanding of the domain problem.
I had a programmer called Randy that I think put it very well. (he was complaining about some awful code we had in Chameleon back in 2007). The way he put it:
In the early part of my career I wrote simple code because that was all I knew how to write. When I got more experienced I wrote complex code. Then I went back to writing simple code not because I didn’t know how to write complicated code but for the reason it is much easier to maintain and use.
Although I didn’t appreciate the message at the time (it was the code I earned my living from) he was absolutely right. It makes total sense to avoid getting fancy with code more than you need to and keep things simple and dumb. That way you can debug it more easily, other people can understand it and you yourself can understand it when you come back to it in six months time.
It’s actually A-okay to write a few more lines of simple linear code than to try and it it using more clever code. It’s just a matter of giving yourself permission to do so.