What languages are good for Windows apps?
May 31, 2008 1:10 PM   Subscribe

What programming languages are good for writing a standalone shareware program for Windows? Specifics inside.

Some things that I'd like:

A. I don't want to tackle a learning curve on an obselete or soon-to-be-obsolete language. There's Delphi but its future seems uncertain and I hear a lot of people pining for the old versions.

B. Compiler/interpreter should be reasonably fast, as I intend to code some heavy processing functions. Unless VB has changed in the past several years, it's out.

C. I need to keep the source code private (so Python and PHP are out). This is a must. Also I don't want the code easily decompilable.

D. I'd like it to not be so obscure that I can't find decent help on the Web nor find any Rentacoder coders to help (I'm looking at you, Lazarus).

E. I'd like to produce easy ports to Mac and possibly Linux, but this is not a big deal.

So what should I be looking at? I guess .NET is a possibility but this goes diametrically opposite to my desire to ultimately have some portability to another OS. There's also Java but I can't recall if it allows private source code, and I always equate Java with 45-second JVM load times; if I have to deal with a sluggish JVM, forget it.
posted by crapmatic to Computers & Internet (16 answers total) 4 users marked this as a favorite
 
Um, for what it's worth, you can still keep source code private with PHP. You can't, however, use it for a standalone app. (Just because the language itself is open source doesn't mean the code you write in said language is.)

C# is probably what you're looking for. Other, smarter people will be commenting to some effect, I imagine. Portability is a problem, though.

Java is platform agnostic but can still be relatively slow. It is pretty damn powerful, though, and flexible to the utmost. You're probably best off with that, since it's cross-platform capable and because you can even run your app inline in a web browser if you so choose.

Again, ALL applications that are compiled "allow" to some degree, the "privatization" of source code. There are different ways to obfuscate/encrypt the compiled source code/to make decompiling considerably more difficult/less successful.
posted by disillusioned at 1:17 PM on May 31, 2008


I'd recommend C++ with Qt for the GUI for portability. Microsoft has their 'express' IDE's available for free, and if non-commercial Qt4 for Windows is free as well. There's a bit of fanagaling to get them to work together, but once worked-out it might suit your needs.
posted by hungrysquirrels at 1:18 PM on May 31, 2008


Adobe's AIR will compile the same exact code to Windows and Mac apps. Linux support is either already here or coming soon.

The same code can also be used for both a browser-based (flash player) and desktop app. If you are familiar with Java, you are pretty close to knowing Actionscript 3.

I'm not sure if it's possible to decompile AIR apps in any meaningful way, although SWF decompilers definitely exist.

Info and examples here
posted by drjimmy11 at 1:37 PM on May 31, 2008


I was just going to say C++ with Qt. I do all my development on Linux, but I have encountered anything but minor issues with porting things to OS X and Windows. There is a ton of documentation online, and a great online manual.

The only issue is that if you want to sell your software, you will have to buy the commercial license for Qt. However, that gets you even more support.
posted by Loto at 1:38 PM on May 31, 2008


Actionscript obsfucator here
posted by drjimmy11 at 1:41 PM on May 31, 2008


As has been said of musicians and book authors: Your biggest problem is obscurity, not piracy. I say you should worry less about people reading your source code, and more about what the best tool will be to get the job done so people will be happy enough to pay for it.
posted by cmiller at 2:26 PM on May 31, 2008


My vote is also on the C++ with Qt. I haven't worked with Air/Flex myself but my instincts tell me that they'd not be so hard to decompile. In fact, didn't Adobe just announce that they are documenting all SWF? So I'd definitely not rely on that.

As for obfuscators; they are really more useful for keeping the script kiddies away. If it can be obfuscated by keeping the code in tact, it can be deobfuscated. And it's not a elegant solution either.

Java keeps the source code probably less obscure than other things; it turns them into bytecode which is somewhere in between text and binary. But then it's the same with .NET, it also turns your code into bytecode.

You know, I'm not a software engineer so it might all be a little fudged but you want portability, gentle learning curve and common enough language but then you want your code to be very closed. It's hard to get all of those at the same time. I admittedly do not know your circumstances but keeping something closed source by no means equals commercial success or security. If your software becomes popular enough, someone will write an open-source version at one point. And security by obscurity is a dangerous gamble to play.

And you also talk about getting help from outside; that's hard to do with a closed source project. And even if you do get people to help you, each person helping you is a potential security issue, especially if you are going to find people from rentacoder and such.
posted by the_dude at 2:30 PM on May 31, 2008


I don't want to tackle a learning curve on an obselete or soon-to-be-obsolete language. There's Delphi...

Some people might disagree with me but I think Delphi's time has passed. It was always kind of a niche language to begin with, and from what I can tell most people have moved on.

Compiler/interpreter should be reasonably fast, as I intend to code some heavy processing functions. Unless VB has changed in the past several years, it's out.

Actually, VB has changed a lot! VB.NET has been around for a long time, and it's basically C# with a different syntax. With that said, I would suggest using C# over VB.NET, because VB.NET syntax is not that great. In fact, I would suggest C# as the best general purpose programming language for Windows today.

I need to keep the source code private (so Python and PHP are out). This is a must. Also I don't want the code easily decompilable.

I'm not a Python expert, but I think there are ways of compiling Python programs into bytecode. There are also ways of packaging a Python interpreter along with your app.

I guess .NET is a possibility but this goes diametrically opposite to my desire to ultimately have some portability to another OS.

You can get portability with Mono. It is basically a cross-platform alternative to Microsoft's .NET platform.

There's also Java but I can't recall if it allows private source code, and I always equate Java with 45-second JVM load times; if I have to deal with a sluggish JVM, forget it.


The annoyingness of the JVM is the biggest strike against Java in my opinion. Other than that it is a fine programming language.

I'd like to produce easy ports to Mac and possibly Linux, but this is not a big deal.

Easy ports. Ha! Try writing any non-trivial app (even in Java) that works identically on Windows, Mac OS and Linux. It always takes a decent amount of work. With that said, your best bets for easy-ish portability will probably be Java, .NET (through Mono), Python or C++. I would also suggest using the excellent WxWidgets library to make each version behave like a native app on each platform.

Also, from an ex-shareware developer, here are some tips on shareware in general:

Don't get too caught up in trying to prevent people from cracking your registration scheme. Hackers and people who download warez do not buy shareware. Nobody is going to say "Darn, I can't find a crack for this app, I guess I'll send in the $20". Also, in my experience the only apps that don't get cracked are the ones that nobody even bothers to try cracking.

Don't worry about finding the perfect programming language that works on all platforms and whatnot. In my experience, about 5% of the total effort that goes into a shareware program is the initial coding part. About 10% goes into fixing bugs and adding new features. About 20% goes into providing support to your customers (many of whom will ask the same questions over and over again, even if you answer them in the FAQ and in the readme file and all of the website). The other 65% goes into getting your app listed everywhere, trying to get it reviewed, and doing whatever else you can to convince people to even try it.

Really the most important advice I could give a first time shareware developer is to just write something that you think people will find useful. I like C#, put you can use whatever language you want. There's not really a wrong way to write a shareware program, if people find what you put out there useful, they will buy it.
posted by burnmp3s at 2:43 PM on May 31, 2008 [1 favorite]


I need to keep the source code private (so Python and PHP are out). This is a must. Also I don't want the code easily decompilable.

I wouldn't consider C# or Java easily decompilable. They're both byte code languages, but the output you get from some of the decompilers is absolutely horrendous. Any medium size project would probably take less time to rewrite then it would to understand the decompiled output.

You don't state what your big concern here is. Are you trying to protect unique business logic? You're far better off relying on legal protection then. You already have copyright and I think the source code (even decompiled) could be considered a trade secret.

If it's for security reasons then you're already starting off on the wrong foot. Look what hackers have already done with Microsoft's DRM. It always get broken, and that's with the MS experts reviewing all the code. Not to mention what's happened with CSS, HD DVD, and BluRay. The best cryptography protection is sound algorithms and design, not code obfuscation.
posted by sbutler at 2:46 PM on May 31, 2008


You don't state what your big concern here is. Are you trying to protect unique business logic?

Generally when you talk about "security" for a shareware app it's security against people using the registered version of the app without paying. There could be some other concern that he has for keeping the source code secret, but my guess is that's what he's talking about.

Crackers can and do break protection in pretty much any language. You could write your program in straight x86 assembly code and it wouldn't be safe. They have sophisticated methods for disabling your protection (i.e. setting your "registered" flag to true) or finding ways around it (i.e. extracting the registration code check from your app and repackaging it as a keygen).
posted by burnmp3s at 2:59 PM on May 31, 2008


I intend to code some heavy processing functions.

This shouldn't affect the language you code in. The heavy processing you will code as a C function, which you will access through your chosen language's foreign function interface.

I guess .NET is a possibility but this goes opposite to portability.

Code in C#, but dont use MS's virtual machine. Use mono instead, which is three way portable. You just have to restrict yourself to whatever is available in Mono.

I always equate Java with 45-second JVM load times.

Try Java with the GNU Compiler for Java GCJ instead. The native executables it generates load quickly.
posted by gmarceau at 3:46 PM on May 31, 2008


I don't really think keeping the source code totally secret is really that important. As others said you can obfuscate your code which will make it reasonably incomprehensible. And in fact, more incomprehensible then your binary code. Java is a byte code (rather then interpreted) language, anyway.

And that's the thing, smart people will always be able to read binary code anyway, so it's a question getting optimal obfuscation.

As far as Java's load time? 45 seconds? Come on. I'm working on a GUI Java program right now and the load time is less then a second. Even 4 or 5 years ago a straight-up console program would start in less then half a second.

Also,

Easy ports. Ha! Try writing any non-trivial app (even in Java) that works identically on Windows, Mac OS and Linux. It always takes a decent amount of work.

I don't know where exactly this idea comes from, I've written tons of complicated code in Java and never had to use anything platform specific.

If I were in your position, I would go with either C# or Java. Writing windows forms with Microsoft's form designer in Visual Studio is an absolute joy. There's nothing like it for java. I've played around with the Gui designer in NetBeans 6 and it's a pain. On the other hand, I've been playing around with GroupLayout and it actually makes laying out GUIs by hand in java very easy. It's a lot of typing, but you get complete control.
posted by delmoi at 3:47 PM on May 31, 2008


Adobe's AIR will compile the same exact code to Windows and Mac apps. Linux support is either already here or coming soon.

FWIW, there's a beta version of AIR out for linux. Used it briefly for one app, had no problems

posted by chrisamiller at 4:47 PM on May 31, 2008


I like RealBasic for my standalone apps. Speedy and cross-platform.
posted by jdfan at 4:48 PM on May 31, 2008


Seconding C# (and portability with Mono).
posted by blue_beetle at 5:05 PM on May 31, 2008


c# definitely
posted by mattoxic at 7:41 PM on May 31, 2008


« Older Swim Sense   |   Can someone track me down from my license plates? Newer »
This thread is closed to new comments.