views:

832

answers:

8

I feel I'm a well rounded programmer, I'm comfortable in C# and java (several large projects with both) but I tend to use C++ for most applications when I have a choice. (and sometimes R,Python, or Perl as appropriate..)

But I am astounded to see the popularity of C# here on SO. There are 18500 C# topics, more than C, C++, and java combined. I've never felt C# as having such an impact in the companies I've worked with but the SO popularity of C# is undeniable.

My question: Why is C# so popular on Stack Overflow? My question is not so much a SO question as a desire to understand C#'s current acceptance/growth compared to C++ and java.

Possible explanations for the popularity:

  • C# is truly that popular and accepted in industry, it's everywhere!
  • SO is not typical, it seems to have attracted a disproportionate number of C# users
  • C# has more questions/confusions that tend to need community help to solve
  • Microsoft (maybe on its forums?) encourages people to use SO for questions

The first explanation is likely the reason, but I just haven't felt that popularity in the real world!

What's your reason you discuss C# topics here?

A: 

It really just depends if you plan on working with windows. If you like linux or mac better then you probably want to use another language (although you could use Mono.NET). I just use C# because of 3 main reasons:

1) Easy to learn

2) Easy to use

3) Easy to deploy

But if you like a different language better then use it. Right now I'm learning C so that I can help contribute to some of my favourite open source linux apps.

Lucas McCoy
+13  A: 

I think the founders of SO are .Net gurus. Most of the people who follow their blogs found out about the site, and started coming here. The original user base was probably pretty .Net/C# focused.

I also think that C# is the preferred language in .Net with it's interop and ability to use old C and C++ code. Those familiar with C, C++, and Java can easily get a useful application built and working in C#, and be pretty certain it will run on any system with the proper .Net framework installed.

And, C# sounds cool.

scottm
C# does sound cool.
Lucas McCoy
That's exactly how I found this site.
Balk
While Jeff and Joel aren't exactly C# gurus, many of Jeff's friends were, and Joel is particularly popular in the Microsoft stack too.
Jon Limjap
@lucas, do you say "See Sharp" or "See Pound" or "See Hash"? I know the answer is C Sharp, but I've heard the other two!
SPWorley
I prefer "See Octothorpe". :)
Steve Fallows
Sometimes I like to pronounce it "See plus to the fourth power" as the octothrope can be split into 4 + signs.
JB King
+1  A: 

I think it's a combination of reasons 2 & 3. From what I've seen, C# is not as popular as Java, and it's probably not as popular as C++.

From where I live, most people use Java, followed by CPP, followed by C#.

Tian Bo
Mauricio Scheffer
thanks for the info, that's pretty much what I observe here (in Singapore). So to answer the question, C# isn't as popular as CPP or Java in general.
Tian Bo
+1  A: 

I've mostly avoided C#, because (a) I've got a silly prejudice about that glandular freak of a program loader masquerading as an operating system — I just don't do Windows, and (b) because it's so much like Java that I have trouble keeping them apart in my head.

That said, there's a lot of C# being done, and if I weren't an old crank it'd probably be a good language.

The thing is that C++ is riding without training wheels. This makes it much better for some things — I helped build the AS/400 operating system in C++, bare metal up — but not as good for the sort of application programming most people do most of the time.

Charlie Martin
You're not wrong to think C# is like Java -- it really is an indirect descendant, a result of the whole bru-ha-hah over Visual J++. In fact -- I'd wager that if Sun had adopted the changes Microsoft suggested to Java back when they did J++, C# wouldn't exist. But, such is the way of it. Now we have my favorite language, and I'm quite happy with it--a 100% convert from Java.
Randolpho
Oh yeah, but I'm an old Sun guy and write Java quite a bit. It's not that I think badly of C#, it's just that the confusion factor is too much. When forced, I now use F# -- .net without looking do damn much like Java.
Charlie Martin
@Randolpho: It's kinda cool to see how the to languages [C#, Java] are growing apart.
Lucas McCoy
C# 1.0 as a language didn't have much to differentiate itself from Java. However, with Linq and lambdas, idiomatic C# 3.0 can look much different from idiomatic Java.
RossFabricant
@Charlie Martin: I've looked into F# and I like it. Mostly it reminds me of python, and that's not a bad thing. :)
Randolpho
@Lucas Aardvark; @rossfabricant: Very very true.
Randolpho
It's not that C# is bad. But when I look at C# fragments, like here at SO, it's hard to tell at a glance if they're C++, C+, or Java. The syntax is just similar, and hard to keep straight. That and the fact that I just really never have occasion to use Windows (shudder) anyway.
Charlie Martin
I find it funny that the guy bashing Java above (stagnating) gets a +10 but you get a negative score for saying anything about C#...
Shane C. Mason
@Shane, best I can guess is that I said I didn't like Windows. But hell, I've maxed my score again today, I guess I can afford a few hits.
Charlie Martin
@Shane: Java *is* stagnating, and I'm not bashing Java by saying that, but Sun; who very rightly deserve it for sitting on their hands. IBM has done more good in the Java world than Sun ever did. Charlie, on the other hand, has an anti-MS bias that he fully admits is prejudicial rather than based on anything like fact. It is possible for a rational person to like C# and Java, to be capable of understanding the nuances of *nix and Windows.
Randolpho
@Charlie Martin (re: syntax): I dunno why; it's almost always clear to me whether I'm looking at C#, Java, C++, or even Javascript or D -- all of which have similar syntax but pretty clear differentiators. For one, they each have a different naming convention -- C# is PascalCase, Java is camelCase, C++ is lowercase, for example. There are other glaring indications like #include or imports or using. Then there's framework class names... I could go on. Maybe you're just an old crank after all. :)
Randolpho
@Randolpho, it's also possible that after dealing with Windows and DOS for, what, 20-some years -- hell, it's got to be at least 25 -- finishing my PhD work, teaching computer science, writing device drivers for OS/2 and bare metal code for AS/400, being one of the first Java people outside of Sun, then a Java architect *inside* of Sun, that I have real technical reasons to think Windows is excrementous and to avoid it.
Charlie Martin
But now look at what I *said*, ie, that I don't do much in that environment but that it's probably a good language. Your complaint is that I don't like Windows. Well, it's better than the other day, when I was accused of being a Communist for pointing out Windows' architectural security issues. But are you sure you're defending a technical point?
Charlie Martin
A: 

I guess that is partly due to people knowing of the site thru Jeff Atwood's blog, and Joel Spolsky's website.

Although their writings are not technology specific, it has a slant towards MS stack and hence the site is popular among developers working on MS suite of tools/languages.

Once the site becomes more popular and gets ranked high in google for questions on other tools, it will have more questions on those topic as well.

shahkalpesh
+1  A: 

Is atypical.

C# is very popular but StackOverFlow is by no means a reflect of the industry-wide.

Dup: Why is there such a large percentage of C# questions?

Related: Why does Ruby seem to have fewer projects than other programming languages?

OscarRyz
+11  A: 

I wrote about the popularity of C# on another thread, but to discuss why it's popular on SO, I'd say others have the right of it. C# is popular here because most of the people who first came to SO did so following Jeff Attwood's blog. That's certainly how I came here.

The thing is, SO really is language neutral, even if it's written in C#. Both Jeff and Joel have programmed in other languages and are hardly bigots when it comes to language; they just chose C# because it really is an amazing language to program in.

Comparing C# to Java and C++, the growth has been astounding. C# when it was first introduced was basically Java with a better GUI library (Win.Forms beats the ever-lovin' snot out of Swing any day, IMO, and WPF is heads-and-shoulders above both) and a few extra concepts, the biggest of which was delegates and properties as first-class citizens. Since then it's grown meteorically, constantly adding newer and better things. The entire concept of LINQ has drastically changed the way I approach iterations; couple that with WCF for contract-based inter-process/computer communications and WPF for a truly amazing way to build GUIs, and you've got a rock-solid language and library.

Hell, WCF alone makes .NET the correct enterprise/SOA choice.

By contrast, Java hasn't released a new version in, what, 5 years?

C# is innovating. Java is stagnating. C++ is... well let's call it "stable", shall we? The newest version, which is dubbed "C++0x" will soon need to be called "C++1x". The features that are planned require so many changes to the runtime that you're almost going to have Java or C# when you're done anyway so why bother?

Finally, to answer your last question, I come here to answer questions about any topic. I mostly prefer to deal with abstract problems rather than language-specific issues, but I'm always willing to help regardless of language. Just because I love C# doesn't mean it's all I know. :)

Randolpho
The "x" in "C++0x" is a hex digit. :-)
Dan
Yes. That's what it must be. :)
Randolpho
A: 

Note that stackoverflow is written in C#...

robi