Java and .NET. Software written using both technologies - java

I'm trying to understand trends of the languages. This might be not a "real programming question", but i hope people will correct me promptly.
Currently there are two languages/trends/technologies that i'm interested in: Java and .NET. These are two worlds.
There's an opinion that:
1. Java is most often used in connection with Oracle for ERP/CRM/Banking systems
2. .NET is most often used in connection with MsSQL (captain obvious) for Inter-company communication software (simple ERP/CRMs), websites, portals.
I want you to notice that i emphasized most often not occasionally. Java is truly used for websites. And .NET might be used for complex CRMs as well. It's not a holywar or an attempt to offend .net or java. Simple curiosity. What are you using your tool for? What are the related technologies that are coming along with java/.net. Although the question is pretty abstract, please try to be concrete when answer. Hope you will enjoy reading the answers as well.

For rich desktop apps .NET (C# usually) wins hands down. Java has been playing catchup for a long time with GUIs and missed the boat with the early releases of awt/swing and poor IDE designer support.
I would say Java is better for server side apps, because of the wide array of high quality third party libraries. Java also integrates with pretty much any DB (JDBC drivers abound) and there's plenty of libs out there to help with database interaction (spring, hibernate, ibatis etc).
Currently I'm using both, Java server/back-end with a C# front-end. Once you jump the hurdle of getting the two to talk to each other you get the benefit of the languages/frameworks working to their strengths.

At work we're building a family of web sites and a bunch of windows services. Whereas my personal projects include a package manager and database migration framework, both of which are kind of "for-developers" tools.

We use mostly Java in a bank. Netbanking module (servlets), and internal banking applications are written in Java (Swing). Database is IBM's DB2. Servers are all Ubuntu 9.
Some legacy apps are written in Visual Basic.

It's not clear what do you want to get eventually from your question because the answer for the question 'what language should I learn' may be opposite to the answer to 'what platform/technology should I choose for my company'.
My vision is that either java or .net are mainstream platforms, i.e. there are a lot of technologies, ready-to-use products and developers for both of them. It's possible to use both of them for wide range of tasks - starting from GUI finishing complex server-side applications.
About the differences - I see them as follows (note that I'm java guy and may not be aware about many .net benefits):
java runtime has support for many platform, .net is for windows and linux (with restrictions - see Mono project);
java applications are compiled by jit-compiler and require some time to 'warm up' in order to get a max performance; .net applications are compiled to the machine instructions at first launch (afaik);
java has more products and
technologies (note that many of them
are ported to .net as well);
c# as a programming language is evolved more rapidly than java (java spends a lot of effort to backward compatibility);
java is less expensive for the companies - there are good free IDEs, profilers, servers and it can be used with free *nix operational systems;
java offers a choice between various vendors - web- and app-servers, IDEs, ORM etc;

Related

Why are Enterprise Applications Universally Implemented Using Java + Application Servers? [duplicate]

This question already has answers here:
Why is Java frequently used for enterprise applications? [closed]
(11 answers)
Closed 9 years ago.
I've been studying at a lot of enterprise applications for insurance and banking recently and something struck me: Pretty much every application is written in Java and deployed using an Application Server such as JBoss.
Why are these pair of technologies the default choice in the enterprise application space?
Why don't folks use new frameworks/languages/servers such as Django?
I suspect the choice is made for some combination of security, performance and licensing reasons, however those exact reasons aren't clear to me.
Much thanks.
Although Java initially didn't target server side apps/enterprise stuff, once it attracted the attention of the "enterprise" crowd, it has constantly evolved catering to their needs.
Here are a few Java advantages (compared to Pythong & Django, Ruby, PHP, etc.):
very clear syntax with strong rules and many safety mechanisms (no inferred/dynamic types which can lead to nasty bugs, few cryptic symbols, all kinds of compile-time checks, mandatory exception-handling in certain situations, etc. - many inexperienced people are annoyed by some of these things - but it's exactly these things that make programs less error-prone and the enterprise people love it)
very strong security (despite all kinds of media reports criticizing java for suspected vulnerabilities (usually related to browser applet)s, there has never been a single major security breach on the server side - which is why it is trusted by the banking industry
versatile and very fast VM (java applications can be almost as fast as native c/c++ for pure computations) that can run on many powerful servers, being able to harness their entire power (python, php and ruby can't even handle multithreading properly)
a very large number of frameworks that can do a lot of things (from technical frameworks like the search engine lucene to more enterpresey stuff like OfBiz, Alfresco etc.)
tight integration with other enterprise products (servers, databases, etc.)
it is supported by one of the largest software companies in existence (Oracle) and other powerful third party companies like IBM, RedHat and many others
lots of professional, high quality tools (Eclipse, Netbeans, IntelliJ IDEA, JDeveloper etc.)
Many companies do not trust new frameworks/languages/servers like Django, Python, node.js and such because some of them are not mature enough to be trusted, or not trusted enough to be considered as mature software. Also, finding a good Java developer is easier than finding a good Rails developer.
But trust is not the only factor, as scalability of the solution (framework or server) may be more and more important as the company tends to grow. i.e: Storing customers data in excel files may be a thing if you're running a SMB, but it will become a bad idea to keep this scheme as the number of customers keeps increasing. The same goes to your frameworks/servers/languages.
The link in the comment gives many general reasons, one I don't see which is specific to your question about why not Django. Type checking at compile time avoids a whole class of runtime errors that non-typed languages do not.

Which are the advantages of developing in Java a server-side application compared to other languages? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
Our company is starting the development of a client-server application and a discussion is going on about which technologies should be used.
For the client (GUI) side we tend to QT and C++. For the server side, we have been advised to use Java and indeed it looks like it is one of the languages being used most for server development.
Can anyone elaborate on the advantages offered by Java for server side development and why adopting it should make our life as developers easier and/or allow us to reach better results than if we used, let´s say, .NET or even C++?
Thanks in advance.
Some advantages:
Run compiled code across platforms.
Managed memory (garbage collection).
Hude wealth of excellent open-source libaries.
Large developer market.
Easy migration for C++ developers.
Some disadvantages:
Aging language — has not kept up with language advances IMO (e.g. adding functional facilities).
Future uncertain after Oracle aquistion (will become clearer with time).
Low level programming difficult.
You may want to look also at other languages which run on the JVM, such as Scala and Groovy, at .NET (it can run on Linux et al using Mono) and even the D language, which provides a C++ like, compiled to native, language with modern features such as garbage collection (optional), code contracts, lambdas etc. These languages provide many of the benefits of Java over C/C++ but have also taken the progression a bit further or in different directions.
Apart from platform independence, the main advantage of server-side Java development is the wide selection of mature libraries and standardized frameworks. However, the main focus here is on web development.
For a C++ client, Java could still be beneficial if you use REST as protocol between client and server (JAX-RS is pretty nice). Otherwise, it depends very much on your application domain and whether there are Java libraries that could help you in that regard.
Let's put it this way... it's not which server-side language is better and what not, it is what's available in your company that you can leverage of and make good use of it. When you work in a big corporation, sometimes you cannot just introduce "yet another language"... it doesn't work that way. :)
Further, every language has its pros and cons. You can almost argue the pros/cons in both way depending on how biased or open-minded you are. You can choose RoR and all that bleeding age technologies, but if your team members are not comfortable in dealing a brand new language, how exactly are you going to maintain the project in long run? I mean, if your team is familiar with PHP, I don't see anything wrong using that compared to Java, .NET, etc.
Your customers don't care the underlying implementation as long as it works.
Java advantages:
- mature
- good to excellent backward compatibility
- wide range of available frameworks for almost any problem
- robust - garbage collection, APIs as java.util.concurrent
- great tools to manage code quality, good IDEs etc.
- very good performance
- support for scripting
disadvantages:
- sometimes too many frameworks for the same thing
- not all the frameworks have as good quality of code as you need
- looks easier than really it is
You have many options in server side. Since you have the control over server side you can basically use anything. Using .NET forces you to use Windows Server so i will prefer a framework that can run on any operating system and is portable.
Java was the right answer 5-10 years ago. Because it had portability, and can work on any system. But these days developers look for languages/frameworks that are easier to use, maintain and code. I will vote on Python these days for server side development because of this, its fast it easier to read and maintain code wise, and it has many open source projects/libraries that you can use, even Google is favoring python over Java(GAE had python support first, then support for Java came). You can use django on python for web development and twisted for writing a server that uses TCP to communicate.
There are several issues you need taken in accout to select the language:
which are the languages which know your team best / good enougth
which are the languages which know the team thet must maintain the server
are there the right frameworks with an quality that makes you want to use them
will the code be maintainable as long as the server is in production
how fast will be the development -- the importent thing here is not the time you spend to type the code - more important is the time that you need until the product works stable enougth to use it for production without reasonable bugs
communication with other systems - if every system you need to communicate with is an .net - that it would be wise to build the new system in .net too
are there any constraints (must use this server, open source policy of your company, ...)
cost of licences, ...
...
At least the descicion to use a specific language for an project with a reasonable size, is always the question of cost. But not only the cost to build the system, also the cost to maintain it. - The points mentioned above are all cost related: for example: if you do not knwo the language you are slower (-> $), if the system can not be maintained, it must be rebuiled (-> $), if there are not the right libs, you need to implemnt it by your own (-> $), if the language you picked make it easy for bugs to hide, you need a long time until the system can go in production (-> $)
In MHO, the advantages of Java are: the wide spread knowlege (this is for .net too), a huge amount of realy mature open source framworks (this is the point for Java against .net), and the usage of a strong typed system and a compiler wich result in less bugs is a long term advantage of Java and .net over every not strong typed scripting language)
One must have for all languages you use on a Server is an Garbage collection!

Why .NET and Java on server side?

Java and .NET are two languages targeted at removing platform dependence. This is achieved by adding a virtual machine/framework between the code and the OS.
So, what is the point in using it on the server side, as all websites are accessible via browser, and that is platform independent? Is there any special reason for using them?
.NET is meant for the Windows platform only. Java is the only one of the two that is meant to be platform independent.
These languages have a strong presence on the server end for many reasons:
Lots of libraries that handle the subtasks of the problem
Both frameworks are built with security in mind
They are managed languages, it is much harder to pull off the typical attacks on software.
They are considered to be mature technologies, they have been put to quite a bit of abuse and have stood the test.
They have industry support.
Both are object oriented
This means that there is the ability to either develop a web site through the use of reusable components or third party components.
Both language allow "sandboxing" of non-managed components (Java: JNI .NET: Boxing) [allows inclusion of legacy components]
They're actually chosen for almost completely opposite reasons:
Java's platform independance means you're not tied to one platform and are thus more flexible in choosing the most cost-effective platform, or the most reliable one. And you can keep your apps running even when you have to change server platforms because the old one isn't supported anymore.
.NET is chosen because if you're going to tie yourself to an OS, Microsoft is the biggest player and thus the least risky option - or simply because companies fell into the "All-Microsoft shop" trap through gateway drugs like Exchange. And once you're there, .NET is what Microsoft wants you to use and supports and integrates with all their current tools.
Both Java and .NET have their own benefits for the server-side.
For example, with .NET you are free to pick the best language for the part of the application you are working on, and all of these .NET languages work together.
So, you may want to use F# for the data mining functions, C# to work with the database, unmanaged C++ (going through a thin managed C++ layer) for fast network connections, or system calls, and there are a host of other languages. .NET is less platform independent currently, but language independent.
Java can be used on several different OSes, which is advantageous if you are selling a solution, since you don't care what OS the customer is using.
Now the JVM is becoming less language dependent, with Clojure and Scala running off of it, so Java has become more interesting now, for designing applications.
They virtualize the underlying system, so they can be run on different kinds of server operating systems.
And, they are designed to be general purpose application development systems, so they are intended to be run on anything with a processor.
If you are asking because you do not understand why one would accept the overhead of an abstraction layer, keep in mind that both Java and .NET JIT down to native code.
So, what is the point in using it on the server side, as all websites are accessible via browser, and that is platform independent?
Well, web applications are not just rendering HTML for fun, they are doing things on the server-side that may involve talking to database(s), sending messages to a MOM, etc.
Is there any special reason for using them?
This is a partial answer but I wanted at least to cover the case of Java here. I could start by arguing that Java is a safe, robust, garbage-collected, object-oriented, high-performance, multi-threaded, interpreted, architecture-neutral, cross-platform, buzzword-compliant programming language... but this wouldn't really answer your question. Actually, the big deal with Java on the server side is IMO that you benefit from standardized Enterprise APIs (aka J2EE) that allow you to do "enterprise things" (JDBC, JTA, JMS, etc) in a standard way with hardware, operating system and software vendor independence (which is a big plus for contract negotiation). In other words, Java is perfect for heterogeneous environments which are almost always the case with big organizations and doesn't lock you in.
While platform independence are great to strive for I would say Java
and .net are commonly used as there are a large number frameworks
available which make it so much easier to develop enterprise level
applications. This is especially true with java, where you have an
incredible choice of high quality technologies most of which are
flexible enough to meet the needs of most projects, allowing you to
focus on your application's functionality.
Also, without no intent to start a flame war, Java and .net have
better development tool support and are easier/quicker to develop
with for your average programmer.
In early web days, it was mostly Perl and occasional brave souls who didn't like Perl or wanted more performance used C++. Then Sun developed JDBC and Servlets for Java, and then other J2EE pieces, and Java became a higher performance alternative to Perl, and easier than C++. With J2EE came a lot of application server products from big companies, and now you have a big Java web/app server community.
Then Microsoft came along, after losing the J++/Java war with Sun, and created a similar web app infrastructure with .NET. With .NET you have fewer choices, with all of the advantages and disadvantages that brings.
So, I think the answer is a mix of decent performance, safety and enterprise features, and major corporate backing. C++ is too hard and dangerous for most people. Perl, PHP, Python, and Ruby have their fans, but not the corporate backing. I don't think the fact that Java/.NET are on Virtual Machines is important for the server side. Java used a VM originally for the client. Sun had to work hard to make a fast sever VM. I think Microsoft used a VM to compete with Sun, and to make it easier to support multiple languages. It will be interesting to see if Google's Go language takes off, which may surpass Java and C# for safety and power but no VM.
the browser doesn't have access to the server resources (database, files etc.) that those frameworks have access to. You couldn't have an application that is only javascript (and does meaningful things)
I understand your question this way: why choose Java or .NET if there are more other comfortable ways to setup a server because the clients use HTTP to access the server?
You are right that the server OS or framework does generally not matter to the client.
However the client side also can contain applets or code that then needs to communicate with its counterpart on the server. Then JSP or .NET becomes more interesting as you do not have to manage different client OS's. Then website become easily extensible.
If you want to integrate some nice graphing and charting solutions (Telerik, Dundas, ... or whatever - not meant to be advertisement - ) from 3rd parties you would also have to select a compatible server infrastructure to run them.

Why would you choose the Java programming language over others? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Why would you choose java over others? Why did you choose java to program your application?
Please include what you are using java for (desktop application/ web application/ mobile).
Excellent tooling: IDE, CI, etc.
Vast array of 3rd party libraries.
Huge amount of documentation available.
Large pool of developers available.
Platform ubiquitous.
Excellent performance.
Excellent specification.
Sturdy garbage collection.
Managed memory.
Native threads.
Choice - implemented by multiple vendors.
I have used Java to build various middle-ware products: Inventory mgmt; CMS; chemical registration; etc.
One of the nice things about Java is that everyone knows it. Of course, now that I've said that, I'll get 80 comments from people claiming to have never learned the language. Be that as it may...
Like it or not, Java is the closest thing to a lingua franca (the idiom means "common language") we have in the industry today. Just about every has either used Java at some point, or (more commonly) is actively using it now. That sort of ubiquity can be extremely attractive to some companies, particularly those reliant on consultants. If you start a project in Java, you're pretty much guaranteed to be able to find talent to maintain the code base for years down the road.
On a different tack, Java is an excellent language for developing cross-platform desktop applications...it's just that nobody knows it. Most of Java's dominance is on the server side coupled with a little bit of love from the J2ME crowd. However, if you objectively consider Swing in Java 6uN, it's hard to find a better tool for the job. Don't get me wrong, I see that it has its flaws, but many of those have been fixed in recent releases. Most of the issue now is mindshare: everybody knows that Java is slow and ugly (neither of which is strictly true anymore). The other problem is that Swing is very much a cross-platform UI toolkit. This means that it is inherently much harder to create professional UIs in Swing than in Cocoa or even WinForms.
Finally, a really great reason to pick Java (as opposed to .NET or Objective-C) is the ecosystem. Other answers have mentioned libraries, which really deserve a significant spotlight; but I'm thinking specifically of the rising language diversity. If you write an application in Java today, you can seamlessly transition to Scala at any time. You also have the option to do scripting in Groovy or JRuby, not to mention taking advantage of the powerful concurrency abstractions in Clojure. Because of its portability and high-level nature, the JVM is increasingly the preferred target for language compilers and interpreters (even more than the CLR). Java is really at the center of that nexus, not really benefiting directly from the vast cloud of languages which swarm around it, but certainly deriving value from all of the interoperability, present and future.
My reasons for prefering Java over other programming languages at this time are:
price - it's free
performance - really fast these days thanks to the HotSpot JIT compiler
effectiveness - lots of power with rigorous features like type-safe, sand-boxed, etc.
OOP capability
very good, well-thought out exception handliing; C++ exceptions are the opposite!
portability - it runs on almost everything
tool availability - awesome IDEs like Eclipse & NetBeans are free, as are web servers like Tomcat and application servers (JBoss, Glassfish, Geronimo, etc.)
flexibility - does graphics, desktop GUIs, web user interfaces - all kinds of things in all kinds of runtime environments
aptness - many enterprise apps today have to support HTML, SQL, and XML - Java has good support for all of them built in and you can get third-party libraries for free that make this even easier/better
well-supported - Sun keeps adding improvements and fixing thing going one or two versions back
forward compatibility - unlike something like VB which undergoes wrenching change in its syntax every couple versions or so, Java's syntax and semantics seem about 99.9% upward compatible from version to version
I have been writing programs in Java for over a decade and I am pretty satisfied with it. I have used other languages for almost two decades before that. So I am not biased by describing the one thing I know - it is one of many languages I know intimately.
When upgrades to the JDK/JRE come out, I look the documentation over to see what is changed. Sun is good about telling/explaining this. I have never had an extremely rough time porting from one JDK to the next.
When I have switched from one OS to another as my main OS at home or at work, it has not caused a problem for the Java applications I write - or the tools I use, generally. The one exception is Borland JBuilder, which some Borland marketing or technical genius decided to frequently stop supporting. Eclipse and Netbeans run terrifically on the Mac and probably always will. I have used Java on:
MS-Windows 95, 98, NT4, 2000, XP
Sun Solaris/SunOS Unix
IBM AIX
Mac OS X
Linux
Motorola cell phones (MIDP, CLDC)
Palm Pilot PDA
Java VMs (virtual machines) are everywhere! They are in:
web browsers
cell phones
PDAs
desktop computers
web servers
application servers
I have written programs on all of these. All you have to do is get an IDE with the right plugins, get the API documentation for the target environment you want, and start programming.
The GUI programs I write actually do look & work correctly on different platforms! I cannot tell you how long other vendors promised to do and how often/long they have failed. Just look around, some still exist.
Sun promised this in Java 1.0 and they sort of delivered it with AWT. However, the abstract windowing toolkit used native GUI components and the differences between these components (which followed no unifying standard at all) were too great to get same/nice look/behavior on all platforms.
Sun delivered very well upon this portable GUI promise when the Swing GUI API was delivered a decade ago, back in December 1998.
1) Very good and free documentation
2) Very good developer commercial and free tools
3) good certification and training resources
4) good runtime and free tools
5) good profiling and monitoring tools
6) very good support options from various companies
7) very good open source community with huge amount of libraries
Things not yet mentioned:
Cross-platform Desktop Application, even with sophisticated GUI
bunch of tools
static typing (see GWT)
error messages at compile time
very clear error messages
Java provides a very rich API right out of the box and hands-down produces the most portable applications since there is a Java VM for almost every platform.
BTW: I haven't used Java since I left college since I work for a Microsoft shop, but I can't think of a single thing I can do in C# that I can't do in Java, whether it be enterprise applications, web applications, or desktop applications.
Portability is the key to java. I know that a program that i am coding will run on any system, there is no need to create different releases for different OS's.
Java also offers built in security, making the coding of the safe programs easier.
Java is fast, with clean code java is benchmarking in the same range as C++.
C# is the language that gets compared to java the most often. C# isn't as portable as java, and has very few features that java doesn't. This makes java much more attractive unless the program will ONLY be run on a single OS, in that case i might code it in C++.
I switched from years of C++ to Java because I was working on higher level stuff and needed the benefits of memory management, reflection, and sandboxed execution that I get with Java.
I have tried COM in the late nineties and could not touch it.
.NET looks promising and in many ways is now much better than Java. Unfortunately, being window-centric is a complete dealbreaker for me.
Another benefit is the awesome static analysis tools available e.g. FindBugs. These perform a lot of checking on your code above and beyond those performed by the compiler, and can help identify bugs and/or code smells before testing begins.
Lots of great reasons have already been mentioned. I'd like to add the political part. I trust Suns language a lot more than Microsoft alternatives. It's not because I hate Microsoft, it's just that Sun is going a direction with Java that I really like, and Microsoft is going a direction with .net etc. that I really don't like.
This is very subjective, I know. But to me it seems like Sun really want to create a great language, and try to make money somehow. While Microsoft seems more interested in making money by vendor lock-in and systems that looks great and feels great, but may not be as good as it looks in the long run.
So the way Microsoft is handling it right now, I don't even care about how good or bad it is, technically. I don't care, I'm not going to use it.
Java has everything I want from this kind of programming language, including all the boring political stuff most people just skip. I don't know about any other current language that has all that.
The main reason I use Java for most of my desktop app projects is for cross-platform compatibility. It's quite easy to make your app run on OS X, Windows, and Linux and look native on all platforms.
I use Java for our BPM platform and used Java in the past for enterprise web apps.
It depends on what you want to do. Considering language features, libraries available and IDE experience, I personally would choose C# over Java. C# 3.0 has many useful features that Java lacks, such as LINQ, Lambda expressions, etc. Some people prefer the huge library choice that is available for Java, but I think there are just too many ways of doing things. Java IDEs like Eclipse and NetBeans are getting better, but I think Visual Studio is still much easier to work with.
Of course,if you are not using Windows, you don't have much of a choice but to choose Java. Ruby and Python can be good options for things like utility apps and GUIs, including Web apps, but for enterprise apps that don't use Windows, Java is pretty much the only option.
Please don't follow blindly all java-entousiasts. Java has its own flaws. Java is great for rapid development, enterprise oriented stuff, and "high productivity" project (with the tons of projects, community,...).
And if one guy show me a benchmark highlighting how java code can be as optimal as C stuff doesn't mean the complete java solution is fast and lightweight.
Java will never find its way on some performance critical applications, like games, codecs, web browser. No major game software is developed in java, and not because the developper are not capable of writing one piece of Java code that has the same speed as C or C++, this is because the very limitations of the language involves that performance and memory consuption will never reach a good C/C++ code. Takes VisualStudio and Eclipse. Java is great for one stuff (productivity stuff, enterprise middleware), but if you want to write codecs, games, performance critical libraries, you'd better try knowing C.
But, one the other hand, you'll write the java code faster and safer, with C and C++ you're taking more risk (pointers!) and this takes usually more time.
And don't forget the joke "Write once, Debug everywhere", this is actually true. You have to deal with different JVM implementation nightmare with Java.
Other programming language have their interest, bash/python scripts for local scripts (repetitive action, fast and quick UI,...). Php or ruby for webapplication are very well deployed and documented on the web.
Using it for desktop applications.
Excellent IDEs available, wonderful API, "C-style" syntax makes it easy to pickup. Once the JVM starts, the performance is great.
Why would I choose Java - is it the most popular language out there right now? If not, it's gotta be damn close, so if I'm building a product I might choose this because it would be the easiest to hire developers for.
Why did I choose Java - because it's what I know best.
Why would I choose Java? If I happened to have a team of replaceable code monkeys developers that knew Java better than anything else, that is probably what I'd go with.

Is .NET/Mono or Java the better choice for cross-platform development? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
How much less libraries are there for Mono than for Java?
I lack the overview over both alternatives but I have pretty much freedom of choice for my next project. I'm looking for hard technical facts in the areas of
performance (for example, I'm told Java is good for threading, and I hear the runtime code optimization has become very good recently for .NET)
real world portability (it's both meant to be portable, what's Catch-22 for each?)
tool availability (CI, build automation, debugging, IDE)
I am especially looking for what you actually experienced in your own work rather than the things I could google. My application would be a back-end service processing large amounts of data from time series.
My main target platform would be Linux.
Edit:
To phrase my question more adequately, I am interested in the whole package (3rd party libraries etc.), not just the language. For libraries, that probably boils down to the question "how much less libraries are there for Mono than for Java"?
FYI, I have since chosen Java for this project, because it seemed just more battle-worn on the portability side and it's been around for a while on older systems, too. I'm a tiny little bit sad about it, because I'm very curious about C# and I'd love to have done some large project in it, but maybe next time. Thanks for all the advice.
Mono does a better job at targeting the platforms I want to support. Other than that, it is all subjective.
I share C# code across the following platforms:
- iOS (iPhone/iPad)
- Android
- The Web (HTML5)
- Mac (OS X)
- Linux
- Windows
I could share it even more places:
- Windows Phone 7
- Wii
- XBox
- PS3
- etc.
The biggie is iOS since MonoTouch works fantastically. I do not know of any good way to target iOS with Java. You cannot target Windows Phone 7 with Java, so I would say that the days of Java being better for mobile are behind us.
The biggest factor for me though is personal productivity (and happiness). C# as a language is years ahead of Java IMHO and the .NET framework is a joy to use. Most of what is being added in Java 7 and Java 8 has been in C# for years. JVM languages like Scala and Clojure (both available on the CLR) are pretty nice though.
I see Mono as a platform in it's own right (a great one) and treat .NET as the Microsoft implementation of Mono on Windows. This means that I develop and test on Mono first. This works wonderfully.
If both Java and .NET (Mono let's say) were Open Source projects without any corporate backing, I would choose Mono over Java every time. I believe it is just a better platform.
Both .NET/Mono and the JVM are great choices, although I would personally use some other language than Java on the JVM.
My take on some of the other comments:
Issue: Performance.
**Answer: Both the JVM and the CLR perform better than detractors say they do. I would say that the JVM performs better. Mono is generally slower than .NET (though not always).
I personally would take ASP.NET MVC over J2EE any day both as a developer and an end-user. Support for Google Native Client is pretty cool too. Also, I know that poor GUI performance for desktop Java apps is supposed to be a thing of the past but I keep finding slow ones. Then again, I could say the same for WPF. GTK# is plenty fast though so there is no reason they have to be slow.
Issue: Java has a larger ecosystem of libraries available.
Answer: Probably true, but it is a non-issue in practice.
Practically every Java library (including the JDK) runs just dandy on .NET/Mono thanks to IKVM.NET. This piece of technology is a true marvel. The integration is amazing; you can use a Java library just like it was native. I have only had to use Java libraries in one .NET app though. The .NET/Mono ecosystem generally offers more than I need.
Issue: Java has better (broader) tools support
Answer: Not on Windows. Otherwise I agree. MonoDevelop is nice though.
I want to give a shout-out to MonoDevelop; it is a jewel. MonoDevelop integrates most of the tools I want use including code completion (intellisense), Git/Subversion integration, support for unit tests, SQL integration, debugging, easy refactoring, and assembly browsing with on-the-fly decompilation. It is wonderful to use the same environment for everything from server-side web to mobile apps.
Issue: Compatibility across platforms.
Answer: Mono is a single code-base across all platforms, including Windows.
Develop for Mono first and deploy to .NET on Windows if you like. If you compare .NET from MS to Java though then Java has the edge in terms of consistency across platforms. See next answer...
Issue: Mono lags .NET.
Answer: No it does not. IMHO, this is an often stated but incorrect statement.
The Mono distribution from Xamarin ships with C#, VB.NET, F#, IronPython, IronRuby, and I think maybe Boo out of the box. The Mono C# compiler is completely up to date with MS. The Mono VB.NET compiler does lag the MS version. The other compilers are the same on both platforms (as are other .NET languages like Nemerle, Boo, and Phalanger (PHP) ).
Mono ships with a lot of the actual Microsoft written code including the Dynamic Language Runtime (DLR), Managed Extensibility Framework (MEF), F#, and ASP.NET MVC. Because Razor is not Open Source, Mono currently ships with MVC2 but MVC3 works on Mono just fine.
The core Mono platform has kept pace with .NET or many years and the compatibility is impressive. You can use the full C# 4.0 language and even some C# 5.0 features today. In fact, Mono often leads .NET in many ways.
Mono implements parts of the CLR spec that even Microsoft does not support (like 64 bit arrays). One of the most exciting new pieces of technology in the .NET world is Rosylyn. Mono has offered the C# compiler as a service for many years. Some of what Rosylyn offers is available via NRefractory as well. An example of were Mono is still ahead would be the SIMD instructions to accelerate gaming performance.
Microsoft does offer a number of products on top of .NET that are not available in Mono which is were the misconception about Mono lagging comes from. Windows Presentation Foundation (WPF), Entity Framework (EF), WCF (Windows Communication Foundation) are examples of products which do not work, or are poorly supported, on Mono. The obvious solution is to use cross-platform alternatives like GTK#, NHibernate, and ServiceStack instead.
Issue: Microsoft is evil.
Answer: True. So what.
Many people offer the following reasons to avoid using Mono:
1) You should not use Mono because Microsoft tech should be avoided
2) Mono sucks because it does not let you use every technology that Microsoft offers
To me, it is clear that these statements are incompatible. I reject the first statement but will skip that argument here. The second statement is true of all .NET alternatives.
The JVM is a great platform and the explosion of JVM languages is awesome. Use what makes you happy. For now, that is often .NET/Mono for me.
Well....Java is actually more portable. Mono isn't implemented everywhere, and it lags behind the Microsoft implementation significantly. The Java SDK seems to stay in better sync across platforms (and it works on more platforms).
I'd also say Java has more tool availability across all those platforms, although there are plenty of tools available for .NET on Windows platforms.
Update for 2014
I still hold this opinion in 2014. However, I'll qualify this by saying I'm just now starting to pay some attention to Mono after a long while of not really caring, so there may be improvements in the Mono runtime (or ecosystem) that I haven't been made aware of. AFAIK, there is still no support for WPF, WCF, WF, of WIF. Mono can run on iOS, but to my knowledge, the Java runtime still runs on far more platforms than Mono. Also, Mono is starting to see some much improved tooling (Xamarin), and Microsoft seems to have a much more cross-platform kind of attitude and willingness to work with partners to make them complimentary, rather than competitive (for example, Mono will be a pretty important part of the upcoming OWIN/Helios ASP.NET landscape). I suspect that in the coming years the differences in portability will lessen rapidly, especially after .NET being open-sourced.
Update for 2018
My view on this is starting to go the other way. I think .NET, broadly, particularly with .NET Core, has started to achieve "portability parity" with Java. There are efforts underway to bring WPF to .NET Core for some platforms, and .NET Core itself runs on a great many platforms now. Mono (owned by Xamarin, which is now owned by Microsoft) is a more mature and polished product than ever, and writing applications that work on multiple platforms is no longer the domain of deep gnosis of .NET hackery, but is a relatively straightforward endeavor. There are, of course, libraries and services and applications that are Windows-only or can only target specific platforms - but the same can be said of Java (broadly).
If I were in the OP's shoes at this point, I can think of no reason inherent in the languages or tech stacks themselves that would prevent me from choosing .NET for any application going forward from this point.
I actually develop in .NET, run all my tests first on Mono, and then on Windows. That way I know my applications are cross platform. I have done this very successfully on both ASP.NET and Winforms applications.
I am not really sure where some people get the impression Mono is so horrible from, but it certainly has done it's job in my cases and opinions.It is true you will have a bit of lag for the latest and greatest inventions in the .NET world, but so far, .NET 2.0 on Windows and Linux is very solid for me.
Keep in mind there are obviously many quirks to this, but most of them come from making sure you are writing portable code. While the frameworks do a great job of abstracting away what OS you are running on, little things like Linux's case sensitivity in paths and file names takes a bit of getting used to, as do things like permissions.
.NET is definitely very cross platform due to Mono based on my experiences so far.
Java actually is as cross-platform as everyone says it is. There's a JVM implementation for just about any mainstream OS out there (even Mac OS X, finally), and they all work really well. And there's tons of open source tools out there that are just as cross platform.
The only catch is that there are certain native operations you can't do in Java without writing some DLLs or SOs. It's very rare that these come up in practice. In all those cases, though, I've been able to get around it by spawning native processes and screen-scraping the results.
I think the question is phrased incorrectly. C# vs. Java is much less interesting in terms of cross-platform usage than is (a) which platforms you need to support, and (b) considering the core libraries and available third party libraries. The language is almost the least important part of the decision-making process.
Java is a better choice for Cross-Platform development.
Performance. Java and .Net have similar performance level due to the virtual machine, but JVM normally has better performance because of years and years optimization.
Library. Although this depends on your task, Java has much more open source or third party libraries available there. For server App, J2EE, Spring, Struts, etc. For GUI, although .Net provides Win32 layer API but this causes compatibility issues. Java has Swing, SWT, AWT, etc. It works in most cases.
Compatibility. This is the key issues that need to be considered when develop the cross-platform program. Two issue: first, platform compatibility. Java still wins since JDK is well maintained by single and original company Sun. Mono is not maintained by MS, so you have no guarantee yet for update compatibility. 2. Backward compatibility. Sun maintains a good reputation on their backward compatibility, although sometimes this seems too rigid and slows the pace.
Tools. Java has good cross-platform IDEs. Netbeans, Eclipse, etc. Most of them are free. VS Studio is good but only on Windows, and not cost a bit. Both of them provides good unit tests, debugs, profiles, etc.
Hence I'd suggest that Java is a better choice. As a show case, there are some famous desktop cross-platforms apps developed by Java: Vuze, Limewire, BlogBridge, CrossFTP, not to mention those IDEs. As to .Net, I have limited knowledge on such success apps.
I've been asking the same question off-late and IMHO, .NET/Mono seems to be a better option simply because Mono has a great track record for cross-platform desktop applications (as opposed to Java) and of course, Mono is improving by leaps and bounds these days.
I'm going to say Java as well. If you look at it in terms of maturity, a lot more time and effort has been expended by Sun (and others) in getting the JVM to work on non-Windows platforms.
In contrast, Mono is definitely a second class citizen in the .NET ecosystem.
Depending on who your target customers are, you may also find there is real pushback against using Mono - does Novell offer the same kind of vendor support for Mono that you would get for Java or .NET on Windows?
If you were primarily targeting hosting your service on Windows, it would make sense to be considering this choice, but since you're targeting Linux primarily, it seems like kind of a no-brainer to me.
Java was designed to be cross-platform; C#/.Net wasn't. When in doubt, use the tool that was designed for your purpose.
EDIT: in fairness, .NET was designed to work on embedded/PC/Server environments, so that's SORT of cross-platform. But it wasn't designed for Linux.
I think the answer is "it depends." Java runs on just about anything, but .NET/Mono are (IMHO) a better framework for the desktop. So I guess the answer really depends on what platforms you plan on targeting.
To add a bit more to the conversation, Java is more portable if you remain about one version behind - Java 5 still has many excellent features so you can wait for Java 6 and still have a lot of range in terms of language and libraries to develop with. The Mac is the primary platform that can take some time to catch up to the latest Java version.
Java also has an excellent standards body that intelligently grows the platform based on input from many different companies. This is an oft overlooked feature but it keeps even new features working well across multiple platforms and provides a lot of range in library support for some esoteric things (as optional extensions).
I would vote for Java being more portable than C#. Java definitely also has a very rich set of standard libraries. There is also a broad set of open source 3rd party libraries out there such as those provided by the Jakarta project (http://jakarta.apache.org/).
All the usual suspects exist for CI, Unit testing, etc too. Cross platform IDE support is also very good with the likes of Eclipse, Netbeans, IntelliJ IDEA etc.
There are other language choices too. I've become quite fond of Python, which works well on Windows, Linux, and Mac, and has a rich set of libraries.
While Mono has its share of problems I think it has a better cross-platform compatibility story especially IF you have reliance on native platform invocation.
There are not enough words on Stack Overflow to stress how much smoother it is to get something native called and executed in .NET/Mono on (at least in my experience 3...) multiple platforms vs. the equivalent Java effort.
Gatorhall do you have some data to back that up?
Performance. Java and .Net have similar performance level due to the virtual machine, but JVM normally has better performance because of years and years optimization.
Background: I'm a Windows guy since Windows 3.1 and currently a Linux user (still running Windows 7, great OS, on a VM for Visual Studio 2010 and other tools).
The point: me and a lot of users (windows, linux, etc) I know, may disagree from you. Java tends to perform slower even on a linux desktop application, ASP.NET perform's faster that java server pages many of the times. Some may agree that even non-compiled PHP performs better i several scenarios.
Java is more cross-platform? I have no doubts about this (the history back this on), but faster (not saying .NET is) not so certain and I would like to see some real benchmarks.

Categories