Huh, your comment makes me wonder if I should look for contract work doing C++ development. I haven't done it seriously since the last millennium, and basically I've learned to program since then [0], but I know all the stuff you're talking about cold. (Except mutable, which took me a few seconds to remember, and then I looked it up to be sure.)
It's just that I feel like higher-level languages like Ruby, Python, or JS are so much more productive for most things, most of the time, despite things like Rachelbythebay's interesting set of posts about hacking together stuff in C++ [1].
But, aside from things like that, I guess there are some domains where C++ is a viable option and Lua or whatever still isn't. And it sounds to me like the average quality of C++ has gone up since I was doing it, to the point that most people have read Alexandrescu and never call delete explicitly, so it might not be quite so painful?
Should I be taking advantage of being one of the Fat Guys Who Know C++? [2]
Great links. I've certainly made a habit of hanging out with those Fat Guys, though at this point I'm in Boulder, so while they still have neck beards here, they tend to be pretty thin. Though honestly we stopped playing Settlers years ago, and have moved on to games like San Juan and Dominion. ;)
To tell the truth, I have a love/hate relationship with C++. Yes, I know it really well at this point. I've learned everything I know because it (at the time) was the only tool reasonable to get the job done. Now I actually avoid using it as much as possible.
The perfect combo for me (in games) is C++ for performant code combined with tight integration with Lua. I hear you on higher-level languages being more productive, which is why most of my game code ends up written in Lua. (I'm far from alone in using this combo -- most major iOS games seem to use the same combo, as do a lot of games in general.)
Why not use one of the three you mentioned? Size and speed both.
LuaJIT is pretty much the fastest dynamic language around, and the overhead of linking into a program is tiny compared to Ruby, Python, or JavaScript. The language itself gives you advanced features like coroutines with upvalues and operator overrides, but at the same time it's super-simple -- to the point where non-programmers can use it to script behaviors.
If you're doing server code you can afford to have things be a bit slower and/or huge (relatively speaking). If you're doing games downloaded OTA on a phone, and you've got a 20Mb limit before they have to use WiFi...well, size is critical (an extra megabyte or two means a lot of assets won't fit any more) and phones are far more processor-bound than most server tasks you'd use a scripting language for. On the other hand, with distributions like OpenResty [1] that hand you an extremely fast server and LuaJIT all bound up together, allowing me to create a cheap server that can handle 3000+ requests per second without barely breaking a sweat...well, since I know Lua ANYWAY, I use it on the server as well.
YMMV. :)
Addressing what you asked: C++ development is in reasonably high demand compared to the number of Fat Guys, so it tends to pay well. Having experience in a niche can also be handy -- by virtue of knowing Android C++/NDK development I've had random people contacting me to ask if I want to work for them, with no real promotion on my part. I don't even want to say what my rate was publicly, though I will say that I expected him to turn me down when I said how much I wanted.
Android C++/NDK by itself counts as a niche? That's kind of surprising! I would have thought a profitable niche would have to be a bit more specialized by now... I guess the NDK hasn't been out all that long.
I imagine gzipped Lua bytecode would be quite a bit more compact than gzipped compiled C++; does it work out that way in real life?
OpenResty ships with LuaJIT 2.0 beta. You have to add a ./configure parameter to get it to use it, but it works well, yes.
As to bytecode...I think it probably does end up more compact than compiled C++, and it seems like it would have properties that would allow it to compress more tightly, but I don't have any numbers on that.
I tend to strip the source and compress and encrypt it; I could convert it to bytecode first, but the last time I tried that it ended up bigger than the compressed text.
>Android C++/NDK by itself counts as a niche? That's kind of surprising! I would have thought a profitable niche would have to be a bit more specialized by now... I guess the NDK hasn't been out all that long.
A lot of "Android" developers are actually Java developers who are trying to cash in on mobile. Serious game developers almost all use the NDK, but serious game developers are in high demand (myself included). So yes, NDK is itself a niche, in that the number of jobs seems to exceed the number of developers available.
On the other hand, by being able to do games in NDK I'm even better off, but just being good at NDK development is pretty powerful. Keep in mind that you also have to deal with Java and the Android stack -- you can't do everything in the NDK. So you need to be someone good at C++ who also can get around in Java.
That's really fascinating information, thanks! Who's a "serious game developer"? I'd think that things like Angry Birds and Bubble Bobble would work just about as well in Jython as in C++, but I guess they're not "serious"?
Angry Birds uses C++ and Lua. Haven't looked at Bubble Bobble.
Not saying you COULDN'T write games in other languages. MineCraft is written in Java, for instance. But my statement still predominantly holds true: Most serious game developers use C++, and many use Lua.
For some definitions of serious, anyway. I guess I mean "ones that have been doing it for any length of time professionally." Or maybe I just mean "almost every one I know." Something like that anyway.
It's just that I feel like higher-level languages like Ruby, Python, or JS are so much more productive for most things, most of the time, despite things like Rachelbythebay's interesting set of posts about hacking together stuff in C++ [1].
But, aside from things like that, I guess there are some domains where C++ is a viable option and Lua or whatever still isn't. And it sounds to me like the average quality of C++ has gone up since I was doing it, to the point that most people have read Alexandrescu and never call delete explicitly, so it might not be quite so painful?
Should I be taking advantage of being one of the Fat Guys Who Know C++? [2]
[0]: http://lists.canonical.org/pipermail/kragen-tol/2007-March/0... [1]: http://rachelbythebay.com/w/2012/01/14/blort/ [2]: http://medriscoll.com/post/9117396231/the-guild-of-silicon-v...