Java or ASP.NET C# for web development

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

beginner99

Diamond Member
Jun 2, 2009
5,320
1,768
136
But it's HOW you do those things that makes a difference. Say you wanted to pick a DAL/ORM. Your main choice for Java is Hibernate, which is quite good. A lot of Java lovers ported it to .NET, called NHibernate. Then Microsoft really polished up Entity Framework. It's very nicely integrated with Visual Studio, so development is super duper easy. Using it is super duper easy. Start with code, a db schema, or diagrams/design first.

You can generate entity classes from DB Schema in Netbeans too (with a nice wizard) or the opposite have hibernate create it from your model.

Entity Framework is just one example in particular, but you get the point. Overall, C# and the whole .NET platform has been polished and improved one step ahead of Java. Last time I checked, Java still doesn't have class properties, when even the crappy Objective-C does.

This properties thing is mentioned everywhere and it is a non-issue. You can generate getters and setter either by IDE or use a 3rd party tool like lombok. The latter requires 1 class level annotation to auto-generate getters and setters for all fields in the class.

I can guarantee you that task for task, I can shorten an 8 hour day to 7 or less if I get to use Visual Studio over other IDE's. I feel like I get pretty much double the throughput versus Xcode, and probably 1.5x of Eclipse. Spend more time developing and less time fiddling around with the stupid IDE.

of course you can work faster with a tool you know much better.
 

beginner99

Diamond Member
Jun 2, 2009
5,320
1,768
136
I should probably also point out how much easier it is to deploy an ASP .Net web app than it is to deploy a Java web app using your IDE of choice.

This link is an example. It takes this guy 150+ steps and over 8 hours to do a "Hello World" web app in Java. That is probably a bit exaggerated, but the underlying point is true. It is much easier to get up and running with ASP .Net than it is with Java. The flexibility of Java also adds layers of complexity that most people just don't want to deal with when the .Net equivalent "just works" right out of the box.

It's not a bit exaggerated. it's blown out of proportions by orders of magnitude. You actually have to try hard to come up with such a stupid set of steps or need to be mentally retarded.

Netbeans can be installed together with Java and it comes with tomcat, installs it and it is a 1 click thing to run the web app.

http://www.youtube.com/watch?v=IHTYBS7_-lc

