Hacker News new | past | comments | ask | show | jobs | submit login
C# is the language of the year, Python of the decade (sites.google.com)
84 points by tshepang on Jan 1, 2013 | hide | past | favorite | 71 comments



I recently started using C#, having not programmed for windows in years, and have to admit I'm greatly impressed by it. It really feels modern, well designed, and very flexible and powerful, in too many ways to list.

Unfortunately, I'm finding the .NET libraries that I'm using not quite so well designed - Working with windows forms specifically. Fortunately, a lot of the third party libraries seem pretty well designed, though seems to be a general love-affair with overly verbose XML configuration files. Perhaps I'm just spoilt by the elegance of UIKit (well, most of it), and the clear benefits from a ground-up design.

I know there is Mono for other platforms, but don't know how well it is supported/what the performance characteristics are like, but it seems a language that would really, really benefit with a truly platform-independent (i.e. not a thin win32 wrapper) set of libraries; GUI and otherwise.


C# truly is one of the diamonds in the Microsoft software dirt heap. It is unfortunate that there isn't something Microsoft sanctioned like UIKit for dotnet. However, I think ReactiveUI (http://www.reactiveui.net/) is quite close and reasonable popular.

This does lead into the other serious detriment for dotnet, open source. There is very little going on there because the majority of the community doesn't actively engage with new libraries or frameworks that don't come out of Microsoft itself. Hence, why I say it's too bad something isn't sanctioned.

It probably doesn't help that if Microsoft did deem it worth supporting something like ReactiveUI, their history shows that they would just rebuild it themselves. Effectively destroying the OSS.

Overall, Microsoft is improving. Just look at the changes they are making to support ASP.NET MVC as an open source project. They are just a lot slower than everyone else right now. Their research department might help them keep a few things ahead (like C#), but for the most part they are behind the curve.


Luckily, the Stack Exchange guys open source some of their creations: http://blog.stackoverflow.com/2012/02/stack-exchange-open-so.... I would expect that they are of good quality, given the reputation of the company.


FYI, C# is not an MSR project.


No it's not. But generics came straight out of MSR while LINQ was heavily informed by Cω, an MSR research language.


From the Windows/Client UI side, I think you may want to check out WPF. Winforms is exactly what you said, a thin Win32 wrapper in .Net (which is why I found it easy, already knowing some C Win32 APIs and MFC). WPF takes some times to wrap your head around, I still haven't done it, but it seems like a better way to go.

Of course now we have Windows 8/WinRT so who knows what's going to happen to WPF.


WPF is definitely the way to go. I started a modest sized project a few years ago at an internship, and this past summer I was allowed the task to move it from Forms to WPF. Let me tell you, working with WPF is so much better. Especially when you get into anything custom. Custom drawing in Forms is always a hack, and you basically have to do it in code. WPF is essentially designed to make creating custom controls with custom drawing incredibly easy.

Not to mention all the awesome databinding stuff, and now with async in C# 5, it's easier than ever to create responsive UI. Just reading about the async stuff had me thinking back to that project, saying "yeah, that would make [some chunk of the code] a lot more intelligible".

I contribute a lot in the /r/learnprogramming subreddit, and when new programmers are asking about UI with C#, I generally suggest just skipping Forms. There's really no reason to use it anymore. I can't believe I used it so long while WPF was right there, ready to free me of the Forms peril.


Definitely this. Use WPF if you can. I don't recommend trying to use WPF "as is", but suggest reading about the MVVM pattern and the available frameworks, particularly Caliburn.Micro and ReactiveUI.


WPF does take time to wrap your head around because it's more complicated, and in a lot of cases writing business apps (which most straight windows apps are) there is no need for all the 'power' WPF provides. WinForms is easy to develop using just the GUI designer. WPF you often need to mix your development between the form designiner and the XAML code itself. It's a needless headache. Also WinForms GUI designer translated the design into straight C#. The WPF->XAML->C# conversion isn't readily accessible, or editable by the programmer and is the source of a lot of complexity and confusion. Often typos in XAML can bring a whole application crashing down with not much of a clue to the source of the bug. /rant


The xaml/designer issue is pretty much what stopped me from diving too far into wpf. Usually if I'm doing Wimdows apps these days it's some utility/internal tool for work, and it's just sooo much quicker for me to whip something up in winforms ( with a nice easy click once deploy). But for something customer facing I would definitely spend the time to learn wpf. I believe the Github GUI app is WPF and that has a pretty cool interface that would be tricky to pull off in winforms (on a side note, I felt really cheesy at first using it over the command line but now I'm hooked).


If you're using C# or similar, the only reasonable choice is to always use Mono.

Just use the cross platform and open source runtime, as you would for any other language, and pretend that .Net doesn't exist.


Serious question, I'll come back through my comment log to look at replies I promise: what tools exist for C# on Mono? I've used VS. I use Eclipse. I refuse to leave an IDE. I've never liked debugging from the command line. Any help here would be appreciated since I really like C#'s sense of balance and embracing newer ideas from the functional side of the house.

Thanks.


Ximian has a plugin (http://mono-tools.com/) that lets you remote deploy/debug mono applications from Visual studio - it was free after a survey not sure if it still is or if it will be updated to vs 2012.

There are other tools sharpdevelop (for window) and monodevelop (all platforms) - but they are somewhat lacking. Sharp develop seems to slow down dramatically on large projects or WPF projects. Monodevelop seems to lag sharp develop in features and maturity.

GUI toolkits for dotnet are hit-and-miss. GTK# has the most traction and is cross platform - the documentation was lacking last time I looked. But, if you have a GTK background it may be a non-issue. Wx and QT bindings exist but I believe development has slowed down/stalled. Of course, there are OS X, android and iOS bindings that ximian sells. Unless you have a large existing c# code base it probably doesn't make sense to use them for greenfield development.

Server-side is where I think mono actually does shine a bit. Although you need to move out of the standard NetFX stack (i.e. WCF) to other open source libraries (i.e., ServiceStack). ASP.NET and MVC do run on mono - there are tutorials to deploy against apache or nginx.

As you can imagine there is some lag between mono and microsoft dotnet framework (see http://www.mono-project.com/Compatibility). The gist of it mono tries and succeeds keeping up with the framework but there are large holes with respect to .NET 3.0 (WWF, WCF, WPF). There was a silverlight plugin (moonlight) but much like silverlight new development has stopped.


I should add: the value proposition for mono is a bit bizarre.

On the server, typically mono is chosen because mono on linux is much cheaper than azure, or windows hosting (AWS, etc) therefore you trading slightly more development and setup effort for cheaper run-time costs.

For the phone/tablet market, you are doing the opposite trading money (monotouch licenses) to save development time and learning a new platform.

On the desktop, I think the value proposition is much less well defined. It depends alot of the mix of clients you are supporting.


Xamarin has a full application suite to complement it. I'd say since 2010 it has been perfectly mature. The C# runtime on Linux is slower than the Oracle JVM though, but about as fast as the OSS JVM from the statistics I last saw.


You can use MonoDevelop to develop C# projects on Mono:

http://monodevelop.com/


I'll take a look at that now.


Visual Studio + ReSharper is a dream come true. As someone who learns by doing rather than studying, ReSharper's refactorings and inline code reformatting suggestions was an invaluable source of idiomatic C# knowledge (second only to great code reviews from one of my C#-clueful coworkers). And Visual Studio's debugger lets you move the program counter backwards, which is just awesome for interactive REPL-esque development.

(No, I'm not a JetBrains employee -- just an avid fan of every product of theirs that I've used.)


There's no need to ditch Visual Studio at all. For instance, if you use VS with TestDriven.Net, you can run your tests on mono straight from VS. I believe there's also a way to debug mono from VS, but can't recall how and don't have VS available right here.


Or just use java and benefit from mature libraries and frameworks, tooling and package management that isn't a piece of shit. Your insurance is the openjdk then rather than a thinly veiled promise not to sue from Microsoft.


Stop spreading FUD.

That "thinly veiled promise not to sue" is backed by the full force of a legally binding promise recognized by the combined weight of the US and Euro legal systems. Microsoft is, by centuries of established law and court decisions, precluded from suing someone from using C# through Mono or any other API or framework.

Moreover, using Java is now riskier than using C#, as Oracle has changed the licensing terms for the language, the API, and the development tools to allocate to itself greater legal control over the Java IPs than Sun did (or which Microsoft reserves as to C#).

EDIT: Just so we're clear, to all the non-lawyers and non-legally savvy HNers: The promise not to sue is itself what is binding, as a consequence of more than two centuries of US and Euro law (see, e.g., the concept of promissory estoppel). The point of the promise was to clarify the permissive license to use Microsoft's IP as it relates to C#.


>> Microsoft is, by centuries of established law and court decisions, precluded from suing someone from using C# through Mono or any other API or framework.

Then why did they feel compelled to "promise" not to sue:

http://www.linuxinsider.com/story/67537.html

If you're correct then all they needed to do is point to your statement that no court will allow them to sue.


That precise promise is why they are precluded from suing.


>That "thinly veiled promise not to sue" is backed by the full force of a legally binding promise recognized by the combined weight of the US and Euro legal systems.

Have you got a source for that? AIUI under UK law the concept of promissory estoppel only exists in the context of an agreement in which the other party has received consideration. Not having paid MS anything, I don't see how that can apply here.


In the US, my understanding is that consideration is necessary for contract formation, but by contrast promissory estoppel applies only when there is no consideration. A quick perusal of Wikipedia's coverage of the topic [1] makes it look like the UK's treatment is roughly similar.

[1] http://en.wikipedia.org/wiki/Estoppel_(English_law)#Promisso...


No its not actually. The scope of the legal agreement is undefined and may or may not encompass bits of the framework which mono implements or may implement in the future. So don't count on it, which is what our rather expensive lawyer told us.

OpenJDK is GPL.


Some portions of the framework are not covered by the promise but Miguel mentioned something about Xamarin still having some kind of protection the project had when it was at Novell. Does anybody have any information that can prove/disprove this?


Curious: what were you using before?


I haven't been developing for windows, but I'm most comfortable in Python, Objective-C and C++, having used all three for work.

I haven't used C++11 yet, because the project I work on is tied to an old compiler version, but the one thing I found when doing some iOS development this week was that I really, really missed the declaration type inference (var).


I don't think I can agree that "{{language}} tutorial" as a measure of "growth" is valid. When I am looking to learn a language, I don't Google for tutorials because you end up with mostly worthless information and maybe a single result that has any value -- and 9 times of 10 that result is on the website of the language, so my query becomes "{{language}}". Further, as I'm learning a language, I'm more likely to Google for a language or API reference than I am for tutorials on how to do particular tasks X, Y, and Z. That leads me to write queries like "mdn {{some DOM/HTML/JS/CSS thing}}", which oddly enough, are also the same kinds of queries I write when using a language I'm entirely proficient with.

So in that case, I don't think a general "{{language}} tutorial" accurately represents the growth of a language. Perhaps interest, but this isn't limited to programmers, either, which makes me feel like it's even more misleading. For instance, the only time I entered "python tutorial" into Google was when I wanted to see a quick few basic programs to get an idea of whether or not I'd like the language. I don't really use Python personally (<rant>never will, it's terrible</rant>), but I've hacked around in it at work, and I never once used "python tutorial" to get my work done. I think one was "python reference urllib" which took me directly to the python reference page for urllib.


You missed out on a statistics lecture.

It does not matter whether you or anyone else in particular searches for "{language} tutorial" as long as there is a significant amount of people who do, and that amount of people is roughly the same percentage for every language to get an accurate estimate of language popularity.

And for estimating popularity growth the percentage does not even have to be the same across languages.

For these estimates to work the only thing you need is something that clearly identifies user interaction with that computer language. The internet is big enough to allow this to work for even very small percentages.

That said, I don't agree with "{{language}} tutorial" as a measure of language learning popularity. This is because a lot of the growth from the Java programming world comes from formal schooling. Almost every college or university teaches Java, it could be that the percentage of people learning Java through tutorial is significantly less than other languages.

edit: downvoted because I am very wrong for a reason stated in that nice comment below >_>


Am curious about the rant part?


Isn't the title a bit misleading? According to the chart, Java is the most popular language of the year (and the decade, if you take a look at https://sites.google.com/site/pydatalog/pypl/PyPL-PopularitY...).


First line of the article: "C# had the highest growth in popularity this year (2.3 %), and Python the highest growth this decade (8%)". One of their key metrics to determine popularity is growth.


> One of their key metrics to determine popularity is growth.

I would think one of the key metrics in determining popularity would be popularity ...


It is. I'd think that's fairly clear and obvious from the languages they were comparing.


Wouldn't a language that goes from 0 users to 1 user within this year easily win this sort of measurement?


They must be taking only established languages. Otherwise Clojure, Scala or Go would probably beat them all in term of growth.


Not really. The language of year is the one with the largest growth of "popularity share". C# has gone from 8.2% to 10.5% this year, while your presumed language would go from 0% to 0.0000001 % : not a big increase, really.


Obligatory xkcd http://xkcd.com/1102/



I find it hard to believe that some newer, smaller language communities did not have a higher growth rate.


"One of," not "only."


Furthermore, the growing of C# seems to be the almost same as C++ in the worldwide trends (not only USA):

http://www.google.com/trends/explore?hl=en-US#q=Java%20tutor...

And also there you can see that India is still the biggest searcher of programming tutorials in the world.


In addition I would like to point out that according to TIOBE C is the number one language of the year and C# dropped a place. http://www.tiobe.com/index.php/content/paperinfo/tpci/index....


That's inline with what I'm seeing. Were dropping .net slowly as it's simply unpredictable to manage costs and the staff quality in London to be honest is shit.


It all depends on the definition of popular. This is not to be confused with widely used.

Much more interesting (and catching the Zeitgeist) metric will be:

"Languages (and tools) the top 5% developers prefer to use when left on their own"

From anecdotal evidence Python is indeed somewhat high ranked there.


Quite deservedly so, you can't argue with statistics!

Anyway, I saw something interesting in the graph. If you just look at C and C#, then in 2011 you notice that where C made a sharp decline, C# made an almost equally sharp incline.

Are these movements correlated? What happened in 2011 that made a bunch of wannabe (since they look for C tutorial) C programmers suddenly turn to wannabe C# programmers?

I realise it may very well be two randomly occuring uncorrelated events that causes these jumps. But I'm very much interested in what kinds of events move the worldwide interest in programming languages.


Probably the end of older generation COM C++ stuff that is being pushed to .net (server 2k appears to have finally bit the dust in corporates) and reasonable maturity of WCF.


> reasonable maturity of WCF

Being a user of WCF, I'm sorry to say, it's terrible. Don't ever make the mistake of thinking WCF is fit for production.

This goes for pretty much the whole C#/.NET ecosystem. The Microsoft tools are severely lacking in good design principles and the open source tools are amazing and life changing but don't have the mindshare to be revolutionary. This is mostly just a fact of Microsoft being unfit for open source workflows.

Instead of WCF, try ServiceStack (or SignalR if it makes sense). Instead of ASP.NET MVC, try NancyFx or FubuMVC.


Oh I completely agree with you and were moving to java slowly. All in saying is that WCF is about the most mature thing that shifts SOAP on windows which is the backend of most of our integrations unfortunately (they are corporates mainly).

If i had my choice, I'd do it in Go.


The entirery of the centralized European visa, asylum and police systems runs on WCF and C#. These systems are used constantly every day by a large part, if not the majority of European embassies, consulates, immigration ministries, foreign ministries and police departments. Not ready for production?


That something is used in production does not mean it is fit for production.

Do you have any sources that confirm that this system is in fact reliable?

That all of Europes police departments, foreign ministries and embassies use this for international communication puts it at the scale of a smallish web application.

The people that use these systems come from a system where data like this is requested by telephone and supplied per fax. If WCF were slow and unreliable they'd probably still take it for granted, everything beating the old way of doing stuff.


If these systems were not reliable the 500 million tourists visiting the EU last year would not have been able to get a visa or not be able to pass border control points. That's just the visa specific parts, so yeah you could say it's somewhat reliable.

The users being used to telephone and fax being the reason they are okay with WCF? Maybe in the 80's, but it's been a while since then.

We are talking 10 mill+ daily transactions as a low brow estimate. A transaction in this case being a bit more complex than the page viewing of a cat picture. These are systems with dev and maintenance teams of hundreds and hundreds of deveLopers globally, working for 5-10 years. To refer to this as the scale of a smallish web app, well...


That's not much. We handle that every 7-10 minutes and these are complex quoting, transformation, credit scoring and CRM functions. WCF has been a big problem for us.


That's great that you handle such an amount, congrats I guess? But you are seriously saying that 10 mill+ transactions every day is similar to a smallish web app?

And would you really say that a technology handling such an amount of transactions in such a critical setting is not ready for production?


Yes our entire financial platform depends on WCF but the OP is right - its not reliable. We've had unpredictable latency, crashes, hideous bugs and configuration hell.


The reason for my stern words is that there are crashing bugs that have caused us a lot of headaches. For one, if something goes wrong during serialization/deserization, the response crashes and no status code or error message is returned. So aside from the trademark Microsoft unintelligible design, you also have to deal with crashing bugs that won't be fixed for years, if ever.


I wonder if that's when Google started recognizing that "C#" wasn't a typo of "C". :-) C# has always been a PITA to search for (although, maybe not as bad as 'Go').


"I wonder if that's when Google started recognizing that "C#" wasn't a typo of "C". :-) C# has always been a PITA to search for (although, maybe not as bad as 'Go')."

When searching for Go related information, use "golang" instead of "go".

e.g., golang channels; golang web sockets; golang slices; etc.


Far more interesting than the language itself is the "Regional Interest" for the different terms on the Google Trends site:

http://www.google.com/trends/explore?hl=en-US#q=Java%20tutor...

India is far ahead of every other country for all of these tutorial searches. eg for Java, India is search index 100, while USA is only search index 11.


I'm not sure why people don't also look at job sites to see language popularity. I quickly compared a few languages here http://www.zappable.com/2012/12/job-market-for-programming-l... but one could do a more in-depth analysis.

I created a chart with some more languages in this Google Doc: http://bit.ly/UBuI02. Java seems to be by far the most popular, though C# seems to be pretty high-demand too.

One could probably compare different job sites to see why they have somewhat different rankings. Also, I wasn't sure how to search for C (and even C++) without getting C# results too.


I am looking at the chart and I see C# as third and Java as first.


They're using a mildly questionable 'growth as popularity' for their measure. It has its uses, but does skew things quite a bit.


I don't understand how searches for '{language} tutorial' is a better metric than TIOBEs. The results of a metric like that would likely under-represents Objective-C in particular, because Objective-C classes are namespaced with the NS prefix and don't require additional search terms. For example, to find code for doing string reversal in C#, I'd need to search for 'C# String Reversal Tutorial' but for Objective-C, I could just search for 'Reverse NSString'.


From the #code2012 poll on twitter C# is 8th where it was last year: http://www.ioncannon.net/projects/code2012/ Not that it is any better a stat than Google searches but the number one language from the poll was Javascript and I tend to think that from a use standpoint that is probably "the language of the year" if there is one.


This is misleading simply for the fact that java and python are taught heavily in college over php, college students that need extra assistance will "google" tutorials, php is not taught in many colleges, if you add wordpress tutorials, drupal tutorials, and joomla tutorials to the mix you will see a totally different picture


Perhaps C# is a particularly terrible language and people need to search for tutorials more.


This is because every university in the world teaches Java first to newbie programmers


Is it really though?


we're 3 years into the decade. lets review in 7 years, ok?




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

Search: