views:

952

answers:

12

I apologize for the Flame War question but frankly I don't care about that. I know these are both good languages but I would genuinely like to hear everyone's opinion on what the better is for a beginning web developer who wants to learn to build great sites and web applications. Thanks for your help.

+4  A: 

Re C# - IMO, the more important choice is between ASP.NET and the more recent ASP.NET MVC, with my preference being the latter. MVC is quite comparable to a number of frameworks like "rails", where-as ASP.NET (regular) is just... unique ;-p If it was me, I'd look at ASP.NET MVC with jQuery.

Marc Gravell
Might also want to read: http://stackoverflow.com/questions/694226/
Marc Gravell
+6  A: 

I think both are good languages with clean, coherent and concise design and both would be a great choice as a first language to learn (unlike some other commonly suggested alternatives).

That being said, I don't feel that either of these make for a great web development language - they both have several drawbacks for that use:

  • You will probably use c# inside ASP.net which is a mess that will not allow you to learn neither good general programming skills nor good web programming skills (and I do believe the skill sets do not overlap all that much). C# as a web development platform is also bound tightly to Microsoft technologies and I have my issues with that.
  • For Ruby you will probably use Ruby on Rails which is a great MVC framework for web development but it has its own issues and is also very unlike current web development techniques as they are used in "the industry". It is also rather slow.

My suggestion:

  • If you want to learn general programming and design some desktop or server application, either would be a great choice though I will recommend C# first.
  • If you want to learn web development, then I suggest going with a more industry standard and also not a really bad language - which is Java using JSP.

P.S. - if you only plan on ever using one tool and be done with it, then either are good choices and I would recommend Ruby on Rails. My answer above is relevant if you want to be a good programmer and use this experience as a base for learning other technologies.

Guss
Re ASP.NET; ASP.NET MVC solves much of the ugly (which I agree exists in ASP.NET vanilla).
Marc Gravell
What would your suggestion be for a truly great web dev language besides Java?
Mackristo
Unfortunately I don't think there is such a thing - every current technology has many pitfalls. I think Apache eRuby is great, but its a bit slow and its rather hard to justify using it instead of RoR. Perl, as the original web language has many good frameworks, Mason is probably the leading one.
Guss
Lastly, Zope is probably the closest you can get to a great web development platform - it uses a fine language, has a huge and successful framework as well as management interfaces for all levels of developers, and many many extensions, libraries and complete products available.
Guss
Zope is rather big though and might be overwhelming to a new web developer, especially one not familiar with Python.
Guss
You do realize that ASP.net MVC has been open sourced by microsoft and the code is now included in mono meaning you are not bound to microsoft at all.
trampster
Note also that Microsoft's "open-source" license appears to give Microsoft the right to use any patents you happen to own if you release software under it.
Chuck
The ASP.net MVC "viewable source" initiative is not open source in any significant way. Daniel, please check your information: the ASP.net MVC license has the following flows:- You are not allowed to redistribute the source or your fixes to it.- You are not allowed to even use the source for anything other then reading it, unless you agree to additional terms.- If you want to use the code in any form other then reading, you must upgrade whenever a new version comes out, and you must run your code on MS-Windows.As thus, I don't see how mono includes the MVC source code- obviously they can't
Guss
+3  A: 

I'm a PHP developer, but I would definitely go with Ruby/RoR...

sluther
I don't like PHP and I don't use Ruby anymore. But given the choice between C# and Ruby, Ruby wins.
stesch
I hate to admit it but that last year or so I've been presiding over a large PHP application. I continue to be amazed that some people actually like this language. These days, I'm picking RoR as my personal preferred platform for small projects. Large things, Java hands down.
Trey
+8  A: 

Take a little time and play around with both and see what you like. I don't have any experience with .Net and C#, but for Ruby I recommend subscribing to the Rails screencasts at BuildingWebApps after a few basic tutorials on Ruby and Rails. They start with a very simple site and keep adding more functionality to it as the lessons go on. It's also free.

Pete
I think this is a good answer. All the other answers that make a case for or against one of these are usually very subjective. They are both good for developing web sites. I say try them both. See which is easier for you to set up, which you prefer programming with, etc.I had a similar decision between Python and Ruby and ultimately went with C# :P
metanaito
A: 

I'm going to say C#.

Ruby on Rails is a complete and basically closed technology stack from Prototype for Javascript to Rails for ORM on the backend. Now this can be good because it means that any Ruby programmer coming onto a project will know what to expect. But it's bad as well because fads change.

Just look at the rise of jQuery over the last 2 years. jQuery is becoming--if it hasn't already--the dominant Javascript framework, Now you can use jQuery with Ruby but the fit is a bit awkward since you're basically throwing away your Prototype integration.

One of the reasons C# and Java have been enduring is that the tchnology stack is basically pluggable so it doesn't really matter what today's fad is because tomorrow's fad will (probably) fit.

So of those two I would pick C#.

cletus
But it's more pluggable than you might think. Especially since Rails is absorbing Merb, which is all about letting you plug in your own parts of the stack.
Charlie Flowers
Personally I'm not convinced the Merb merger won't be a disaster for Rails but we shall see.
cletus
+4  A: 

I am a long-time C# developer who just jumped into Ruby and Rails about a year ago. I love Ruby, but I am going to say C#.

Why? Because I assume one of your main goals is to learn. Thing is, Rails and Ruby have so much metaprogramming power that the Rails framework does a lot of magic for you. And since it's magic, by definition you don't understand what it's doing.