(Not a great link because I don't understand the guy but it shows my point).

This can be setup in less than 15 min. if you did not fall on your head multiple times as a child like the guy in you link obviously did.
 

Ancalagon44

Diamond Member
Feb 17, 2010
3,274
202
106
This properties thing is mentioned everywhere and it is a non-issue. You can generate getters and setter either by IDE or use a 3rd party tool like lombok. The latter requires 1 class level annotation to auto-generate getters and setters for all fields in the class.

Yes but its still irritating and much slower to do. And all those getters and setters end up bloating your code unnecessarily.

Think about it - to add a variable with getters and setters in Java, I need to add the variable, then right click on the class file and navigate to the getters and setters thing. Then select the variable and if I want getters and setters, and where I want them to be inserted. Then click OK.

With C#, I type
public String MyProperty {get;set;}

Takes about 2 seconds.

Its a small thing, but it adds up. C# is just far more polished than Java, and VS is far more polished than any other IDE. VS is renowned as the best for a reason.
 

beginner99

Diamond Member
Jun 2, 2009
5,320
1,768
136
Yes but its still irritating and much slower to do. And all those getters and setters end up bloating your code unnecessarily.

Think about it - to add a variable with getters and setters in Java, I need to add the variable, then right click on the class file and navigate to the getters and setters thing. Then select the variable and if I want getters and setters, and where I want them to be inserted. Then click OK.

With C#, I type
public String MyProperty {get;set;}

Takes about 2 seconds.

Its a small thing, but it adds up. C# is just far more polished than Java, and VS is far more polished than any other IDE. VS is renowned as the best for a reason.

As said with lombok this can be done with 1 annotation and it does not clutter your code because it's not visible there:

http://projectlombok.org/
 

Ancalagon44

Diamond Member
Feb 17, 2010
3,274
202
106
But thats the point, like someone said earlier. Out the box, VS is the best. I dont need to install a single plugin.

Netbeans or Eclipse and Java require plugins to get anywhere near that good.

Where is Java with lambda expressions?

When will I be able to write:
var users = Users.Where(x => x.FirstName == "Joe");
?

Its about saving the programmers time, and MS does that very well.

EDIT:

Lombok is a step in the right direction, but compare this:
User.Age = 13;
with
User.setAge(13);

Everywhere I want to use a User's age, whether it is to set it or get it, I just use User.Age. Thats it! So much cleaner!
 
Last edited:

douglasb

Diamond Member
Apr 11, 2005
3,157
0
76
Java 8 is supposed to add lambda expressions. But as usual, Java is several years behind C#.
 

postmortemIA

Diamond Member
Jul 11, 2006
7,721
40
91
But thats the point, like someone said earlier. Out the box, VS is the best. I dont need to install a single plugin.

Netbeans or Eclipse and Java require plugins to get anywhere near that good.

Where is Java with lambda expressions?

When will I be able to write:
var users = Users.Where(x => x.FirstName == "Joe");
?

Its about saving the programmers time, and MS does that very well.

EDIT:

Lombok is a step in the right direction, but compare this:
User.Age = 13;
with
User.setAge(13);

Everywhere I want to use a User's age, whether it is to set it or get it, I just use User.Age. Thats it! So much cleaner!
You don't need any plugins for Netbeans. Full featured installer comes with everything. It is obvious that you haven't used it for a more than few minutes, if even that. Actually I need a plugin for VS because version I got do not support SVN out of the box.
If you think that setting the property of object is the best feature of the programming language, let it be. Be happy in your ignorant world.

I can give you many many counter examples how Netbeans/Eclipse are better IDEs, in things that they excel at. Truth is that both have advantages, and you are better off if you know both & know what they are. VS advantage is tight integration of things that it support, and debuggers are great. Disadvantage is limited number of things it can do. Open source IDEs thrive on ideas of contributors, which are often great, innovative, cutting edge and not found elsewhere. Disadvantage of them is some cutting edge features may be buggy.

For example, Netbeans C++ support lets me see a call graph of object-oriented function:
http://programmers.stackexchange.com/questions/33365/on-the-fly-graphical-representation-of-code

While VS will let me see reference list of all functions of the same name, even if they don't belong to right class, which then takes time on my part to find which ones matter.
 
Last edited:

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
While VS will let me see reference list of all functions of the same name, even if they don't belong to right class, which then takes time on my part to find which ones matter.

You can also easily get a list of all callers into or out of a method in VS.

It's not the lack of functional capabilities that irks me with Eclipse. It's the little bugs that Microsoft's money is able to polish out. For example, in the ADT (Android Eclipse bundle) if you click to debug and it appears to start launching the app, but nothing actually happens, check to make sure you have the top node of the project highlighted in the package explorer. Little crap like that is more common in Eclipse than VS. I also really don't like the whole "aspect" oriented UI.
 

Obsoleet

Platinum Member
Oct 2, 2007
2,181
1
0
It should be noted that Visual Studio isn't free, as Netbeans, Eclipse and most everything else is. Express versions are neutered, you'll need the full version eventually. Unless you get it from work you'll eventually have to shell out the $500 to start and every year if you want to upgrade. Not bad if you're making a lot of money off of it, but with the decline of Windows-specific code it doesn't make sense today.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
It should be noted that Visual Studio isn't free, as Netbeans, Eclipse and most everything else is. Express versions are neutered, you'll need the full version eventually. Unless you get it from work you'll eventually have to shell out the $500 to start and every year if you want to upgrade. Not bad if you're making a lot of money off of it, but with the decline of Windows-specific code it doesn't make sense today.

Absolutely true. Every piece of open source software that I use is impressive just because it exists.
 

Obsoleet

Platinum Member
Oct 2, 2007
2,181
1
0
Don't forget Xcode IDE. If you have a Mac, Xcode is free as well. 1 purchase.
To get VIM, Eclipse, Netbeans, Emacs you need a computer. 1 purchase.

To get VS you need a computer with Windows7, then VS itself. 2 purchases.
If you want VS2012 and you aren't using Windows7, you'll need your computer, a copy of Windows 7, and then VS itself. 3 purchases.

You can see where this is going. And it's not like it gets any cheaper down the road. Not to mention it's usually cheaper to host on *nix servers than Windows, even 3rd party.
While C#/.Net/VS has its perks.. I'd go with Java unless you have some sort of business critical reason to require the MS stack. Jumping into it in this market at this point seems silly to me.
 
Last edited:

beginner99

Diamond Member
Jun 2, 2009
5,320
1,768
136
Don't forget Xcode IDE. If you have a Mac, Xcode is free as well. 1 purchase.
To get VIM, Eclipse, Netbeans, Emacs you need a computer. 1 purchase.

To get VS you need a computer with Windows7, then VS itself. 2 purchases.
If you want VS2012 and you aren't using Windows7, you'll need your computer, a copy of Windows 7, and then VS itself. 3 purchases.

You can see where this is going ($$$). And it's not like it gets any cheaper down the road. Not to mention it's usually cheaper to host on *nix servers than Windows, even 3rd party.
While C#/.Net/VS has its perks.. I'd go with Java unless you have some sort of business critical reason to require the MS stack. Jumping into it in this market at this point seems silly to me.

very well said! Fully agree. And that's why I think there are so much more libraries, toolkits and frameworks available for Java. It might be an less polished language compared to c# (I mean c# is typical MS, take something good and polish it) but you will find a good, maintained library for almost any problem out there. Most of the time the main work is "integrating" all the libraries you need and your done.

Especially for hobby projects .net makes no sense.
 

TechAZ

Golden Member
Sep 8, 2007
1,188
0
71
Don't forget Xcode IDE. If you have a Mac, Xcode is free as well. 1 purchase.
To get VIM, Eclipse, Netbeans, Emacs you need a computer. 1 purchase.

To get VS you need a computer with Windows7, then VS itself. 2 purchases.
If you want VS2012 and you aren't using Windows7, you'll need your computer, a copy of Windows 7, and then VS itself. 3 purchases.

You can see where this is going. And it's not like it gets any cheaper down the road. Not to mention it's usually cheaper to host on *nix servers than Windows, even 3rd party.
While C#/.Net/VS has its perks.. I'd go with Java unless you have some sort of business critical reason to require the MS stack. Jumping into it in this market at this point seems silly to me.


Eh, I think that's stretching it to favor Java. Counting Windows 7 as a purchase? Counting 3 purchases in some instances? Who's going to buy a PC that doesn't have Windows 7 on it? And how can you count Windows 7 as a purchase? (I'm not a professional developer DISCLAIMER).
 
