C# - Java

wand3r3r

Diamond Member
May 16, 2008
3,180
0
0
I've taken a various courses throughout school, they were always in Java (OOP) over the years. I have worked on several projects since then, primarily in C#.

Returning (or basically beginning) to Java my first impression is to turn back to c# (web, windows/wcf services etc.). The generics seem shoddy, LINQ, properties, the debugger (VS drag and drop, conditional breakpoints, all kinds of stuff), tuples, etc. which were so convenient for simple to advanced uses are all missing. To me it still feels like C# is more productive (less typing/plumbing), but that can easily be due to the lack of real experience in Java. It feels like going backwards in time. Everything in basic code seems more clunky. The stuff which I do is different and there seems to be plenty extra legwork (factories, mappers etc.) vs. the svelte .NET MVC which I am used to. I now understand the joke, life's too short for Java, as well as getter setter h*ll.

Lamda is copied there thankfully, at least in the newest SE. Looking forward it appears to be 2-3 years out to the next version so this is what it is for quite some time.

The main benefit appears to be the available frameworks, and of course license costs (visual studio, sql server).

I'll be glad to actually learn to use Java well since some of the others have quite a bit of experience so I'll see good ways to use it etc. I guess I'm at one of the dips where it's like a wth moment on the learning curve.

What I am really valuing from this all is learning to utilize languages, frameworks, etc. as what they really are, tools to an endpoint. I think the benefit of knowing alternative methodologies and languages will be a tremendous benefit in the long run, especially after several years of actual use in the industry after the very different academic world.

I'm just curious about your thoughts and experience. Perhaps the first "real" experience has made me biased, especially when it feels like transgressing backwards. I think my next goal is to try out an actual advancement like Scala or presumably F#, as well as python. Note that I do recognize that it's premature to form a strong opinion and am sure my opinion will likely change after a year or two.
 
Last edited:

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
13
81
www.markbetz.net
I've always felt like C# took Java and repaired all of it's problems. And despite the fact that I do almost all my work in python and Java now, I still think C# is the most polished language available for development at this time. Having said that, what does it mean if you aren't writing Windows desktop apps in WPF, or Windows Mobile apps?

Not much, is the answer. The reasons to use Windows and the MS stack on the server side, if you aren't running exchange and sharepoint, are rapidly dwindling. Windows desktop and mobile apps are still a viable market, but the company is getting nowhere fast on the mobile front. I just don't see where their ecosystem goes from here.
 
Last edited:

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
> and of course license costs (visual studio, sql server)

Don't forget Windows server license costs and maintenance headaches for publically-accessible servers.

We use Java / Tomcat for our Amazon cloud server instances which are linux server VMs. Linux rules the public web, Windows servers are mostly used for corporate in-house / intranet applications.

Java has eleventy million times the share of C# on mobile devices thanks to Android and the the ongoing failure of Windows Phone.

Java is mostly dead on the desktop, but many desktop apps are being replaced by browser-based server-storage apps.

If I were writing a corporate in-house app now (instead of "shrink wrap" consumer apps) I'd probably be recommending HTML5 on the client side instead of Java or C#. What to use for the server back end would depend on what code already existed and what databases / servers it needed to talk to.

I don't think C# is going away any time soon, but there seem to be more opportunities for Java developers right now.
 

wand3r3r

Diamond Member
May 16, 2008
3,180
0
0
Good points, thanks for sharing.

They both seem to have basically crested the peak (popularity and the role they play) and now it's a matter of time and what the future will bring. They both clearly have a little different role, and I agree that Java jobs are probably more common in general. That too depends on location, the two locations I am considering are a little different since one has a lot of C# jobs, whereas the other has far more Java jobs and few C# jobs.

I had always mistakenly assumed that Java was superior, it never even occurred that it might be inferior (in productivity & quirks etc.) and the politics around the language itself is a bit of a surprise (maybe more of an open source and old guru vs. new fashion thing). I'm glad to get the experience anyway and it will be interesting to see for myself once I learn more and get the exposure.

I had started using Microsoft Virtual Academy and it was always interesting to hear about the upcoming features, it really seems like C#/.NET is evolving and there are a number of interesting developments coming in the next year or so and the direction sounds promising.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
> the politics around the language itself is a bit of a surprise (maybe more of an open source and old guru vs. new fashion thing).