In C# (and I'd recommend MVC), there's much less magic. If you want something done, you either do it or use the framework components that do it for you (using the same kinds of capabilities that you might have used to do it yourself). So you can understand what's going on.

As you get projects under your belt, you might come to resent the boilerplate or repetitive coding that any statically typed language makes you do. Then, perhaps you'll appreciate some of the magic in Ruby and Rails, because you'll understand what motivated it.

Charlie Flowers
I completely agree with you, and I wish this was a more common attitude. However, I don't think C# is a better language to recommend over Ruby for web programming. Ruby is a great language for web programming sans Rails. It's not like you can't do web programming in Ruby without Rails, much the same as it is in C#; it's usable on the web without MVC. I think Ruby without Rails is better for web development than C# without MVC.
Andrew Noyes
Yes, Andrew, I agree. I am not saying Rails is bad. I'm only saying that it has big chunks of "magic" that, while powerful, would obscure things for someone whose goal is to completely understand everything that is happening (and that is the best goal to have in the long run, I believe). And I agree, almost all of that magic resides in Rails, not Ruby itself. Ruby's magic is documented and consistent (the Eigenclass, mixins, etc.), and therefore does not obscure understanding (once you invest in learning it).
Charlie Flowers
+1  A: 

If you are thinking long term, than Ruby is the better choice because it is more platform agnostic.

You are bound to the Windows platform if you choose C#.

But whatever you do, either C# or Ruby are better than any web-only language. A project can have web and non-web parts. With Ruby being great for additional scripting.

stesch
ASP.net MVC has been open sourced by microsoft and will the code will be included in the next mono release. So you are no longer bound to windows.
trampster
While it's possible to use Rails on Windows, I've found that some components don't work as well on Windows as they do on *nix, since Rails was developed largely on Mac OS X and Linux. Not to mention, throughout the Docs they say "This might not work on Windows, get Linux", etc. In other words, in some cases it isn't any easier to use Rails on Windows than it is to use ASP.NET MVC with Mono.
Andrew Noyes
A: 

Seaside on smalltalk should be the starting point. Both Ruby and C# have too much cruft. In Seaside you're able to structure your code well, and there is nearly no accidental complexity, just the mess created by html, js, css and browser versions.

Stephan Eggermont
+1  A: 

Yes, Ruby had some issues. But version 1.9.1 already solved most important issues like native Unicode support and performance. The Ruby is now comparable to PHP and Python in terms of performance. And superior to them in other areas IMHO.

Ruby on Rails it is a full framework. Yes, it is much slower than simple PHP pages. But people shouldn't compare 4 wheels and engine with full featured car with air condition and DVD on board. Compare PHP Zend framework to RoR.

You'll stop worrying about RoR performance once you deploy some application and see real CPU utilization on your server. Then you'll start to worry about number of visitors ;-) and how to get things done as efficient as possible.

Currently I am developing serious RoR application and use jQuery. jRails allows to write RJS and this simple patch to test JS code generated by that plug in. But in few months Rails 3 (merge with Merb) will be JS framework agnostic and build in support for jQuery will be on the same level as for Prototype.

BTW I don't know very well C#. However few months ago and I had to write simple Windows application and I chosen C# for that task.

Greg Dan
A: 

I would see Ruby (or RoR as must people actually points to) rather than C# (asp.NET) because for one simple reason, I type less in ruby and I don't need to pay a lot of money for the software required for C# to run. Please may argue that C# could be run on free software but if you really tried those you would go back to Microsoft's offers. I agree that Ruby's performance may not be as good as C# but the development time required is definitely better than C#. If you really want the best speed coming from any language for huge scaling you should instead go with Erlang and the likes (Scala?), because those are the real scaling monsters.

If you let me choose Java or C# I definitely go with Java for the fact that Java have much more sensible choices and they also could work with each one. I also hated the days when Microsoft released new specs for asp.NET in every new version of the .NET framework.

itsnotvalid
+1  A: 

I am learning C# as well as Ruby/Rails. I would say learning Ruby on Rails is great because you get to learn how to "WORK" project. Learn rubyOnRails while learning to develop in Agile principle. However, learning C#/ASP.NET is also great because you get to learn how to "REALLY" program.

You get to learn how to program while you do C# Versus you get to learn how to deliver while you do RubyOnRails.

My experience is that I've learned C#, but wasn't able to deliver the project as I wanted. That's because as a near novice programmer, it is very easy to get stuck in details, rather than going forward with a result in mind. Learning RubyOnRails with an agile principle made me more productive and now I can apply the same principle while I'm doing C#/ASP.NET.

Moreover, learning RubyOnRails is relatively easier and once you've learn that, understanding ASP.NET MVC is much easier than those who've started from ASP.NET background.

zhac218
Excellent points. This sort of echoes what I've been thinking lately so it's good to hear someone else say it. Have you tried PHP at all? I've been sort of jumping around everywhere and sort of feel duty-bound to at least learn some PHP basics. SOOOOOO much stuff on the web is written in it.
Mackristo
+1  A: 

I'd choose Ruby with no hesitation. I worked with both on various companies, and Ruby (+rails) is way more fun to use. A lot of people don't take that into account when choosing a technology but I think this is important. If a developer wants to kill himself everytime he has to to some complicated code, this is not good.

Ruby always lead to look at my code and go "this... is.. AWESOME!" when C# I have the feeling that it's not as pretty and full of magic.

But then again, my opinion is really biased, C# is not that bad. It's just not as fun imho.

marcgg