News for hackers. Stuff that matters.
Re:C# is the language of the year, Python of the decade by misnome on Tuesday January 01, 2013 @10:52AM (#4992827)
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.

Re:C# is the language of the year, Python of the decade by nahname on Tuesday January 01, 2013 @01:02PM (#4993255)
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.

Re:C# is the language of the year, Python of the decade by tshepang on Wednesday January 02, 2013 @05:17AM (#4996032)
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.
Re:C# is the language of the year, Python of the decade by Locke1689 on Tuesday January 01, 2013 @06:17PM (#4994430)
FYI, C# is not an MSR project.
Re:C# is the language of the year, Python of the decade by noblethrasher on Tuesday January 01, 2013 @07:00PM (#4994571)
No it's not. But generics came straight out of MSR while LINQ was heavily informed by Cω, an MSR research language.
Re:C# is the language of the year, Python of the decade by dbattaglia on Tuesday January 01, 2013 @11:00AM (#4992852)
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.

Re:C# is the language of the year, Python of the decade by eogas on Tuesday January 01, 2013 @11:57AM (#4993023)
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.

Re:C# is the language of the year, Python of the decade by TheMakeA on Tuesday January 01, 2013 @12:37PM (#4993179)
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.
Re:C# is the language of the year, Python of the decade by pixie_ on Tuesday January 01, 2013 @01:54PM (#4993464)
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
Re:C# is the language of the year, Python of the decade by dbattaglia on Tuesday January 01, 2013 @09:26PM (#4994999)
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).
Re:C# is the language of the year, Python of the decade by lucian1900 on Tuesday January 01, 2013 @11:02AM (#4992860)
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.

Re:C# is the language of the year, Python of the decade by virmundi on Tuesday January 01, 2013 @12:08PM (#4993068)
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.

Re:C# is the language of the year, Python of the decade by jbester on Tuesday January 01, 2013 @02:28PM (#4993599)
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.

Re:C# is the language of the year, Python of the decade by jbester on Tuesday January 01, 2013 @02:57PM (#4993715)
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.

Re:C# is the language of the year, Python of the decade by zanny on Tuesday January 01, 2013 @12:26PM (#4993134)
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.
Re:C# is the language of the year, Python of the decade by profquail on Tuesday January 01, 2013 @12:10PM (#4993076)
You can use MonoDevelop to develop C# projects on Mono:

http://monodevelop.com/

Re:C# is the language of the year, Python of the decade by virmundi on Tuesday January 01, 2013 @12:17PM (#4993105)
I'll take a look at that now.
Re:C# is the language of the year, Python of the decade by pcl on Tuesday January 01, 2013 @04:03PM (#4993965)
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.)

Re:C# is the language of the year, Python of the decade by skrebbel on Tuesday January 01, 2013 @03:24PM (#4993833)
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.
Re:C# is the language of the year, Python of the decade by meaty on Tuesday January 01, 2013 @12:03PM (#4993045)
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.
Re:C# is the language of the year, Python of the decade by rprasad on Tuesday January 01, 2013 @01:55PM (#4993467)
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#.

Re:C# is the language of the year, Python of the decade by jebblue on Tuesday January 01, 2013 @02:20PM (#4993561)
>> 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.

Re:C# is the language of the year, Python of the decade by tinco on Tuesday January 01, 2013 @06:23PM (#4994449)
That precise promise is why they are precluded from suing.
Re:C# is the language of the year, Python of the decade by lmm on Tuesday January 01, 2013 @05:31PM (#4994283)
>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.

Re:C# is the language of the year, Python of the decade by kvb on Tuesday January 01, 2013 @09:42PM (#4995043)
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...

Re:C# is the language of the year, Python of the decade by meaty on Tuesday January 01, 2013 @02:33PM (#4993615)
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.

Re:C# is the language of the year, Python of the decade by adandy on Tuesday January 01, 2013 @03:23PM (#4993830)
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?
Re:C# is the language of the year, Python of the decade by rbanffy on Tuesday January 01, 2013 @08:19PM (#4994804)
Curious: what were you using before?
Re:C# is the language of the year, Python of the decade by misnome on Wednesday January 02, 2013 @05:46AM (#4996104)
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).