The gnu fanatics may be rabidly anti-C# but I suspect the rest of us just look at our servers running Linux and decide Java makes more sense even if the language is less polished and it means losing Visual Studio. Unless Azure takes off and/or MS slashes server licenses down to near zero I don't see Windows OS servers competing to serve the web any time soon.

I work on our Windows desktop apps, but they are native C++ not managed C#.
 

gdansk

Platinum Member
Feb 8, 2011
2,489
3,379
136
The JVM based languages is in many cases faster than CLR based, especially for anything web based.

But realistically, just use whatever you prefer (and can find a job using).
 

Obsoleet

Platinum Member
Oct 2, 2007
2,181
1
0
Yes another vote for Java from me. I'm primarily a Python fan and use it wherever I can. I work with C# now as well, mostly bug fixes, I'm not building new features. Anyone who has built a career on .Net should be diversifying out at this time. The good news is, those guys while they may have spent the last 10+ years hating Java, would find it an easy transition. Even if a few steps backwards. Not sure on Java 8 though.

I've always felt like C# took Java and repaired all of it's problems. And despite the fact that I do almost all my work in python and Java now, I still think C# is the most polished language available for development at this time. Having said that, what does it mean if you aren't writing Windows desktop apps in WPF, or Windows Mobile apps? Windows desktop and mobile apps are still a viable market, but the company is getting nowhere fast on the mobile front. I just don't see where their ecosystem goes from here.

On the money. Yet on this forum, in the minority view it seems (or the .Net diehards are very vocal).

I see a big difference in the .Net guys I work with, who came from the COM(+) days and straight C before that... and the guys reared in 2001-2014 on .Net. The latter are much, much more scared/protective of C#/.Net. There's a competency or confidence gap between the two groups, IMO.

Not much, is the answer. The reasons to use Windows and the MS stack on the server side, if you aren't running exchange and sharepoint, are rapidly dwindling.

One of the largest reasons IMO just went away, http://www.microsoft.com/en-us/news/press/2014/may14/05-29mayannouncementpr.aspx.

Java is unspectacular and verbose, but I'd invest in skills surrounding the JVM before CLR at this point.
Though .Net does have Xamarin (very pricey though, and I'd probably just do native Android and iOS if doing mobile apps), Unity (though you don't have to use C# there, there's also JS and Boo), and .Net Native looks very interesting. Though I think they're missing opportunities with .Net Native at this point. They're becoming at best, a development platform, but the money is in server licenses.

If I were a sole .Net guy, I'd be trying my hand at Java (for familiarity for the less adventurous and risk-adverse), or Javascript (for those willing to go down the web dev path). 3rd option is probably Python, but much limited market than Java or JS.
 

Cogman

Lifer
Sep 19, 2000
10,278
126
106
Yes another vote for Java from me. I'm primarily a Python fan and use it wherever I can. I work with C# now as well, mostly bug fixes, I'm not building new features. Anyone who has built a career on .Net should be diversifying out at this time. The good news is, those guys while they may have spent the last 10+ years hating Java, would find it an easy transition. Even if a few steps backwards. Not sure on Java 8 though.



On the money. Yet on this forum, in the minority view it seems (or the .Net diehards are very vocal).

I see a big difference in the .Net guys I work with, who came from the COM(+) days and straight C before that... and the guys reared in 2001-2014 on .Net. The latter are much, much more scared/protective of C#/.Net. There's a competency or confidence gap between the two groups, IMO.



One of the largest reasons IMO just went away, http://www.microsoft.com/en-us/news/press/2014/may14/05-29mayannouncementpr.aspx.

Java is unspectacular and verbose, but I'd invest in skills surrounding the JVM before CLR at this point.
Though .Net does have Xamarin (very pricey though, and I'd probably just do native Android and iOS if doing mobile apps), Unity (though you don't have to use C# there, there's also JS and Boo), and .Net Native looks very interesting. Though I think they're missing opportunities with .Net Native at this point. They're becoming at best, a development platform, but the money is in server licenses.

If I were a sole .Net guy, I'd be trying my hand at Java (for familiarity for the less adventurous and risk-adverse), or Javascript (for those willing to go down the web dev path). 3rd option is probably Python, but much limited market than Java or JS.

Heh. I was probably one of those .Net diehards. I've repented after looking at the jobs market and re-evaluating.

C# is a great language saddled to a crappy platform. Mono can work, but isn't as well supported as .Net in a windows environment. C#'s open source support isn't all that great, as a result we just don't have a whole lot of tooling or libraries for the language.

Java is improving slowly, but at least it is grabbing some of the better concepts from C# as it does it.
 

Leros

Lifer
Jul 11, 2004
21,867
7
81
I also vote for Java. It's cross-platform, has better libraries, and seems to attract better developers.
 

Fox5

Diamond Member
Jan 31, 2005
5,957
7
81
Java over C#.

Mono is a poor cross-platform option for .NET, considering it's missing many Windows libraries.
I've also encountered significantly more bugs in .NET than I have in Java libraries.

And Java is considerably faster than C#, and its alternative languages (Scala and Groovy mostly) are nice.

That said, if I was making a game, I'd probably do C# for Unity and Windows/Xbox support.
 

brianmanahan

Lifer
Sep 2, 2006
24,298
5,729
136
c# is better than java from a semantics/expressiveness standpoint, just because microsoft can do what it wants with the language without arguing with 14 companies (like oracle, IBM, google, vmware, etc), which happens with the java language committee.

but scala and groovy and clojure are JVM languages which are better than C#... and they are free

and they work with JVM libraries, which are free as well
 
Last edited:

Pia

Golden Member
Feb 28, 2008
1,563
0
0
Good point. I should have included that. The whole windows/xbox game ecosystem is nothing to sneeze at.

I don't think C# is an option in the XBox ecosystem anymore after MS eliminated their indie program? And I'm also not aware of it being used on a whole lot of serious Windows games, outside serving as a scripting language for Unity games. Game devs do tools like editors and asset pipeline stuff with it, though.

I haven't spent much time with managed code, but from the little I've seen, I concur with brianmanahan. C# is nicer than Java, but for random managed application development, I'd probably be looking at Clojure, Scala etc. since they are nicer still and are also truly multiplatform. I hate writing Java, it's just so clunky. Even C++ feels better.
 

cytg111

Lifer
Mar 17, 2008
23,517
13,090
136
Right tool for the job.

C# is the smoothest from an academic pov and Java the most roboust.

I have C# break on me with memory exceptions simply cause it can not GC fast enough and release it to the pool. Java will take a steep performance hit in that situation, but it will continue to run as long as theres memory to be freed.
I've come across many such situations where the Java part just feels alot more mature.

Java's strength, write once run anywhere is sort of also C#'s strength just inverted, you can do alot with C# fast cause it is so close to the Windows OS.

At the end of the day, for productivity in the workplace I'd choose Java. For home projects C#.
 

beginner99

Diamond Member
Jun 2, 2009
5,223
1,598
136
To me it still feels like C# is more productive (less typing/plumbing), but that can easily be due to the lack of real experience in Java. It feels like going backwards in time. Everything in basic code seems more clunky. The stuff which I do is different and there seems to be plenty extra legwork (factories, mappers etc.) vs. the svelte .NET MVC which I am used to. I now understand the joke, life's too short for Java, as well as getter setter h*ll.
...
The main benefit appears to be the available frameworks, and of course license costs (visual studio, sql server).

I guess if you work in corporate and develop for a specific platform (eg. windows) and have all the tools paid for I see your point. Now think of all the contractors and those costs for .NET start to add up. Also customer then must use Windows (server) instead of Linux and so forth.

In terms of Java being verbose, sucks when writing but can help when reading the code. Lambdas or stuff like list comprehensions from Python are cool to write but terrible to determine what it does later down the road. It's like ternary operator. Seems cool idea but then it's way harder to read and if/else and some Junior Devs won't understand it at all. Maintainability.

For getter/setter: Either use the IDE to auto-generate them or use http://projectlombok.org/ library which does the same by annotations (and much more):

@Data
All together now: A shortcut for @ToString, @EqualsAndHashCode, @Getter on all fields, and @Setter on all non-final fields, and @RequiredArgsConstructor!

So your classes will look very short!
 

Cogman

Lifer
Sep 19, 2000
10,278
126
106
I guess if you work in corporate and develop for a specific platform (eg. windows) and have all the tools paid for I see your point. Now think of all the contractors and those costs for .NET start to add up. Also customer then must use Windows (server) instead of Linux and so forth.

In terms of Java being verbose, sucks when writing but can help when reading the code. Lambdas or stuff like list comprehensions from Python are cool to write but terrible to determine what it does later down the road. It's like ternary operator. Seems cool idea but then it's way harder to read and if/else and some Junior Devs won't understand it at all. Maintainability.

For getter/setter: Either use the IDE to auto-generate them or use http://projectlombok.org/ library which does the same by annotations (and much more):

@Data
All together now: A shortcut for @ToString, @EqualsAndHashCode, @Getter on all fields, and @Setter on all non-final fields, and @RequiredArgsConstructor!

So your classes will look very short!

I have an irrational hate of lombok. Mostly because some tool of a developer decided that a core library (8 layers removed from our project) needed an outdated version of it so they could do @Logger in a single class. Now, we can't go to Java 8 because the version of lombok they used is incompatible and it is a nightmare getting everything up to date.

It really would have taken him less work to simply do the single line to create a logger than it took him to import lombok... grrrr...

Moral of the story? libraries should have few dependencies. of those dependencies, bytecode manipulation dependencies should NEVER be used. It only takes a single new version of java to make me hate the fact that you decided you needed the convenience of @Getter in your library.
 

beginner99

Diamond Member
Jun 2, 2009
5,223
1,598
136
I have an irrational hate of lombok. Mostly because some tool of a developer decided that a core library (8 layers removed from our project) needed an outdated version of it so they could do @Logger in a single class. Now, we can't go to Java 8 because the version of lombok they used is incompatible and it is a nightmare getting everything up to date.

It really would have taken him less work to simply do the single line to create a logger than it took him to import lombok... grrrr...

Moral of the story? libraries should have few dependencies. of those dependencies, bytecode manipulation dependencies should NEVER be used. It only takes a single new version of java to make me hate the fact that you decided you needed the convenience of @Getter in your library.

@Getter is probably a bad example but don't forget equals and hashcode which are especially crucial when using an ORM like hibernate.
I wonder why you can easily upgrade Java version and not library version? Lombok has been working with Java 8 for pretty much the whole year now.
 

Cogman

Lifer
Sep 19, 2000
10,278
126
106
@Getter is probably a bad example but don't forget equals and hashcode which are especially crucial when using an ORM like hibernate.
I wonder why you can easily upgrade Java version and not library version? Lombok has been working with Java 8 for pretty much the whole year now.


Our dependency graph looks something like this

A->B->C->D->E->F

Where our package is A and lombok was imported in F. B->F are all highly used packages throughout the company (all these package are internal). So to upgrade lombok I would have to release a new version of F and update the dependencies on F from packages B->E. But, and here is the fun part, B, C, D, and E depend on older versions of each library, so I can't, safely, bump up their version to the latest version without potentially introducing breaking changes.

And of course, because these projects are highly used, it is more than possible that my upgrading of dependencies will break some other project in our company.

Going to a new java version, on the other hand, is generally pretty safe and backwards compatible (so long as you aren't dealing with bytecode manipulation stuff).

One option is to just pull in a new version of lombok in our own package to force the dependency, but I'm not entirely sure what the changes are between lombok 0.11 and whatever the current version is and how that will affect our sublibraries. It is very possible that libraries B->E started using lombok since they got it from F.

But either way, it is a mess that never should have happened. Even in the case of Equals and Hashcode. Most IDEs can generate a pretty good equals and hashcode function, and for those that don't there are really good equals and hashcode builders in the likes of guava and apache commons.
 

brianmanahan

Lifer
Sep 2, 2006
24,298
5,729
136
I have an irrational hate of lombok. Mostly because some tool of a developer decided that a core library (8 layers removed from our project) needed an outdated version of it so they could do @Logger in a single class. Now, we can't go to Java 8 because the version of lombok they used is incompatible and it is a nightmare getting everything up to date.

It really would have taken him less work to simply do the single line to create a logger than it took him to import lombok... grrrr...

wow, i was gonna say

how hard is Logger.getLogger(MyClass.class.getSimpleName())?
 

postmortemIA

Diamond Member
Jul 11, 2006
7,721
40
91
Nice rant, things in Microsoft walled garden may appear better at first. But the cost of being locked up eventually overshadows few areas of refinement and improvements. At first visual Studio IDE seems better, more polished, than Netbeans for example. But then after few yrs of use ... you realize how much open source model of Netbeans has made it so good.

No conditional breakpoints? WTF? what IDE did you use? How about this, what profiler you used for C#?
May we remind you that generics were added later to C# based on what Java had?

C# surely has few advantages over Java. For me, it has better native look and feel and OS integration.
 

wand3r3r

Diamond Member
May 16, 2008
3,180
0
0
With a lot more time and experience I still have the strong preference for the concise and clean nature of C#, and I like where the (web ASP.NET webapi/mvc) direction is going. The whole ASP.NET rewrite that's coming out this year (ASP.NET 5) will probably change the performance aspects considerably.

I can see the draw of Java and the frameworks/libraries and I'll continue to use it as well. I can see that the verbosity isn't as important as I though initially, however I still haven't bumped into anything (thus far) which has changed my opinion to prefer the Java world over the walled gardens (perhaps scala could).

It is ironic to see .NET going open source and "somewhat" cross platform with Linux clients now and the cross platform mobile stuff. They also give away VS if you're under $1M in revenue or a small dev team now (community edition). Since I don't purchase the tools the $1k/2 years doesn't directly affect me, but I can see the SQL Server/Windows servers adding up to a company.

I think purely as a language c# is great. For the whole environment Java has a lot of libraries/frameworks which are invaluable depending on what you are doing, as well as the whole free (as in $) philosophy. I'd still like to maintain the agnostic view that these are all just tools and I wouldn't pick a sledge hammer to put a screw in. I have yet to experience something which doesn't have tradeoffs too though, it's just my personal preference.
 

slugg

Diamond Member
Feb 17, 2002
4,722
73
91
With a lot more time and experience I still have the strong preference for the concise and clean nature of C#, and I like where the (web ASP.NET webapi/mvc) direction is going. The whole ASP.NET rewrite that's coming out this year (ASP.NET 5) will probably change the performance aspects considerably.

I can see the draw of Java and the frameworks/libraries and I'll continue to use it as well. I can see that the verbosity isn't as important as I though initially, however I still haven't bumped into anything (thus far) which has changed my opinion to prefer the Java world over the walled gardens (perhaps scala could).

It is ironic to see .NET going open source and "somewhat" cross platform with Linux clients now and the cross platform mobile stuff. They also give away VS if you're under $1M in revenue or a small dev team now (community edition). Since I don't purchase the tools the $1k/2 years doesn't directly affect me, but I can see the SQL Server/Windows servers adding up to a company.

I think purely as a language c# is great. For the whole environment Java has a lot of libraries/frameworks which are invaluable depending on what you are doing, as well as the whole free (as in $) philosophy. I'd still like to maintain the agnostic view that these are all just tools and I wouldn't pick a sledge hammer to put a screw in. I have yet to experience something which doesn't have tradeoffs too though, it's just my personal preference.

I think you summed up my thoughts nearly exactly. I'd just like to add that I have a distaste for the Java language and a strong preference for C#. I believe C# is the leader in general purpose languages, and let's face it, Visual Studio is a programmer's best friend. I'm hoping that Mono and Katana/OWIN takes off makes people think twice about going with a Java stack.

That said, I pay my bills with Java. It's okay, it's fine. I'd say the only real advantage Java has at the language level is its @interface annotations. They're a lot more powerful than Attributes in C# and allow for some really awesome stuff. I've written entire DSLs based on annotations, which are handled by a DSL runtime engine in an aspect-oriented way.
 

Graze

Senior member
Nov 27, 2012
468
1
0
ws servers are mostly used for corporate in-house / intranet applications.

Java has eleventy million times the share of C# on mobile devices thanks to Android and the the ongoing failure of Windows Phone.

Android apps are written in Java but compiled to dalvik byte code.
There is nothing Java on itself Android.
 

Merad

Platinum Member
May 31, 2010
2,586
19
81
The reasons to use Windows and the MS stack on the server side, if you aren't running exchange and sharepoint, are rapidly dwindling.

How many major companies are there that do not use exchange/sharepoint/ad/etc? I would guess that tech giants like Google do not, but other than that... Yeah, the MS setup is fairly pricey for smaller business and isn't the new sexy that tech startups will use, but it is not going to die any time soon.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |