12 ms·
The future of C# and Visual Basic [video]
- cowabunga 12y agoI wish there was a tl;dr version as its quite hard to find the time and motivation to sit there and watch something like this for over an hour.
- Someone1234 12y agoThey're releasing it under the Apache licence 2? Impressive. That definitely seems like something the Mono project could just utilise directly without any licence concerns.
- tagrun 12y agoXamarin is selling licenses to proprietary gamedevs for quite a while now. That may put a dent in their business.
- jmcqk6 12y agoThe mono compiler (that Xamarin uses, and would presumably be replaced by the Roslyn compiler), is released under GPL and MIT X11 licenses (https://github.com/mono/mono/blob/master/LICENSE https://github.com/mono/mono/blob/master/LICENSE) I don't think this will have any effect on Xamarin licenses at all.
- sremani 12y agoTL;DR (slides) https://view.officeapps.live.com/op/view.aspx?src=http%3a%2f%2fvideo.ch9.ms%2fsessions%2fteched%2feu%2f2014%2fDEV-B345.pptx https://view.officeapps.live.com/op/view.aspx?src=http%3a%2f...
- samirahmed 12y agoAlthough most of the language features have been discussed before. I am excited for null propogation as well as string interpolation. These are will improve the signal to noise ratio and allow for easier to read and write code. From my experience with C# null checking before method calling or indexing is such a pain and the coffeescript like null propagation is a much needed feature.
- andrea_s 12y agoWhat's the use case for a getter-only auto property? I can't imagine how that would work, does someone have any insight? edit: is it "same as a public readonly field, but it's a property"?
- QuadDamaged 12y agoDatabinding in WPF when you're not using INPC I often write stuff like this: public RxProperty<bool> IsFoo{get;private set;} I could do without the private set.
- andrea_s 12y agoAre you saying that it's going to be equivalent to a non-private getter, private setter automatic property as it is now?
- jdmichal 12y agoIt's not equivalent. The getter-only auto-property will not have any setter at all. Previously, it had to have at least a private setter, which means that you couldn't strictly guarantee that it wasn't being updated. I used to write read-only properties the long way just to guarantee that they were actually read-only.
- moron4hire 12y agoBecause a property is actually a method, so other, internal state could change what the property returns. Think of something like an "IsConnectionOpen" flag. The class' internals may change it as if it is not readonly, but to the consuming code, the IsConnectionOpen property should appear readonly.
- andrea_s 12y agoThat's clear - but that's not the case presented in the slides... "Automatic" is clear, "getter-only" is clear, but "automatic getter-only" leaves me scratching my head.
- untog 12y agoMuch to the derision many of the developers I know, I still say that C# is the best language I've ever worked in. But the .NET platform is one of the worst I've ever worked in. So opening up C# to more platforms sounds very, very good to my ears. I only wish Xamarin's products didn't cost so much. With Swift on the scene I really can't justify spending money to write my side projects in C# instead of in the environment Apple provides. Or Java for Android, which let's face it, is already similar to C# anyway.
- hosay123 12y agoUnless of course, you want your side projects to work on non-Apple platforms. Aside from mobile stuff (and who really cares about that ;), the remainder of the Xamarin/Mono toolset is feature complete and almost entirely open source.
- akmiller 12y agoXamarin's value proposition is developing for multiple platforms at once (or at least, as a current Xamarin user, sharing as much as possible between platforms). Swift still offers nothing for that scenario so I don't really understand the comparison. Obviously if you are only going to ever develop for iOS then going with Swift could make sense but then it seems that Xamarin would've never really have been an option anyhow, irrelevant of cost.
- untog 12y agoLast time I tried Xamarin (and I'll admit it's been a while) cross-platform was surprisingly difficult. A project had to be either iOS or Android - and that included projects that had no UI code in them. So the concept was there, but the execution wasn't yet. Of course, this may have changed.
- eropple 12y agoPortable Class Libraries help here. They aren't perfect, and honestly they're justly badly reinventing Java's loosely coupled jars, but they give you the ability to link stuff together in a little more general of a way. In my current project (a video game), the core library is a PCL - it contains data structures and the interfaces and abstract classes that content (mods as well as the base game) must fulfill. I have a "desktop" library that's a normal .NET 4.5 class library that contains stuff like "load your config data from files, include the runtime-compilation mod system", and I have runner projects--text-mode via curses for now, eventually graphical post-prototype--for MacOS, Windows, and Linux[1]. I use configurations (not platforms, leave everything as AnyCPU unless you want to hate your life) to provide preprocessor flags for #if; my solution has ended up with an ugly number of "Windows-Debug", "MacOS-Release", etc., but the differences between XS and VS make it hard to do things "right". [1] - all source/content files added via a single template .csproj, using a Ruby watcher I'm going to eventually open-source, because using MSBuild correctly to handle this situation breaks in both VS and Xamarin. (That last bit, you may be realizing, is a common theme. .NET has such good stuff, but half of it is broken at any time.)
- math 12y agoThis is all very nice, but what would make me truly excited is if they released their runtime for linux ... yeah, it's just a dream. would be a lot of work I expect and they wouldn't want to even if it was easy.
- untog 12y agoWell, Mono exists. At this point porting to Linux would just be duplicating a large amount of Mono.
- math 12y agoYes, I use it extensively and it's good. But the Microsoft runtime is awesome. Much faster and very stable. I do a lot of number crunching (distributed on a small cluster) and don't want to use Windows in this scenario for various reasons. Mono is good enough that I choose to compromise, but MS runtime on linux would be a dream come true.
- pjc50 12y agoIf they genuinely open source Roslyn, then that could happen. The tricky bit would be porting the very Windows-specific OS features (overlapped IO, System.Windows.Forms)
- UK-AL 12y agoIt is? https://roslyn.codeplex.com https://roslyn.codeplex.com Roslyn is not the runtime, it is the compiler which emits IL code. Its different from the runtime.
- rmsaksida 12y agoThis. It'd be amazing if there was an official and well supported Linux port of .NET. Just imagine having C#, F# and .NET libs available in a Linux environment and talking to Linux tools.
- jbergens 12y agoThey are working on .NET Native which does some of that. http://blogs.msdn.com/b/dotnet/archive/2014/04/02/announcing-net-native-preview.aspx http://blogs.msdn.com/b/dotnet/archive/2014/04/02/announcing...
- thescrewdriver 12y agoC# seems to look more like Scala with every release (a good thing), with talk of primary constructors for C# and string interpolation etc. EDIT: Interesting to see Neal Gafter is involved (See Roslyn mention here: http://www.gafter.com/~neal/ http://www.gafter.com/~neal/), who is rather fond of Scala from what I've read: http://www.infoq.com/articles/neal-gafter-on-java http://www.infoq.com/articles/neal-gafter-on-java
- pjmlp 12y agoExcept that C# is a first class citizen on the platform, not a wannabe replacement for the platform's main language. This already makes a lot of difference in the tooling that one gets from the platform owner. Another thing is from the point of view of customers. With C# I can get all the goodies on customer projects. With Scala, I can only play with it at home and try to be happy with Java 8 on customer projects.
- mwg66 12y agoPrimary constructors have been dropped from C# 6 now (https://roslyn.codeplex.com/discussions/568820 https://roslyn.codeplex.com/discussions/568820)
- noblethrasher 12y agoYep, and I'm pretty sure it's related to a comment(s) that I have made: http://www.reddit.com/r/csharp/comments/2dc6ge/easier_immutable_objects_in_c_6/cjoqs2r http://www.reddit.com/r/csharp/comments/2dc6ge/easier_immuta...
- bithush 12y agoI don't see why Microsoft still put resources into Visual Basic. C++/C#/F#/MSSQL/PowerShell is all they really need to concentrate on.
- zerr 12y agoThere are surprisingly big enough number of people who hate curly brackets and adore Begin/End's... unfortunately.. ;)
- archon 12y agoAnd there's an even larger number who don't hate curly brackets, but are forced to deal with Begin/End's because the large company they work for is so inertia-bound to VB.
- zerr 12y agoYes, and I think these people should ask premium bonuses for this.
- majc2 12y agoThis might be in jest, but I've seen something close to this. I do a lot of work in C# and a number of years ago I had two different roles approach me to work in VB.NET and it was > 10% premium over the C# equivalent market rate - the megacorps struggled to get people to switch so threw money at anyone with a whiff of interest and talent. (I said no in-case your wondering).
- Gmo 12y agoAt my previous employer, I had to use VB.NET and you honestly forget about it after a couple of weeks, especially since both languages are mostly on par today ...
- gagege 12y agoI have to switch between both at my job, and hardly ever notice when I do. Sometimes I'll start to write an If wrong and get squiggly red lines, but that's about it.
- tkinom 12y agoI had use VC and VB a long time (15+ years) ago and have since moved to Linux + gcc, python, golang, mobile etc. After watching this video for 20 minutes of all the fancy GUI details, I have couple of higher level questions: 1) Do C#/VB still only build for Windows, Win Mobile? Can they build targets for IOS, Android, Linux? I heard the new CEO of MSFT suppose to be more supportive of cross platforms. 2) I began to like the concurrency model in golang a lot. Does the C#, VB support that kind of concurrency in their language design?
- Sir_Cmpwn 12y ago1 - Mono still works well and Rosyln compiles and runs in Mono. 2 - Not at a syntax level, but there is good concurrency support in the .NET stack.
- mariusmg 12y ago"Concurrency" at syntax level is kind of dumb anyway.
- tkinom 12y agoThe way golang works seems to be follow the model of Unix pipe (stdio pipe) between process. They are simple channel between go-routines (kind of) light weight threads. The concept is built into the language itself. Anything wrong with that?
- mariusmg 12y agoYeah. Goroutines not backed by real threads (afaik there's also gorountine -> os thread), those "green" threads from Ruby and fibers are just ugly hacks. Sorry but from my point of view, "real" concurrency is done at the OS level. The OS schedules threads to the CPU depending on their priority and "other" things. Having a single OS thread and runtime code that "yields" so another piece of code can run in the same thread, that's not concurrency...that's a toy. Sorry for being so blunt.....but that's my opinion.
- bhouston 12y agoC# is neat and I used it as my primary language for a good 6 years from 1999 to 2005, and then a little bit since they -- maintaining legacy projects. But a platform specific language it isn't the future in my opinion, it is just too limiting. Python, JavaScript and other types of cross platform languages, even if slower and sometimes more annoying to debug, is where the money and the future is.
- Someone1234 12y agoJavaScript, yes. Python? Python isn't particularly popular and there aren't many Python jobs around. It also isn't a particularly popular language on any platform but Linux (so while technically cross platform, if few use it on other platforms is that relevant?). If you've been ignoring other languages to concentrate on Python of all things in the last few years then you have missed the gravy train. Object C, Java, and C are the most popular, and both Java and C are cross-platform (and better still actually used cross-platform unlike Python). As an aside I see significantly more Java, PHP, and C# jobs than any other language (mostly for web-apps). Then after those I see pure mobile development (Java-Android, and Object C).
- dagw 12y agoPython isn't particularly popular and there aren't many Python jobs around. Where have you been looking? Maybe if you only focus on pure web-dev, but I see Python and Python jobs everywhere. But I will concede that many of those jobs are science, engineering or analysis jobs that primarily involved programming python, rather than pure programming jobs. It also isn't a particularly popular language on any platform but Linux That is not my experience at all. Of all the cross platform scripting languages (Perl/Ruby/PHP/Lua/Javascript etc) it is by far the most popular on Windows, and certainly the best supported. I can probably also name a half dozen big commercial Windows apps that use Python as its main scripting language.
- deleted 12y ago[deleted]
- 12y ago
- deleted 12y ago[deleted]
- malkia 12y agoHere is a recent C#/.NET experience that I had: Some of my time is spent profiling/sampling/optimizing the pipeline at work. I decided to take a stab at a C#/.NET tool that is executed quite a lot throughout the day, only to find out some unexpected things - all variables in a functions would be initialized to defaults (used or not, covered or not)... So splitting large functions into smaller would (actually) help in this case for sure: https://gist.github.com/malkia/ebf7f54063c5aec6d1b0 https://gist.github.com/malkia/ebf7f54063c5aec6d1b0 Some answers from Eric Lippert about it (declaration spaces) http://blogs.msdn.com/b/ericlippert/archive/tags/declaration+spaces/ http://blogs.msdn.com/b/ericlippert/archive/tags/declaration... And this stackoverflow: http://stackoverflow.com/questions/2976628/question-on-c-sharp-variable-scope-vs-other-languages http://stackoverflow.com/questions/2976628/question-on-c-sha... It's not something I've seen in other languages/vm's. And seems like "ngen install" with some attributes would help it: [MethodImpl(MethodImplOptions.AggressiveInlining)] static int func1(int flag) But I'm no longer able to think of C# as closer (not close) to the metal, because of this exactly. It'll affect me how I look at it and code in it.
- jgill 12y agoI second that that C# and the .NET platform are a joy to work with. If you've never given them a shot, you may be pleasantly surprised.
- orf 12y agoLetting NuGet packages inject domain specific tooltips and warnings sounds awesome.
- Too 12y agoThese additions are all nice but most of them really aren't more than syntax sugar. What c# really really needs is stricter reference handling of objects, such as const * const in C. Now when you send an object into a library function you don't have the slightest idea what the function will do to your object. Take the simplest case of void Foo(List<string> bar). What will Foo do with bar? 1. Iterate it once and calculate something based on the contents. 2. Iterate it once and store references to all strings in the list. 3. Mutate the list by adding or removing items. 4. Store a reference to the list itself and modify it two days later from another thread causing a race condition because you thought you held the only reference to that list. Case 3 could be excluded by using ienumerable here but in many other cases its not that simple. I'm not asking for c++ and manual memory management here, just some kind of constraints on what a function may do with its arguments. I've seen case 4 cause so many bugs its ridiculous, it doesn't even have to involve multi threading before it gets nasty.
- stinos 12y agoNow when you send an object into a library function you don't have the slightest idea what the function will do to your object There are more languages then C# which tend to have these problems, and for all of them these problems can be avoided in a number of ways merely by applying the typical good practices and well known design patterns. For instance just giving your functions proper names (examples 1. GetLongestString 2. StoreReferencesToAllStrings (still hacky, not sure if there are proper usecases for that?) 3. RemoveDuplicates 4. InstallList or so) and making sure functions do One Thing only will get you a long way in preventing problems. Not saying it is easy, but I've been using C# for at least 5 years and don't really recall problems with it. Did have problems with weak event handlers disappearing due to gc but after learning it it didn't happen again.
- orionblastar 12y agoThe main problem is the GUI Windows Forms that Visual Studio uses that they won't allow for use on other operating systems other than Windows. If they included libraries that could compile the Windows GUI Forms to other operating systems like GNU/Linux, *BSD Unix, iOS, Android, Mac OSX ect it would be used more for those platforms. Instead you have an incompatibility and it prevents developers on Non-Windows platforms to take it seriously. How can you claim it is cross platform when the GUI parts won't even compile? Visual BASIC 6.0 was the last version of Visual BASIC that didn't stink and add in a bunch of Java features. I consider it Classic Visual BASIC for version 6.0 and under. This Visual BASIC is really VB.Net and not Classic Visual BASIC. I'd much rather use the BASIC based Jabaco http://www.jabaco.org/ http://www.jabaco.org/ to make Java Bytecode JAR files than use VB.Net to make binaries. At least the Java JAR files are cross platform better than VB.Net and C#.
- dragonbonheur 12y agoThere is another BASIC that compiles to Java and is more actively developed than Jabaco :B4J http://www.basic4ppc.com/android/b4j.html http://www.basic4ppc.com/android/b4j.html Also for cross-platform development there are even dialects that compile to HTML+JS: http://pewtersoftware.com/browserbasic/ http://pewtersoftware.com/browserbasic/ And other platforms: http://www.monkey-x.com http://www.monkey-x.com
- orionblastar 12y agoThank you I'll look into them. Monkey-X looks like Blitz BASIC rather than Visual BASIC. But I like the fact that it can go cross platform.