views:

1479

answers:

8

Hi,

Faced with the challenge of a new application with which you had free reign to design, assemble a team to develop and manage:

  1. Which language/platform would you choose?
  2. Why?

Background: The desktop application will control a hardware device and perform computations, analyze and display the data returned by it.

Requirements: (importance: 10=most important)

  • will need to communicate with devices using USB and/or ethernet (9)
  • availability of engineers with relevant skills (8)
  • availability of quality IDE/tools (8)
  • cost of IDE/tools (7)
  • availability of resources, tutorials, support (9)
  • lifetime of language/API/platform/framework- ie how future-proof will the investment in this application be?... the product has a long life-cycle (10)
  • cross-platform (3)
  • richness and breadth of libraries available (9)
  • the application will need to be able to interpret a scripting language (6)
  • unit testing (9)

Assumptions:

  • For USB variants of the device, a device driver will be written in C/C++
  • Application will be a completely new endeavor - from scratch
  • Background of existing engineers is C/C++, and they have a strong OO competence. Existing engineers are willing to adopt best language/platform, and new engineers with appropriate skills will be recruited.

Shortlist (which you can add to):

  • Java/J2SE
  • C#/.NET
  • C++/wxWidgets
  • C++/QT
  • etc.

Looking forward to hearing what you think!

+2  A: 

I'd vote for C#. Even with the learning curve of moving away from C++ your developers should be more productive and the tooling and libraries are great.

The only place I see C# adding to the complexity of your project will be interfacing to your USB device, but it's fairly easy to get up to speed with P/Invoke and / C++/CLI to expose your C/C++ driver to .NET.

Jon Norton
Where is the cross-platform requirement met with C#?
paxdiablo
mono is more then advance enough to meet the cross-platform requirement
trampster
+9  A: 

My first choice would be C++

  1. "Lifetime of language"... I don't think C/C++ is going anywhere anytime soon.
  2. Support for low level communication with usb/ethernet/others
  3. You already have the knowledge/skill set in your team
  4. Lots of good quality libraries/IDEs etc. available
Jaime
+2  A: 

The desktop application will control a hardware device

C++

OscarRyz
Yeah, that's a given, but it doesn't **all** have to be in C++.
paxdiablo
@Pax: I agree, some part may be done in Python :)
OscarRyz
In a well designed system, the hardware should be well abstracted and therefore might as well be a software module . Of course, C/C++ is the natural choice for the low-level stuff - I agree.
Prembo
Voted down: Not helpful. It was already on their list and just saying "C++" without substantiation doesn't add any value.
Wayne Koorts
@Wayne: He already knew the answer. There is not need to add more "subjective and argumentative" comments. The application WILL control a HARDWARE device. There is nothing more to say here. I think he just need to hear what he already know.
OscarRyz
@Wayne, it seemed obvious to me that, because he had bolded the word "hardware", that was his justification fo C++. I wouldn't use C++ for the lot, but that's my opinion - this answer still seems helpful.
paxdiablo
Oscar and Pax: They already had C++ on their list.
Wayne Koorts
On that shortlist, @Wayne, is every language currently in an answer. Everyone gave their answer with reasons (incl. Oscar). The Q said the list *can* be added to, not "you *must* choose something else". I'm voting this up just to annoy you now :-)
paxdiablo
Pax: Your vote is your business, you have the right to vote the way you please. If you want to diminish the system by abusing votes that is your choice; there is very little to stop you.
Wayne Koorts
I don't see it as abuse any more than yours and you're right, they're my votes - this was a genuinely useful answer since it gave an answer and a rationale (a little brief for my liking, but still it's there). That's my reason for the upvote, you need to look at the smileys a little closer :-).
paxdiablo
+3  A: 

Personally, I'd opt for C++ or C (or maybe even D) for the low-level hardware interface, but then I'd wrap that code up in a nice, clean API, and I'd write all the user-facing GUI stuff in C# with WPF and XAML.

The skillset required in writing the device driver will be completely different from the skillset of the GUI developers (especially if you want to provide rich graphical charts and reports. So you're probably going to have two different teams anyhow (even if they're very small teams), and implementing the two layers in different (but compatible) languages will privide a nice mechanism for enforcing separation of concerns between those layers.

benjismith
I have to disagree with this one. Where is the cross-platform requirement met with C#?
paxdiablo
mono is more then advanced enough to meet the cross-platform requirement with c# provided you used winforms or Gtk# instead of WPF
trampster
The cross-platform requirement has the lowest priority of all the items on the list. In fact, with a priority of "3", it clocks in at only half as its neighbor "scripting language support". In my opinion, the strengths of the C#/WPF/XAML approach constitute a worthy trade-off.
benjismith
+5  A: 

