Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Why isn't C# recommended more often?
8 points by naithemilkman on Dec 27, 2010 | hide | past | web | favorite | 20 comments
As a 'business guy' teaching myself to code, I have inadvertently started on C# due to the support group around me.

I always see ruby/php/python as the de facto recommended languages to learn if you want to start programming.

So my question is, why not C#? Is is because its not 'free'?

I'm starting to think that it doesn't really matter what language you start learning. Just start and you'll be 95% ahead of most people already. Especially if the intention is to develop a prototype/MVP and not attain CTO standards.

UPDATE While Im at it, how much of my C# knowledge can I port over to languages like Python/Ruby/PHP? From what I understand that knowledge of libraries are one of the time consuming aspects of learning a new language. Is is really that bad?

Tons of reasons:

- The write/build/test compile cycle is slow as f-ck

- C# isn't really all that supported outside of Windows, which sucks for server centric apps. Yeah, you can use mono, but why?

- C# is grossly verbose in contrast to ruby/php/python

- PHP is instant gratification. Change, reload browser, lather, rinse, repeat.

- Lack of open source libraries + libraries you have to pay for = suckage

Really, though, C# and .NET are the frontier of lowest common denominator developers. The kind of dudes that wear teva sandals with socks and tucked in short sleeve shirts. You can also call them copy and paste developers, because that's essentially what they are. Most of the innovation in the last 5 years has come from the open source camp, not the corporate drone MS army.

I used to be a .NET developer, btw. Wouldn't touch that shit with a 10 foot pole these days. Not a chance in hell.

  The write/build/test compile cycle is slow as f-ck
I work on a million LOC project that takes 3 or 4 minutes to build. If that feels too slow, you can selectively build projects. I'm not sure what your definition of "slow as f-ck" is, but it doesn't match mine. In exchange for compilation you get significantly better performance than you would with Ruby, Perl or Python.

  C# isn't really all that supported outside of Windows, 
  which sucks for server centric apps. 
  Yeah, you can use mono, but why? 
Why not mono? It works well, runs everywhere, it's fast, and there are a lot of people working on it to keep it up to date.

  C# is grossly verbose in contrast to ruby/php/python
Patently untrue with the addition of the dynamic keyword

  PHP is instant gratification. Change, reload browser, lather, rinse, repeat.
ASP.Net mostly works that way in .net 3.5.

  Lack of open source libraries + libraries you have to pay for = suckage
This is hit or miss, and the open source library story is not remotely as nice as Ruby, Python, Perl, Common Lisp, or Smalltalk.

Are you serious? 3 to 4 minutes is a lifetime.

3 to 4 minutes to recompile over a million lines of code is a lifetime? What size code base do you work with? If you write in a dynamic language, how long does it take all of your tests to pass?

Now I have to wonder if you're being serious.

yep. this is the same reason most JEE development sucks - constant restarting of your app servers during development.

why not "hot deploy"?

hot deploy doesn't work when you're working with other developers who are violating the JEE spec (mainly by starting their own threads.)

pain in the ass. for web dev , rails/php are better choices. for a beginner, they are really simple.

When was the last time you did some C# development? Things have changed and for the good. Web development on C# is quite a pleasant experience now with ASP.NET MVC. Lack of open source libraries? Almost all of my .NET development stack is open source libraries. Nothing comes close to Visual Studio as an IDE. To the OP, I would say C# is a solid language, worth diving into. Also, people who think C# is not free need to check out ECMA-334.

You have basically just thrown your biased opinion, making a lot of generalisations.

"The kind of dudes that wear teva sandals with socks and tucked in short sleeve shirts. You can also call them copy and paste developers, because that's essentially what they are"

I am shocked to see you get upvoted after making the kind of a statements that you did in your post. I expected better of HN.

still the same, man. the fact is it's hard to make it run on my mac and hard to find cheap asp.net hosting just prevent me and some other ppl loving it.

asp.net is a nice platform, i admit but i will still recommend php/rails for beginner.

How about next time, you refute me instead of voting me down. I will pit my 9+ years (since .NET 1.0 Beta 1) of experience with C# versus whatever you would like to bring to the table for discussion.

I'm not sure why you were downvoted either, but I suspect it's because you weren't very nice in your (very true) presentation of the pitfalls of using C# as a general purpose, learning language. Many people on HN don't respond well to anything that sounds angry, I've found (through being thoroughly downvoted myself).

I upvoted you, but cussing on HN is a serious turnoff to me. Usually, that would get a downvote from me.

I thought that you brought up accurate and true statements, even though they seem more like an argument against compiled languages as a whole.

C# is bad to learn first because you have to learn the IDE, you have to learn a lot of concepts up front, and you have buy-in to the way C# does things (static types, class hierarchies).

Where as over in the other camp, you can just write code and run it. There is more coding and experimentation rather than learning tombs.


hello.js: console.log("Hello World");

> node hello.js


hello.cs :

using System; using System.Collections.Generic; using System.Linq; using System.Text;

namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Console.WriteLine("Hello World"); } } }

Then compile it and run it.

One of these is more fun, and one of these is easier to document and write tutorials around. If you have to deal with this day in and day out, then one is going to be preferred.

C# is a decent language to use, and has evolved rather rapidly over the last few years. I remember in the 1.0 (and even PDC days) when C# came out as essentially a Java clone, and to find out about how to use classes I'd find the most help from Java documentation! Now it is a different beast, and has become more usable, and lots of the changes have made it more useful and faster programming.

Since 2.0 VB.Net has started falling behind, for example not getting the "yield" convenience that C# got. So on the MS provided languages, C# is continously getting better than VB.Net, and you'll hear even less advocacy for VB.Net!

That said, the .Net framework can be used with more interesting languages (my preferred one is a python-like language called Cobra: www.cobra-language.com) and the primary loss in the equation is the Visual Studio environment (although MS is making it easier to write language extensions in 2010 version). So you can use an excellent framework with many other languages.

So then what you are left with is the language itself. I can't speak for others, but the script-like syntaxes speak to my brain more naturally than C-like languages, and I have found that I am most effective in thinking in a language like python than I am with either VB.Net or C#.

Part of the appeal that python/ruby have is they typically come with the non-Windows OS a person might use. For instance Python comes out of the box with OS X and most *nix OSes.

You are right on the abstracting what you've learned. It is true for a general language family, and less so (but still helpful) when you cross families. By that, if you stay in the procedural/OO realm of languages, you'll notice lots of similarities, but if you branch out into functional languages it will be very different.

The issue of it not being free is part of it, but there are some other reasons as well:

-Not built in - python is included by default on all major Linux distros and OSX, as well.

-Interpreted languages have instant gratification, which is helpful in encouraging beginners.

-C# isn't often used for web programming, which many people on HN are focused on.

And you do have a good point; once you start, you become miles ahead of never learning anything about programming.

C# is free: I use Visual Studio Express at home (both C# & C++) when I need to build a desktop app and there's nothing I've needed that it couldn't do.

I see the issue as really being about what kind of programming you want to do. If I'm writing a Windows desktop app, my choice will be C# simply because it's easy, available and I don't need to learn a new GUI library. But it's the last thing I'd consider for a Web project.

OK, not always the last thing. A week ago I did a quick experimental Web based interface for some hardware we build here at work. It was my first .ASP project and I was amazed at how trivial it was to make a .aspx page backed by C# connected to a COM object that talked to the motion controllers. Say what you will about Microsoft; they do make the go-path easy!

It is available freely (free as in beer), but it's not an open source language (free as in freedom), which is the free I was referring to. Sorry about that ambiguity.

Actually C# (the language) is libre, it's an EMCA standard. The default implementation and IDE(the MS runtime & VS) is not libre, it's gratis, but Mono is fully free software (libre) and nearly fully compatible (both source and bytecode) with the MS runtime and will run on Windows, OS X and Linux.

I wasn't familiar with the language spec being open, thanks for pointing that out.

I agree with your last statement naithemilkman. Learning your first programming language will be the hardest part much like learning your first primary language. You will pickup all the basics and rules while learning how to think through a program. If you have a support group the knows and understands C# then that seems like a good choice for you.

I've really enjoyed learning and using C# myself and I try to keep out of the politics of one language or company versus another when it comes to the languages. It's helped me that I work in a C# web development company so I have a large support group as well.

You've already got the right idea, pickup one language and stick with it and you're on your way to developing those prototypes.

Never used C# personally, although I have considered picking it up. I am guessing that it is because C# is 'tainted' by Microsoft.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact