Hacker News new | comments | show | ask | jobs | submit login

I've spent most of my time in the open source world, and I would have to agree that C# on .NET feels like the most mature high-level software development tool I've ever used. C#'s biggest strength isn't the language. While the language is nice, there isn't a lot you can do with it in terms of productive development that you can't at least approximate in Java, especially with a good IDE to generate your boiler plate for you.

Where C# and .NET really shines is in its native integration and low level facilities. How many other tools in the world let you debug a mixed application containing both native and managed code, all in the same IDE and in the same session, with the ability to set breakpoints in either area, view values, do memory watch points, and so on?

It also feels so incredibly easy to call native code in C#. There's even a whole web site dedicated to making it easier, pinvoke.net!

Lastly, C# itself contains several performance-sensitive features that have no JVM equivalent, including value types, unsigned integrals, and unsafe code with raw pointers. The .NET platform even has an implementation of tail recursion , now, though the C# compile will not generate IL that uses it, which makes it inaccessible for most people.

When it comes to language design, C# is a little sloppy but it more than gets the job done. In terms of tools and low-level facilities for building a real-world application, C# on the Windows .NET platform feels absolutely world-class.

For my favorite language, I of course, voted for Scala!




> While the language is nice, there isn't a lot you can do with it in terms of productive development that you can't at least approximate in Java

There is no substitute for lambdas :)



your parent is suggesting that java does not have a substitute for lambdas.


Which isn't true anyway, since anonymous inner classes are just very verbose and awkward lambdas. (I'm a Java hater but I'm also a horrible pedant)


True. Then again, what's the practical point of lambdas that aren't concisely expressed?


There are plenty of practical uses: http://code.google.com/p/guava-libraries/wiki/FunctionalExpl...

Note that the Guava lib specifically points out how ugly this is.

I prefer Clojure.


What's the decision procedure for whether a certain expression is "concise?"


Horrible as in "no good" pedant?

Because, no "anonymous inner classes" are no lambdas. They are, well, classes kludgily used to mimic a lambda proper.


What it is to be 'a lambda' isn't particularly well-defined. If we define it to mean an anonymous closure then Java certainly has them — so long as its free variables are final (it closes over references). On the other hand, if we define it as the operator which creates anonymous closures, then Java doesn't, because you have to actually build the closure by hand.

Since the former have a proper name (closures) and the latter doesn't, I'd be inclined to call only the operator a 'lambda'. But since you can at least 'approximate' closures in Java (with anonymous inner classes), I think it's fair to say that they are "very verbose and awkward lambdas", to some definition of lambda.


lordlicorice (the ggp of my post) suggested that there is "no substitute for lambdas" and I was intending to correct that. Anonymous inner classes are definitely a substitute.


> It also feels so incredibly easy to call native code in C#. There's even a whole web site dedicated to making it easier, pinvoke.net!

I'm with you that C# is really nice to use, but interfacing with native code is a nightmare. The reason why a whole bunch of websites exist on pinvoke is because of its poor documentation and incoherent behavior.

As far as low level goes, I'm happy with C++ (if I were an embedded engineer I would say C but it is very nice to be allowed to use the C++ niceties). I think that everyone needs to have a language that can generate native code. On higher levels, python is fine for me. I simply do not have the use for an intermediate language like C# or Java, however nice they are.


> The .NET platform even has an implementation of tail recursion , now, though the C# compile will not generate IL that uses it, which makes it inaccessible for most people.

Sort of. It just so happens that the tail call optimization does get used on x64 platforms because of an implementation detail of the 64-bit JIT.

Source: http://blogs.msdn.com/b/davbr/archive/2007/06/20/tail-call-j...


How is this C#+.NET integration on mono? Are the relevant low-level facilities translated well into linux or osx?


I like Mono, and I respect the work that they've accomplished. It is incredibly difficult to build a runtime like .NET, especially as it was never designed to be cross-platform.

That said, the Mono experience on Linux is inferior to that on Windows. MonoDevelop is nowhere near Visual Studio, so that I just develop on Windows and deploy on Linux. Unfortunately, that doesn't help the fact that both the soft and hard debuggers for Linux are nowhere near Microsoft's debuggers. It also doesn't help the fact that the runtime itself is less stable (i.e., more prone to crash) and there are APIs that only work well on Windows. I would also imagine that the Microsoft runtime exhibits much better overall performance.

My understanding is that Mono mainly excels at MonoTouch, and that is where Xamarin is making most of its money, but I am not knowledgeable in that area.


It is incredibly difficult to build a runtime like .NET, especially as it was never designed to be cross-platform.

Just a historical note: The Shared Source Common Language Infrastructure [1] aka "Rotor" is an alternative version of the .net 2.0 platform developed by Microsoft for research/education use. It can be compiled for FreeBSD and Mac OS X 10. Its rather out of date, but maybe shows that MS did make some kind of effort to make it cross-platform.

[1] http://en.wikipedia.org/wiki/Shared_Source_Common_Language_I...


I remember working on Rotor when I was at Corel.

I'm glad to see someone still uses it:)


Even outside of .NET, it's got a tool built-in to make L"strings" 16-bit on all platforms, which is cool for portability (and an implementation of nmake for unix, which can also come in handy)


Do you know how it relates to Silverlight for Mac?


The FFI is still far better than most of the other FFIs for other Linux-targeting languages. Yeah, and MonoDevelop is not equal to Visual Studio, but it's a damn sight better than almost any other OSS IDE.


How does it compare to QtCreator, do you know?


In my opinion, I'd say Visual Studio > Qt Creator > MonoDevelop. Qt Creator isn't bad, but the debugging is not nearly as great as Visual Studio. For instance, adding a variable to a watch doesn't always work (as in, variables aren't always evaluated when you'd like them to be) and I can't just type a variable name or expression into the watch window, I can't always view the memory at an object's address, and sometimes I get incorrect values (which could be something with my configuration).


