02 December 2006

Programming Languages Analyzed

Since I'm not too keen on selecting or generating a product idea, I'll start my analysis a little backwards. A couple of days ago I talked about having a barrier to entry and I think I found a good one. Today, I'll try to analyze the programming languages I know in the context of selling a product written in that language.

The most important point of the language should be easy-to-use. That should help me concentrate on the business problems and not on problems like memory management or lack of libraries that I need. One thing to note about the libraries is that they should be commercially friendly, so no GPL licensed libraries (LGPL is okay) or non-royalty-free libraries would be considered. The second most important point should be speed. Since my barrier to entry is neural networks and evolutionary algorithms, speed is quite important because these kind of things are computationally intensive. Also nice to have would be small-size. I would like to NOT have to drag around a big runtime like .Net or Java, because I would have quite an unpleasant time writing the installer (installing 3rd party software can be tricky) and also would increase the download size significantly. Yet another nice thing would be portability. The ability to run on Linux and OS X should not be ignored. The last (and debatable) point of the language should be hard-to-reverse-engineer. Even if somebody will eventually crack the product and even if the people using unlicensed versions of the product would not be paying customers anyway, making it harder to crack your product should be on the list.

The C++ language fails slightly on the first criteria, since it has no garbage collection. But it has lots of nice libraries that can be used (boost etc), speed is almost unmatched, size is also good, portability can be tricky but doable and it passes the hard-to-reverse-engineer test with flying colors. Still, garbage collection is important for rapid development and C++ lacks it badly.

Java passes the first test quite well, having both garbage collection and lots of nice libraries. Also, portability is mostly taken care of, which is a nice thing. Unfortunately, speed is a little worse than C++, size is quite big, and it's easiest than most to reverse engineer, even if I use DashO (I've seen what it does and I'm not even remotely impressed, it's still easy to crack).

C# is in the same boat as Java, with less libraries (but the nice Java libraries are quickly being ported to .Net, so this should not usually be a problem). Unfortunately, it also has the exact same problems as Java: speed (faster than Java, slower than C++), size (bigger than Java) and easy-to-reverse-engineer. Hey, even the byte code obfuscator was ported for .Net. One last disadvantage of C#/.Net is that the crossplatform port is not exactly ready and stable.

Onward to more exotic places, Python looks like a nice candidate. It passes the easy-to-use test very well. Speed can in theory (and in practice) be addressed by rewriting the slow code in C++. Size overhead is much better than Java or .Net (about 5MB), and portability is also well covered. Unfortunately, decompiling it is also easy.

There are also other languages that I don't know well enough but I'd be willing to learn if they would provide a clear advantage. Ruby (with RoR) and Perl seems to be targeted at scripting and web development, which limits their applicability. They also seem to have the same advantages and suffer from the same problems as Python. Eiffel is a C++ (ok, it looks more like Pascal) with garbage collection and Design by Contract, but without the nice libraries. Lisp, Scheme, OCaml, Haskell look promising, but libraries are still hard to find and speed is sometimes not acceptable. Erlang seems to be optimized for concurrency, not for general software development. When I'll decide about the actual product I'll develop, I'll have to take another look at these last languages and see if they provide any decisive advantage, otherwise I'll use what I know best. The shortest path is the one that you already know.

2 comments:

Anonymous said...

I'm a web programmer, which means I work with Php and don't do any desktop programming because of exactly the factors you mention.

But if I was going to do a desktop product, I would look into delphi. I haven't tried it, but I've heard its easy to learn, hard to crack, no runtime libraries, etc.

Also consider doing a web app instead of a desktop based product if you don't want to deal with all of that garbage ;)

Costin said...

Delphi would be interesting to consider. I haven't programmed in Pascal in the last 10 years, but I'm willing to relearn it. The problem that I see is that it doesn't have automatic memory management and it's not portable. Still, it should be included in the "other" languages category. I'll write another article about web applications, their advantages and disadvantages.