To be honest, I'd choose Java (with a small component of C) for the following reasons (based on your requirements.

  • Lifetime of language/API/platform/framework- ie how future-proof will the investment in this application be?... the product has a long life-cycle (10). That really depends on what you mean by long. I seriously can't imagine Java disappearing, simply due to its huge installed base. C or C++ isn't disappearing either but I always think of the VB6-to-VB.net migration issues when contemplating the future of C#.

  • Will need to communicate with devices using USB and/or ethernet (9). Whilst Java isn't directly ideal for this, it has JNI to do the grunt work. You'll still need a C component to do this (and it will change for each platform but it's better to have the bulk of your code write-once - with C, you'll probably have most of your code changing for each platform, and with C#, well, is it really supported on platforms other than Windows?). Another alternative is JNA which looks like a "Python ctypes" for Java (access to shared libraries and DLLs without the JNI interfacing layer).

  • Availability of resources, tutorials, support (9). All the languages have a huge resource cross-section on the web.

  • Richness and breadth of libraries available (9). You have Boost for C++ and cross-platform GUIs but they're something that has to be added - there's nothing built in to the development environment like with Eclipse/Java.

  • Unit testing (9). Same response as availability of tools below - there are plenty of (free) Eclipse plug-ins that automate unit testing.

  • Availability of engineers with relevant skills (8). All the languages you mention have a plethora (I love using that word) of people able to do the job.

  • Availability of quality IDE/tools (8). This is Eclipse. No two ways about it, in my mind. The number of plug-ins for it is truly immense. NetBeans may look nicer but I'd rather have functionality than looks (and so would my wife, so that's lucky :-).

  • Cost of IDE/tools (7). Eclipse is free.

  • The application will need to be able to interpret a scripting language (6). Last I heard, Java now includes JavaScript as a built-in as well as the ability for developers to add their own scripting engines.

  • Cross-platform (3). C#, no (despite the existence of Mono, I still see risks that it will fall afoul of MS one day, and that not many is the FOSS world will work on it due to its MS associations).

paxdiablo
Not to intrude on this Eclpse love-in, but part of the problem with Eclipse is what I term "plug-in hell".
cletus
I agree with your comment on "lifetime". Part of the motivation behind the question is because of a significant amount of code (Borland Delphi/C++ Builder+VCL, MFC) I've seen 'abandoned' in the "legacy" basket because of cost of migration and aging tools etc.
Prembo
At my last job I was using IntelliJ. After that I need to go with some other option because at new place they didn't buy me a license. So, Eclipse seemed like an obvious choice, as I had already used it before. But then I couldn't make myself comfortable with that. Netbeans did it. IDEA rulz still.
Adeel Ansari
For scripting, you have plenty of scripting languages with an interpreter directly callable from Java. beanshell was one of the first (if not the first); It is easy to integrate and use. But there are many others as well.
jfpoilpret
For low-level integration (USB driver), you may also take a look at the open source library "JNA" which allows direct OS calls without writing any line of C code (I never used it but I found the examples quite interesting and easy looking).
jfpoilpret
@jfp, that JNA looks mighty impressive. I've used ctypes under Python and been very impressed and this one looks very similar.
paxdiablo
+4  A: 

I'll go with C# for this, for several reasons:

  • Closest relative to C++ in terms of syntax;
  • Direct access to memory if required with unsafe blocks;
  • Modern UI with lower cost of development than any C++ UI framework;
  • High skills availability;
  • Thanks to Microsoft and others, libraries for just about anything (including USB);
  • Visual Studio is relatively cheap;
  • Long expected lifetime: .Net is both reasonably mature (at 7+ years) and the one with the best longterm prospects of the "bytecode platforms" (primarily including Java);
  • Easy integration of native code via DLLs. Java/JNI (speaking from experience) is just that much more awkward; and
  • Unit testing frameworks.

Honestly I think the time for C++ desktop apps has come and gone. They're simply too error-prone and expensive (in comparison) to develop in.

The only thing the C#/.Net solution lacks is cross-platform (Mono notwithstanding). I don't know how much of a big deal that is for you but you only listed it as a 3.

cletus
+3  A: 

If I were releasing something right now, C++/wxWidgets would win hands down. The combination is very portable, as well as satisfying all of your availability and cost concerns.

Early next month, if I remember correctly, Qt will be released under the LGPL license. I've never used it myself, but I've heard several people sing its praises; the license requirements were the only thing keeping me from looking at it. It would likely be just as good as wxWidgets for your needs.

Neither of these handle scripting or unit testing, so far as I know.

I'd look at using Python as the scripting language. It has a good reputation as an embedded scripting language for other programs.

I've never found a unit testing framework that I like, so I can't recommend one.

Head Geek
Prembo
Qt4 has both a unit testing and a scripting library.
Rob
+1  A: 

I see that there are a lot of C# people here, - C#: does not work well on other platforms than Windows. So that is a bad idea. Forget it. - Java: Not good for device drivers, and is still slower than C or C++. Java has some nice features, but there are to many people out there that is thinking way to highly about it. - VB: Why would you want to use that?

I would probobly use C++/Qt, the only drawback is that Qt cost money if it is a commercial product, if it is not it is free. You say that your team allready has C++ experience, so than it should not be to hard to learn how to use Qt. And that will work and look very good on both Windows, Linux and mac. Ide's are not a problem with Qt, Trolltech are developing a cross platform ide that you could use, or you can us Visual Studio, eclips or other C++ ide's.

Rolf Anders
+1. Though obviously at least one person didn't like your answer and voted it down, and I'll bet that it's a C# person. ;-) One point: as I noted in my reply, Qt will be released under LGPL soon too, which eliminates that concern.
Head Geek