Don't know, but QTCreator is a C++ IDE (I think?) which makes it a non-starter for me.


You also can develop just in QML, which is really nice.


I use MonoDevelop every day with Unity. I sometimes hear other devs complaining about it, and saying how Visual Studio is so much better. I think back to the days I used to spend struggling with multi-project solutions in Visual Studio with all its warts and crashes and weird compilation bugs, and thank heavens I'm working with a light-weight IDE.

C# is my new favourite language, and MonoDevelop is a pretty decent IDE for what it is :)


In my experience, these are the problems with developing in MonoDevelop for Unity:

- The debugger is flaky. Sometimes it will miss a breakpoint completely. Sometimes trying to inspect local variables will crash MonoDevelop. Sometimes it will refuse to continue no matter how many times you tell it to.

- If your problem starts in Unity's native code, forget about trying to debug it. The messages are cryptic and the debugger is useless. This happens for some things you can diagnose (like running out of memory, either on the machine or the card)--although good luck figuring out what your memory hog was--and for other things that leave you completely stumped (shotgun debugging becomes your only recourse).

- Don't even attempt to use text search over multiple files (other searches, like reference searches, work fine). MonoDevelop will get stuck in an unproductive loop that never displays any results and never completes.

- Forget about profiling. Unity technically has a profiler, but it's per-frame, not cumulative. It also omits a lot of detail, especially about memory usage.

- There are also a number of minor issues, too, but they aren't deal breakers so much as annoyances.

That having been said, our particular project is rather good about pushing Unity to (and beyond) its limits, and you may never encounter any of these limitations. Still, it's worth knowing that they exist.

Footnote: These comments may be limited to the version of MonoDevelop that ships with Unity 3.3 (there are non-technical reasons why it's not worth our time to go through the effort to upgrade).


Most of those issues are with Unity not MonoDevelop, aren't they?

I hear you though - debugging Unity projects is a real toolchain weakness. I'm lucky if I can even get the debugger to connect.

Text search works fine for me though! I've never had a problem with it.

My worst problem with it actually is just stability, but I've never lost work with it and it restarts pretty quickly.

What are you working on, out of interest? (If you're allowed to say!) :)


  > Most of those issues are with Unity not MonoDevelop, aren't they?
True, but I consider them as one platform (Unity and its customized MonoDevelop, specifically).

  > Text search works fine for me though! I've never had a problem with it.
It's a weird bug that was probably unique to the 3.3 version.

  > My worst problem with it actually is just stability, but I've never
  > lost work with it and it restarts pretty quickly.
I get a lot of freezes and crashes too, but to its credit MonoDevelop definitely has a very robust autosave.

  > What are you working on, out of interest? (If you're allowed to say!) :)
3-d mapping (à la Google Earth, but with different goals).


The biggest improvements that VS2008 and VS2010 made over the previous versions is that it became much more light-weight, they did a lot of work to remove cruft. If you haven't looked at VS in a long while you might be surprised.


I think the last one I used was 2008. I'll have to have a look at 2010 sometime. Very happy to hear they've spent some time reducing the cruft :)


And no self-respecting developer would ever use Mono on nix anyway because the nix tools run circles around anything .NET/Mono.


mono works fine on nix systems (little bit of tweaking with grsec), a friend has developed a few programs that he has deployed to nix systems without any issues. Initially I was quite anti it, but what the heck, if it works it works.


I knew this would be downvoted by the predominantly Windows users here but, if they knew anything about *nix, they wouldn't do that.


You were downvoted because you made an argument without supporting it, and you were downvoted again because you complained about being downvoted and still didn't provide support for your argument.

From what I gather, HN isn't so much about being part of an "in-crowd" where you "just know" the way things are. You need to be willing to explain your arguments, otherwise you're just a snob.


I once worked on a virtual usb device project on linux with Mono, at least ioctl and pointers work well for me. Use Java for this? No...

Moreover, for maximum performance, mono provides facilities for users to embed native code into the runtime, much faster than Pinvoke.


Unity3d ships with Mono/C# and MonoDevelop as one of the programming language options for its game engine. I haven't used it as much, since I prefer the Javascript version, but most (if not all) high-end game developers opt for scripting in C#.


I'd be curious to hear, why.

I will be working on a Unity3D project and the team wants me to use C# with VS. As a Mac user and Open Source fan, I didn't jump at the idea. Glad to hear, that a lot of people think C# is a good choice. I'm excited to learn it!

Any suggestions for a good book or website? I've been programming in C and C++ quite a bit, but its been a few years. I've only been doing functional programming since then and would probably need a refresher on object oriented programming.

Can someone comment on the best development environment for Unity/C# when using a 2011 Mac Air with 4GB Ram? Should I install bootcamp, use Parallels Desktop or Unity+Mono under Mac OS?


The thing to realize is that the Javascript isn't Javascript. It just looks like it. Writing good Unityscript/Javascript is going to be only syntactically different from writing C# anyway. Unityscript/Javascript is well made, but there's a few edge cases that you'll only encounter once you've already written most of the project. And mixing the two languages is messy and limited.

For C# dev, it depends how hardcore you're going to be getting. Ultimately, you normally going to be scripting, not programming. getting familiar with the Unity3D API is of more use than learning high level features of C#. For instance, while C# is object oriented, >90% of the things you write will inherit from MonoBehaviour, and most of the rest are just fancy structs.

And I code on an iMac -- I use Unity natively, and the version of MonoDevelop it ships with. It works nicely!


I know nothing about developing Unity/C#, however, I know VS runs quite well under VMWare Fusion on a MacBook Air (with 4GB of ram).




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

Search: