Java Versus .NET For Desktop Apps
This is my take on choosing between Java and .NET for writing client applications.Â I’m writing off the top of my head, since if I start doing research, I’ll up with a 10-post series that will be done next year or so…
Although both Java and .NET are good programming platforms, I think .NET is the default choice for industrial automation programmers writing Windows desktop apps because it’s a good choice, Microsoft is dominant in the industrial sector, and Microsoft typically has the best GUI designers.
Both Java and .NET are mature and extensive development platforms, with many choices of target devices, programming languages, IDEs, and libraries.
Java doesn’t quite run everywhere, but it’s available on a wide variety of platforms, such as Windows PCs, Linux, MacOS X and many embedded systems.Â Android is closely modeled after Java, although I’m not sure how close the libraries are.
.NET’s full runtime is available on standard Windows; subsets are available for Windows 8 RT, Windows Phone, Windows CE, and via the independent Mono project, Linux, Android, iOS, and MacOS X.
The most popular Java IDEs are Eclipse, NetBeans, and IntelliJ.Â Eclipse and NetBeans are both open source.Â Eclipse has a lot of add-ins, and is also widely used in non-Java applications such as embedded development.Â NetBeans is supposed to have a good GUI designer.
Visual Studio is by far the dominant .NET IDE; it is an excellent IDE, but there are also two good open source IDE’s, SharpDevelop (aka #develop) and MonoDevelop.Â The Visual Studio Express editions are free and quite powerful, although if you’re doing a lot of development I’d recommend paying for the professional version.Â The last version that can run on Windows XP systems is 2010; VS 2012 can compile code for XP, but won’t run on XP.
The main .NET libraries are WinForms and WPF (based on XAML). I’ve heard good things about Microsoft’s Expression GUI designer (used for WPF); I’ve just checked and Microsoft is integrating Expression Blend into Visual Studio, while Expression Designer 4 is now a free download without tech support.
My impression is that .NET has better GUI designers, but Java’s libraries have better layout managers (for creating a GUI in code).Â There are definitely many more graphical components available for .NET (spreadsheets, charts, reporting, etc).
Both Java and .NET have a lot of good libraries available.Â In fact, there is a lot of cross-p0llination: good libraries on one side are often ported to other side or inspire projects on the other side.
Books and Resources
Unlike in the PLC world, there are a lot of excellent books available for both Java and .NET, including programming, development techniques, and advanced topics.Â Plus, there are tremendous resources available via the internet including blogs and Q&A sites such as StackOverflow.
Amazon and its multitude of reviews are a great place to find good programming books, new or used, but if you’re looking for eBooks, remember to check out the publisher, too.Â For example, if you buy an eBook from Manning, you get the book in three formats (PDF, ePub, Kindle).Â Also, many Manning books include a downloadable PDF of the book if you register it.
I typically buy used books from Amazon because I still prefer real books, and they’re much cheaper than most eBooks.
Other Programming Languages
One of the best features of both .NET and Java are the many programming languages available that are pretty (but not perfectly) compatible with the other languages in that ecosystem.Â This makes multi-language programming eaiser; for example, you can use C# for the foundation and IronPython to add interactive scripting to a .NET application.