Last edited:

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
And XCode is free with a Mac and OS X. You'll pay the Apple tax on that Mac too. My Mini at work has a nice design. but cost about $200 more than the Acer mini-ITX i3 PC I use for my music server.
 

Ancalagon44

Diamond Member
Feb 17, 2010
3,274
202
106
You don't need any plugins for Netbeans. Full featured installer comes with everything. It is obvious that you haven't used it for a more than few minutes, if even that. Actually I need a plugin for VS because version I got do not support SVN out of the box.
If you think that setting the property of object is the best feature of the programming language, let it be. Be happy in your ignorant world.

I can give you many many counter examples how Netbeans/Eclipse are better IDEs, in things that they excel at. Truth is that both have advantages, and you are better off if you know both & know what they are. VS advantage is tight integration of things that it support, and debuggers are great. Disadvantage is limited number of things it can do. Open source IDEs thrive on ideas of contributors, which are often great, innovative, cutting edge and not found elsewhere. Disadvantage of them is some cutting edge features may be buggy.

For example, Netbeans C++ support lets me see a call graph of object-oriented function:
http://programmers.stackexchange.com/questions/33365/on-the-fly-graphical-representation-of-code

While VS will let me see reference list of all functions of the same name, even if they don't belong to right class, which then takes time on my part to find which ones matter.

Actually I used netbeans for about a year. I was working a Java game using the netbeans based jMonkeyengine SDK. But thanks for the insult.

There were some things about Netbeans that I liked - its autocomplete was in most cases better than visual studio. But overall, I feel Visual Studio is the better IDE. It is simply more polished.

Likewise, I feel that C# as a language is more polished than Java.

My point with properties is precisely that - its a trivial simple thing which should be simple to implement in a language. And I think its a big time saver. C# has lots of such time savers, things that save programmers time. And its all built in. Delegates, lambda expressions and properties. No plugins, no third party libraries, all just works out the box.
 

BigDH01

Golden Member
Jul 8, 2005
1,631
88
91
Having worked with Netbeans/Ruby, Eclipse/Java, VS/C#, and now Intellij/Python, I can say honestly that VS/C# is my favorite combo. I now write apps where that stack isn't available, but I personally prefer C# over Java and VS over any other IDE I've used.

I recently just downloaded the Express version to try the MVC web api. I would probably still go Sinatra/Ruby for something new, but the newest version of MVC/EF/Razor is damn nice IMO.