• 0

Which is better: .NET or Java?


Question

I am getting to the point where I need to focus on whether to look for careers in Java or .NET for when I get out of college. I was wondering for all of you that use these in the "real world" which of these two you prefer and which is most popular in the workplace.

Thanks.

Link to comment
Share on other sites

Recommended Posts

  • 0

This is a question where you'll get a different answer from everyone you ask. The correct answer is "neither" though. They both have pros and cons. Java is cross platform (Windows, Mac and Linux), whereas .NET is Microsoft specific (though there's the mono project in Linux for .NET too). I personally prefer .NET because of the ease of use and development tools (Visual Studio is probably the best development software around). However, I will say this. If you learn C#, you can easily learn Java too. The syntax is VERY similar, with the main differences being the keywords.

If you want to get into Java, I'd recommend downloading Eclipse as your IDE. With .NET you have free versions of Visual Studio (the express versions). Other than that, it wouldn't hurt to learn both. You'd be marketable because you would be more versatile with different languages. Again though, if you learn C# first, you can learn Java. If you learn Java first, you can learn C#. They're close enough where it wouldn't be very difficult at all to do both.

Edit: Also, depending on the area you live in, you may see one more than the other. Like for me, Memphis is a pretty big .NET market, but some of the larger companies, like Autozone, use Java. So it could be a regional thing as well, but yeah, learn both.

Link to comment
Share on other sites

  • 0

I go with "IcreBreakerG" comment above..

Personally i would prefer you to learn both..and .net is getting its shape better & "Developers" support is always the first priority at microsoft with greatest tools (like visualstudio, expression suites) & tighter integration in corporate environment (with Activedirectory, sharepoint, exchange etc)

Link to comment
Share on other sites

  • 0

We've been debating this at work for years. Here's the general concensus:

Java and .NET really need to be broken into parts: the language, the runtime and the library.

As far as Java the language goes, it's really behind in a lot of ways when compared to C# (and to some degree, VB). It's missing a lot of new constructs that are pretty much standard in modern programming languages. This is why we're seeing langauges like Scala and Groovy rise in popularity (both of these languages compile to the same byte-code as Java).

Where the runtime is concerned, Java's JVM and .NET's CLR are similar in a lot of ways. While the CLR may have some small advantages as it wasn't designed with only C# in mind (tail call optimization, for instance, is good for functional languages). The main difference (and the one that most people bring up) is that the JVM is multi-platform, while the only (supported) platform for the CLR is Windows. Mono is helping in this area, but it's still behind in performance and scalability when compared to Microsoft's CLR implementation.

The libraries are a more complicated story. The .NET class library is vast and rich. Just about everything you need to do is built-in, and features like entity framework, WCF, WPF, LINQ, and soon parallel extensions, and PLINQ make Java's class library look like a joke in comparison - but that's not really a fair comparison. Since Java is a more open-source oriented community, much of what is in the .NET framework is freely available to Java developers as add-on libraries. It typically takes a bit more time to find, install, and configure on Java, but usually you can find the same functionality in an open-source library.

In the end it comes down to what you need to do. If you need multi-platform, you pretty much have no choice but to go Java (until Mono catches up anyway). If you can live with using Windows, .NET/C# suddenly becomes a very viable option.

Now for my opinion:

I've been using Java web programming almost exclusively at my job for 5 years - until the last project I worked on was a client app, and we decided to go .NET. After using C#, LINQ, and Visual Studio, I'm finding it hard to go back to Java. Java as a language is really starting to feel archaic, and it's almost painful to use when compared to the richness of C#. I'm just starting to look into Scala, but it just looks too different to me (I've been using C-style languages for 12 years). I was hopeful that Java 1.7 would help things out, but it looks like it's not going to do much for the Java language after all.

Link to comment
Share on other sites

  • 0

Thanks for everyone's input, I have learned a couple of languages I am not starting from scratch if you would say, just was wondering what was the more dominate in the real world.

Link to comment
Share on other sites

  • 0

Each has its special place, but that has already been covered here. Some have suggested that you learn both, but I disagree with that. Learn one or the other and instead of wasting time fiddling with the other, invest that time in learning more of the platform you choose. Few companies will leverage both, so being a mediocre jack of all trades will not be as valuable as being well-versed in one of those two platforms. No one's interested in hiring a dabbler, myself included.

To directly answer your question, I think that focusing your efforts on .Net (and C# specifically) would be your best route unless you're really looking into getting into something more esoteric like mobile phone applications. Java has the allure of being cross platform, but in practical experience, there's still a lot of platform specific work to be done for anything but the most simplistic of applications. In agreeing with what others have said here, you'd be hard-pressed to not fall in love with Visual Studio. Eclipse is nice, but it can't compete with Microsoft's tools.

This is just my two cents.

Josh Usovsky

Link to comment
Share on other sites

  • 0
I am getting to the point where I need to focus on whether to look for careers in Java or .NET for when I get out of college. I was wondering for all of you that use these in the "real world" which of these two you prefer and which is most popular in the workplace.

Thanks.

Doesn't really matter. In either of those you'll be writing slow and bloated corporate style monster applications.

Link to comment
Share on other sites

  • 0

I personally dislike Java. .NET is a lot more powerful in the ways it can interact with the Windows OS as opposed to just using Java. Java's main strength is cross platform capabilities. In the best situations (where money isn't an issue) it'd be far better to write apps using languages like C/C++/.NET and coding them specifically for a particular OS simply because of their capabilities and speed (less bloat). In the enterprise environment (apps within a domain/network), Java has a lot of advantages though. I personally have only used Java for assignments but once wrote my own Base64 encoder/decoder with it following the specs, but besides that, I've stuck with C/C++ and .NET

It'd be best to learn both though if you can. If you only want to learn one for now I'd go with .NET first. And once you've mastered a language or two learning other languages isn't difficult. Mostly just figuring out (bing/google) equivalent functions to do various operations and knowing the general syntax of the language.

Edited by Se7enVII
Link to comment
Share on other sites

  • 0
Each has its special place, but that has already been covered here. Some have suggested that you learn both, but I disagree with that. Learn one or the other and instead of wasting time fiddling with the other, invest that time in learning more of the platform you choose.

There's no such thing as time wasted learning a language. It's like saying "don't bother learning how to use a hammer because most construction jobs will use an air gun."

Few companies will leverage both, so being a mediocre jack of all trades will not be as valuable as being well-versed in one of those two platforms. No one's interested in hiring a dabbler, myself included.

I'm not interested in hiring somebody that doesn't expose themselves to alternative methodologies. Experience with many languages lets you learn about unique approaches that simply aren't possible (or aren't easy) to use in your language of choice. Any halfway competent programmer (IMO) should be effective using at least 10 languages, very good with at least 3 frameworks, and a master of at least one.

I suppose that's the difference between "computer scientists" (ie: the people that slog out a 4 year degree including 'nonsense' like Psychology and Statistics courses) and "code monkeys" (ie: the Java-only-please-dont-take-away-eclipse-or-im-useless drones cranked out by 18-month trade school programs).

There's a place for both, but IMO as both a developer and a guy that managed a couple dozen programmers: the best programmers are always exploring new languages.

was wondering for all of you that use these in the "real world" which of these two you prefer and which is most popular in the workplace.

Why are you asking us? I'm not the one who's going to have to sit in front of C# or Java code all day and live with the knowledge that I'm using a language I hate.

If you're getting into programming as a profession then you're probably at the point where you have a good idea about what language 'feels' right: Focus on that one, and look for a job using it. IMO it's stupid to pick the language where it's easiest to find a job using it: if all you care about is how quickly you can find a job then you may as well start Applying at Wal-Mart: those guys hire anybody.

I've paid my bills writting both of those languages, today I write code using neither because I don't like Windows very much and I like Java even less. Good programmers can pick any language and find work: concentrate on being a good programmer.

EDIT: in terms of popularity, I know two people who sit in visual studio all day, one guy who sits in eclipse, and the rest write "non mainstream" languages: Perl, Ruby, Cobol, C/C++.

Web programmers I know are split between PHP, C#, and Java, or ActionScript/JS at the front end.

Link to comment
Share on other sites

  • 0
There's no such thing as time wasted learning a language. It's like saying "don't bother learning how to use a hammer because most construction jobs will use an air gun."

I'm not interested in hiring somebody that doesn't expose themselves to alternative methodologies. Experience with many languages lets you learn about unique approaches that simply aren't possible (or aren't easy) to use in your language of choice. Any halfway competent programmer (IMO) should be effective using at least 10 languages, very good with at least 3 frameworks, and a master of at least one.

There's a place for both, but IMO as both a developer and a guy that managed a couple dozen programmers: the best programmers are always exploring new languages.

Getting exposure to other languages is valuable, and part of that results in knowing the right tool for the job. Being able to use a hammer if you have to, or if it's quicker than using a nail gun, is important. However, if 90% of one's work will be done with a nail gun, there's little benefit to practicing intricate ballet and interpretive dance forms of nailing with a hammer. Use your time learning to be able to use that nailgun upside down, underwater, and with one hand. Having some exposure will help prevent every problem from becoming a nail just because all you have is a...nailgun. The best programmers stay informed by always exploring new languages, frameworks, and technologies, but if you want to be marketable, you need to know at least one of the big ones very well. It would be nice to know both Java and C# really well, but they are similar in approach and thus tackle mostly the same problems and your time will not be well-invested in learning both equally well. At some point it's good to pick a road where things diverge and make a deep dive into one technology or another.

"Effective" in at least ten languages? I don't know of any programmers that can sit down and immediately hammer out much of great value using ten languages. Most can build a house with one or two languages, a rickety shed with or oe two more, and a spice rack with a couple others as long as they have the web for reference. It's nice to know, but rare to need to be proficient with even three languages at any given time. Most of my guys come from a C++ or Java background and now identify as C# programmers. Many have some experience playing with functional programming languages and some (almost) relics like COBOL, but I don't consider that experience being "effective." Our clients' projects typically use some combination of C#, C++, Java, VB.Net, or Javascript and the occasional proprietary scripting language. Generally speaking, in a practical ROI/non-academic sense, time is generally better spent learning new enhancements to one's mainstream weapon of choice. Learning the Entity Framework and Linq is the cake. Learning Ruby or Haskell is the sprinkles on the icing.

A programming language is not a methodology, but that does bring up another issue of interest. One thing that's a fascinating study is that of programming methodologies. After you get your feet wet with Java or a .Net language, it might be beneficial for you to take some time to research development methodologies. Agile methods continue to gain steam, and one of the practices you can easily begin using on your own is test-driven development.

Link to comment
Share on other sites

  • 0

Out of the two, I would probably say C#. Visual Studio makes C# a dream to work with, and allows you to get a hell of a lot of code written very fast. However, it depends on what you will be doing. Java has a much broader spectrum of support compared to C# since you can write Java applications for mobile phones and even blu-ray players, whereas this is not possible (in all cases) for C#.

There seems to be much greater demand for C# in the industry as late, in both internal company application development and web systems using ASP.NET.

All that said though, completely writing off Java would be foolish, and it would be worth getting at least a small knowledge of it for comparitive purposes. A carpenter that can create furniture using glue and nails can use the right tool for the right job, a carpenter that can only create furniture using nails will only ever use nails.

Link to comment
Share on other sites

  • 0
Doesn't really matter. In either of those you'll be writing slow and bloated corporate style monster applications.

And guess what--that's fine with the corporate world, as developer time is infinitely more expensive than CPU time.

2 years ago, I've switched to C# after 12 years or so of C++ and haven't looked back. I work with people who have been coding since the 70's, and their thinking is the same.

Link to comment
Share on other sites

  • 0

For me both are a good programing language.

If you focus only on windows based application I suggest you learn C# because it designed to support .net framework which only work on windows based platform.

But if you choose to work with cross platform application you should try Java because it has it's amazing virtual machine which able to work on many platform.

Link to comment
Share on other sites

  • 0

Java vs .NET, IMO, boils down to which is available for the platform you're developing for. .NET was designed for Windows programming, and on that platform it blows Java out of the water. However, there are a LOT of other platforms out there; mobiles, onboard devices, Apple, Linux. And there's a Java VM for pretty much every processor and platform in existence. So .NET isn't always available, or the best choice. Use what's available and does the job best on the platform you're developing for.

If you're getting into programming as a profession then you're probably at the point where you have a good idea about what language 'feels' right: Focus on that one, and look for a job using it.
I'd not choose a profession based on your favorite programming language, but on what you want to program. For instance, I want to program games, and the language I hate above all is C++; however, C++ is the language of the gaming industry. Still, I prefer writing a game in C++ than writing some boring application in a much cooler language like C#. At the end of the day, the language is just the tool, and it's not the tool that makes the profession exciting, it's what you're building with it.

(And yeah I wish the gaming industry would move to C#, but that's not happening for a WHILE.)

Link to comment
Share on other sites

  • 0
I'd not choose a profession based on your favorite programming language, but on what you want to program. For instance, I want to program games, and the language I hate above all is C++; however, C++ is the language of the gaming industry.

That's a sentiment I can agree with.

The underlying theme is "write what you like not just what is popular".

Link to comment
Share on other sites

  • 0
I'd not choose a profession based on your favorite programming language, but on what you want to program. For instance, I want to program games, and the language I hate above all is C++; however, C++ is the language of the gaming industry. Still, I prefer writing a game in C++ than writing some boring application in a much cooler language like C#. At the end of the day, the language is just the tool, and it's not the tool that makes the profession exciting, it's what you're building with it.

Bingo! :yes:

Link to comment
Share on other sites

  • 0
Java vs .NET, IMO, boils down to which is available for the platform you're developing for. .NET was designed for Windows programming, and on that platform it blows Java out of the water. However, there are a LOT of other platforms out there; mobiles, onboard devices, Apple, Linux. And there's a Java VM for pretty much every processor and platform in existence. So .NET isn't always available, or the best choice. Use what's available and does the job best on the platform you're developing for.

I'd not choose a profession based on your favorite programming language, but on what you want to program. For instance, I want to program games, and the language I hate above all is C++; however, C++ is the language of the gaming industry. Still, I prefer writing a game in C++ than writing some boring application in a much cooler language like C#. At the end of the day, the language is just the tool, and it's not the tool that makes the profession exciting, it's what you're building with it.

(And yeah I wish the gaming industry would move to C#, but that's not happening for a WHILE.)

That's a very good post. I second that.

The fact of the matter when it comes to programming languages is that it's not as simple as "which one's better". There are many variables. Which one's better for what you're doing? Which one is supported on that platform? When it comes to games, which one's faster?, etc...

Link to comment
Share on other sites

  • 0
(And yeah I wish the gaming industry would move to C#, but that's not happening for a WHILE.)

At least it already started.

Check this video made in c# xna:

This proves that it's possible to make a full 3d game in c#.

Of course not crysis but close enough. I don't see why red alert 3 wouldn't be possible in XNA for example.

Of course the big companies will keep c++ for a long time.

But it's a start in the right direction.

Link to comment
Share on other sites

  • 0
This proves that it's possible to make a full 3d game in c#.

Of course not crysis but close enough. I don't see why red alert 3 wouldn't be possible in XNA for example.

Of course the big companies will keep c++ for a long time.

But it's a start in the right direction.

A Windows-only game would definitely be possible in C#, because .NET was designed for the Windows PC, on that platform it's almost as widespread as DirectX and has excellent performance.

On consoles, either .NET sucks (on Xbox 360) or just doesn't exist (every other console). So your C# game is pretty much stuck on PC. I think that's the #1 reason the game industry isn't moving to C# anytime soon. It's not so much performance as portability.

But performance is also a big concern. When you're trying to run Gears of War on 512MB of ram, which might not even be installed on hard drive, you've got to have perfect control over the memory you use, how you allocate it, make sure it's not fragmented, etc. The whole idea of abstracting away memory management to speed up development (which is one of the big advantages of using .NET) simply doesn't make sense for consoles. That is, unless your game doesn't stress the hardware anywhere its limits, which is the kind of game XNA targets.

Edited by Dr_Asik
Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.