views:

634

answers:

7

I'm not sure if this is the best way to ask this question but I'm in the very early stages of learning programming/development and there are a lot of things that I would like to do including web development and at some point when I have some proficiency, mobile development.

I started out thinking I would learn Java because of its overall pervasive presence in the world of development and especially with J2ME's saturation in mobile development. It seemed however that the .NET framework, specifically C# was better suited for web development given the whole system/framework.

It seems that C# would be a good compromise to a language for both web development and application development, and hopefully not a difficult switch to Java/J2ME given the similarities between C# and Java.

Java, it seems is not as convenient for web development in my very limited experience. It seems that there are comparatively fewer hosting providers.

My question is, is this an accurate assessment of Java? Is it just as suited for web development as .NET with hosts and frameworks? I know it's a great language but I'm just not clear on what the typical roadmap is for doing web development with it.

Apologies for the verbose question. Any input would be much appreciated.

A: 

Well, from what I see is that Java and C# both have a good share in the web development area. They're almost identical actually. You could start either way and have no problems in trying to learn one or the other.

I have seen a lot of development going on in Java both in web and desktop applications, so I don't really see whose got the upper hand.

Although it's off-topic, if you've just started learning about programming, I advocate on trying to learn C first. The insight needed to master that language early on will really help out in the future.

Julson Lim
+2  A: 

I've used both for web development. I currently use C#/.Net (and have for a while now), but that is not saying that it is the superior platform (or is it??). In the Java world I used Struts/Hibernate with great success to create web sites, and really had no complaints (performance was great, deployment was pretty straight forward). The .Net world has analogs such as Monorail/ASP.Net MVC and of course NHibernate, so you could create web apps in a very similar manner on both platforms.

I think the determining factor is going to have to come down to your own preferences. Are there things about the .Net framework that you find more appealing than Java? Do you really like developing in Eclipse, and don't want to shell out the bucks for Visual Studio? (Though, I should point out that SharpDevelop is a pretty nice IDE)

All very non-specific answers...a whole lot of "Use the Force Luke" kind of stuff, but really when its all said and done it is a personal choice, so go with whatever makes you happy.

ckramer
There are express editions of visual studio for free as well.
DaRKoN_
+1  A: 

Assuming you use Visual Studio, C# will do more (and be a little easier out of the box). You won't need to worry about installing external frameworks, or configuring anything. You can have a sample app up in seconds.

If you do not know ANY programming languages though, maybe it makes sense to start with something like php? You'll be up and running quicker than either, although it's easier to make sloppy code choices (IMHO).

If you want to get into large enterprise development on robust *nix servers, by all means learn Java. If you have no programming experience though, it seems unlikely that you'll be able to pick up enough Java to "trick" these enterprises into hiring you. Unfortunately the entry requirements for a php or C# developer are often lower.

Jess
Yeah, this external framework issue seems to be the thing holding me up in the sense that .NET has its system sort of determined and packaged whereas Java requires some comparing and then learning how those options will actually work together.
Mackristo
A: 

C#/.NET is easier to learn and develop in, but Java has the advantage of being open-source and cross-platform.

If I were in your shoes I'd start with .NET/C# (including ASP.NET MVC) and then later move into Java. Be aware that there are a lot of similarities, but also some major differences.

(I'm a .NET developer, but I'm also learning Java for a mobile project.)

jonathanconway
That's sort of what I was thinking. Along the lines of what someone mentioned earlier, .NET seems to have everything part and parcel with no further external frameworks to integrate. Ultimately, I would like to create Android or J2ME Apps and it seems C# is close enough to eventually leap from.
Mackristo
Yeah, I think Java is gradually growing to be more usable, especially with fairly standard libraries like Struts and Hibernate.
jonathanconway
+3  A: 

In addition to some of the remarks made already, there are other things to consider professionally:

  1. Enterprise software is largely dominated by Java because many large scale clients prefer to deploy on a UNIX environment and the .NET CLRs that are out there don't really agree with most IT shops of these large clients.

  2. Java is generally considered to be a more attractive acquisition target in the enterprise software space.

  3. Geographically demand seems to be disparate between the two. On the west coast, Northern California area, Java dominates. What you specialize in may dictate where you will find work.

If your interest is in building a consumer site, many consumer sites are built on neither Java nor .NET/C# these days. In addition to the old PHP standby - there is also Django/Python and Rails/Ruby worth considering. There are extremely mature solutions for deployment in all of these areas. I know this from experience.

IMO, the Rails stack is light years ahead of anything that is offered in the Java world which in most cases still requires you to stitch together a disparate platform and hope it plays nice (this is less of an issue with C#/.NET). The strongly typed languages themselves also tend to be more verbose than the Python/Ruby where you can take advantage of functional programming techniques such as clojures and lambdas.

Moving between languages is easy enough, but as is the case with programming, it's leveraging what's already been built - that's the tricky part. The language is 10% of the effort to true mastery. Knowing the vagaries of the framework you are using, the libraries, and understanding what's available is the tricky part. The Java Foundation Classes alone comprise of thousands of class files! It's important to master at least one platform before skipping about.

hyuan
+1 Very good advice IMHO, careful remarks on a complex issue
wds
C# 3.0 has good support for lambdas and closures.
ironsam
I echo the comments of ironsam .... there is a lot than can be read into for lamda expressions and functional programming in .Net 3.0. I have no idea what closures are sorry.
IbrarMumtaz
A: 

if you want to develop multi-platform take Java (and it JSP/Applet/Servlet)
if you want to stay with .Net (and Mono) take C# or maybe VB.Net together with ASP.NET

personally i will learn Ajax (as essential) if my existing knowledge was server side programming language (ASP/PHP/Python) especially PHP since it's Object Oriented and Multi-platform

Dels
A: 

.Net will be easier to start off with, but if that is your goal you might as well start off with PHP (yuck). Over the long run both can get the job done equally as well. If you develop websites the Microsoft way it will be a very straight forward path, Java has so many open source frameworks libraries that just choosing one can be daunting. I going to guess that Java developers make more money primarily be cause it dominates in enterprise web development arena. PHP programmers definitely make less.

I primary develop websites with the Java and would recommend it over .Net because there are so many free tools, application servers and frameworks for it. You can build a java site using Tomcat, Apache, MySQL, and Linux with out paying any licensing fees.

Don't go overboard and try to do everything at once.

Learn some Java and JDBC Build your site with JSP (Model 1), this will give you a feel for the platform. Then try out one of the frameworks like Struts, or JSF, you will be able to appreciate them much more by then.

BeWarned
Thanks so much for your comments. Is there a host that you would recommend for this route?
Mackristo
Checkout dreamhost.com. I personally use Amazon EC2 and boot up a server if I want to experiment with a globally available site. I am only charged when it is up and running.
BeWarned