8 ms·
The future of .NET
- Meai 14y agoWhat it would take for me to consider .NET/C# more often, is easier interop with C. I really like the way Golang does it, I know P/Invoke isn't terribly hard, but it's still messy and you have to muck around with attributes and annotations. In Golang I did some interop by simply pasting lines and names of header files around. That's a lot more convenient than having to decide how to layout a struct, at least that was my impression when I looked into it. Mono documentation is very sparse as well, they basically tell you to just look for the msdn docs, which splits your efforts up and makes you uneasy whether you'll run into Mono specific things. (which there are)
- lucajona 14y agoIf Go already does C interop easily, what other factors make you want to consider using .NET instead?
- Meai 14y agoExisting API support, frameworks, libraries and IDE support.
- migueldeicaza 14y agoGenerics, iterators, functional-style programming, LINQ, asynchronous programming, dynamic, Reflection.Emit are the things that I would miss.
- jstclair 14y agoYou raise a good point: is there something like http://pinvoke.net/ http://pinvoke.net/ for non-windows interop? I know that mono is wrapping things themselves, but on open wiki might help.
- sparkie 14y agoMany open source libraries already have .Net bindings available, a quick search can discover them. They're also packaged into assemblies or made into higher level APIs, which sure beats copy-pasting from a webpage. There's the [P/Invoke interop assistant](http://clrinterop.codeplex.com/ http://clrinterop.codeplex.com/) which can help you create a wrapper for C APIs, and the mono team have created [Cxxi](https://github.com/mono/cxxi https://github.com/mono/cxxi), a binding generator for C++ APIs.
- f1f2f3 14y agoWindows 8 is being released soon. Got it.
- lucajona 14y ago“But even if Microsoft started to deemphasize .NET, I believe .NET would endure because the community will continue to fill in the gaps so that the ecosystem abides.” Is .NET really that great a platform that these OSS devs will continue to support and improve it after it's been abandoned by Microsoft? Not saying that's going to happen—but as a .NET dev myself, I'm curious. If it did go that way, I think my only motivation to continue using .NET would be that I don't want to rewrite years worth of code.
- tonyedgecombe 14y agoIf Microsoft were to abandon .Net then I'm pretty sure the motives for maintaining Mono would slip as well. However I think that is extremely unlikely, no doubt it will be evolved in that annoying Microsoft way but completely abandoning it would make no sense at all.
- quonn 14y agoThey won't abandon it. Most of their server software is written in .NET: ASP.NET, Exchange server, etc. Most of their administration tools have been rewritten and now all use Powershell (which also has become the primary interface for server management by admins) under the hood.
- ido 14y agoC# the language itself is quite nice, probably one of the best mainstream languages out there. I don't really care tho if it would run on the JVM or native (or something else) instead of the CLR. Right now tho probably the only popular use of non-ms .net (mono) is Unity (which is btw a pretty big deal in the games industry).
- fijal 14y agoI find it somehow sarcastic that as you say "the only popular use of mono" is a platform that does not support linux.
- 14y ago
- edandersen 14y agoXamarin appear to be pushing big time the cross platform abilities of C# now. It is possible to have your business logic shared between Windows desktop, WinRT, iOS, Android, web apps etc, with a thin native UI layer on top.
- shadowmint 14y agoYou need to add IF you're using visual studio to that sentence. This is currently not possible using mono develop; the portable library support doesn't exist, which means your 'shared' libraries can't do things like use sqlite or linq; in fact, they can't have references to anything other than other portable libraries at all. Like, for example, system.collections.generic.
- CodeCube 14y agoWhat!? this is entirely incorrect ... with MonoDevelop you can use the entire framework (linq, async/await, sqlite, entity framework, etc.). It's possible to build applications without using visual studio at all (minus winrt apps, you need VS for that).
- jmcqk6 14y agoI thought it was possible to do all of this without using visual studio - or any other IDE - with the possible exception of the WinRT app submission process. I know you're wrong about sqlite and linq as I've used them on both .net and mono. I think you're using the phrase "portable library" incorrectly. In the .net world, these are libraries created by microsoft that use the more limited version of the framework on their other platforms. For example, windows phone 7 and win rt use different portable libraries (a pain to manage, admittedly).
- shadowmint 14y agoI'm referring specifically to portable class libraries (PCL) (http://stackoverflow.com/questions/5238955/what-is-a-portable-class-library http://stackoverflow.com/questions/5238955/what-is-a-portabl...) that allow you to write code that is 'cross platform'. (ie. PCL --> One code base that compiles and runs on multiple c# runtimes; a key feature of writing cross platform c# applications) Support is currently limited, see: http://docs.xamarin.com/ios/tutorials/Cross_Platform/Building_Cross_Platform_Applications/Part_3_-_Setting_Up_A_Xamarin_Cross_Platform_Solution#Portable_Class_Libraries_(PCL) http://docs.xamarin.com/ios/tutorials/Cross_Platform/Buildin... Of course you can copy and paste your code into different projects manually, and compile it for a specific runtime. Or... you can use visual studio.
- frozenport 14y agoWhen I evaluated .Net for my database client I saw a nonportable Java. When I was working on a structural mechanics code I had performance considerations that were not met. The former niche of .Net was that it could painlessness interface with Microsoft technologies, without MS's love, support and their technology why would anybody use .Net?
- quonn 14y agoFirst, it's very portable. Second, performance is as good or better than pretty much anything else that is not optimized C or C++. Finally, there are many reasons to love C# beyond interfacing with MS technology. It's a very beautiful language, much nicer than Java used to be and in many respects better than even the latest Java language. And innovation continues: If you've worked with node.js for some time, you will see how ugly code becomes where everything is done using callbacks. C# just now introduced new syntax where you can basically write code in a linear way and the nesting of callbacks is done by the compiler.
- codewright 14y ago>it's very portable Mono, I'm guessing you mean. Mono's not great for server applications, it's best used for desktop apps. If you want to write server apps, you need to be using the official Microsoft implementation. (Which is becoming the red-headed stepchild platform in Microsoft's strategy apparently?) > Second, performance is as good or better than pretty much anything else that is not optimized C or C++ Lets find out: http://shootout.alioth.debian.org/u64q/which-programs-are-fastest.php http://shootout.alioth.debian.org/u64q/which-programs-are-fa... List of things that are faster than C#: Fortran, Ada C, C++, ATS, Java, Scala, Common Lisp (SBCL), and Go. List of things that aren't faster than C#, but are close enough to call it a wash: Haskell, Ocaml, Clojure, Pascal, Racket I'd say you have some choices if performance is an issue yet C#'s is acceptable. >It's a very beautiful language, much nicer than Java used to be No, yes. It's nicer than Java, it's not "very beautiful". Try working through the Little Schemer to see a beautiful language. >And innovation continues: If you've worked with node.js for some time, you will see how ugly code becomes where everything is done using callbacks. Bizarre strawman? What? I don't like Node.js either, but what's your point? A lot of languages that aren't C# have better concurrency idioms than Node. You know, like all of them that aren't C#. > C# just now introduced new syntax where you can basically write code in a linear way and the nesting of callbacks is done by the compiler. Yeah, uh, Scala has had this since forever. And Lisp. And Scheme. And Clojure. And C++. And Node.js (ugh). For a C++ example, look at Tame/Tamer, SFSLite, etc. For anything else, google "promises". There is nil that is special about C#, it's a slightly nicer Java without a home or a stable implementation. If neither of those things matter to you and you wanted a Java++ that wasn't as ambitious or intellectually challenging as Scala, then you've found your language. Godspeed.
- Someone 14y ago"There’s also this perception that with Windows 8, the Windows team is trying its best to relegate .NET into the dustbin of legacy platforms" I haven't heard that anywhere. They are tightening the APIs for security and there is the usual rebranding (Silverlight apparently is out) together with the addition of 'our new things are brilliant, unlike the things that we, lasy year, called our new brilliant things', but AFAIK, Microsoft bet and is still betting heavily on .NET. Anybody know what this statement is based on?
- cliffbean 14y agoPeople are looking at shifts and trying to find trends. It used to be that the trend was towards ever-growing prominence of .NET. With recent shifts, .NET is still present, but other technologies are now filling roles that .NET had been expected to fill, under the previous trend. This suggests a new trend.
- cek 14y agoThe Windows team made a huge investment in HTML & Javascript. You could even say they bet on developers using that over XAML/C#. Looking at the apps in the Store though, and talking to insiders, and the picture is clear that over 80% of the apps in the Windows 8 Store now are XAML/C#. I've been tracking this for the last few months, and the trend is continuing.
- CodeCube 14y agoI know I am but one data point, but I feel that was a poor investment choice for the windows team. They should have doubled down on XAML/C#, along with unmanaged code to bring in toolkits like unity and other developers that prefer working in C++.
- deleted 14y ago[deleted]
- jiupai 14y ago.Net not equals C#. C# is great, but .Net sucks. limited ecosystem, no one want to implement good open soure project on .net stack. no similar level project like JBoss.
- migueldeicaza 14y agoI would say that not having J2EE and JBoss is a plus for .NET or any other platform :-) There is a whole new set of framrworks for building web applications. My favorite frameworks include: * ServiceStack: everything you need to build sophisticated web apps with a clean, beautiful API. * WebAPI: if you want to get a more "Enterprisey" set of APIs * ASP.NET MVC: .NET's approach to Ruby-on-Rails-esque development. * SignalR: real-time web applications.
- migueldeicaza 14y agoThere seems to be some discussion about Mono's performance, and I wanted to address that. The default configuration for Mono is a blend of fast startup, and decent code speed. You can tune these parameters depending on your use profile which can range all the way from: startup is the most important factor to high performing code at any cost. In general the language Shootout compares the default configuration of Mono vs all kinds of other configurations. Those interested in Mono for High Performance Computing will be interested in some options: * LLVM: passing the --llvm flag to Mono instructs Mono to pass the code to the LLVM optimizing compiler, and will run your program through every heavy weight optimization that LLVM supports. This comes at the price of slow startup times (much slower), but for HPC or server loads, the extra time it takes to JIT is worth it. * Unsafe mode. If you have battle tested your application and you never get an IndexOutOfRange exception, you can instruct Mono to never perform array-bounds checking. Arrays bounds checking basically ensures that every time you do array [i] that the value of "i" is within the range 0..array.Length. This can be expensive, but makes your program safe. Passing -O=unsafe basically gives you the same semantics of C or C++: you know what you are doing, and you really are not too much into safety. With LLVM + unsafe access, as far as the LLVM optimizer is concerned, there is really no difference between C# and C++ code, and you will get the same performance for compute intensive tasks. The only case where the dynamic of performance would come into play is when the garbage collector kicks-in, vs manual memory management. That in general depends a lot on the kind of app you are building. Many HPC applications preallocate all of their memory before large computations anyways, so in those apps the GC makes no difference. The third optimization is to use Mono's new garbage collector, which gives in general a nice 2x performance boost to memory intensive applications. In general, the new GC is great for memory intensive applications, while the old one is better for pure computational applications that are not memory allocation bound. With Mono 3.0, we also have implemented the inlining attribute (new in NET 4.5), which developers can use to force a function to be inlined, something that before was entirely based on JIT heuristics. And of course, you can tune the individual Mono or LLVM optimization options.
- igouy 14y agoIn general, things said in general about the benchmarks game tend to be mistaken :-) Here's the command line for the spectral-norm C# programs shown on the benchmarks game website: /usr/local/src/mono-2.11.4/bin/mono --gc=sgen --llvm spectralnorm.csharp-2.csharp_run 5500 As you can see --llvm is used.
- rocky1138 14y agoThis is one of the areas that open-source shines: when a core technology that has a passionate following is no longer supported, that passionate following can take on the project themselves and continue.
- awaretek 14y agoAnyone who bought into Microsoft's Proprietary .Net platform deserves what's happening to them now. Anyone who buys into Microsoft's Windows 8, Windows RT, Windows Phone 8 ninsense is just plain braindead. But some people never learn :-)
- CodeCube 14y agoI'm not sure how you got this from that post, if anything the future has never looked brighter for .NET/C# developers. The ability to target all mainstream platforms, a burgeoning open source community, and fantastic tools. Of course, other technologies have had these in one way or another ... but that doesn't invalidate the C# communities advancements. The fact is that as a C# developer currently focusing on mobile development, I am very happy these days.