The future of C# : Build 2018

  Рет қаралды 68,840

Microsoft Developer

Microsoft Developer

Күн бұрын

Пікірлер: 137
@victortarnovskiy8407
@victortarnovskiy8407 6 жыл бұрын
Mads is such a nice person. Probably this is reflected in the language itself :)
@focl2003
@focl2003 6 жыл бұрын
I agree.
@andrekohler5792
@andrekohler5792 6 жыл бұрын
I'm really looking forward to the nullable reference type feature in C# 8. NullReferenceException is probably one of the most frequent causes for C# programs crashing.
@hblaub
@hblaub 6 жыл бұрын
I'm often get a method with several hundred lines and just a NullRef in the log file. Then, I will do a data flow analysis for every little shitty variable. Sometimes the methods got inlined and then it's even more fun!
@sowenzhang
@sowenzhang 6 жыл бұрын
I start opting in Option type so I don't have to deal with null anymore.
@vinzer72frie
@vinzer72frie 6 жыл бұрын
Just use the ?: operator
@llothar68
@llothar68 5 жыл бұрын
Fire your coders and hire better ones. As a C++ programmer i never understood why this is a problem.
@conner_wood
@conner_wood 6 жыл бұрын
57:50 - The ability to define a dynamic range on substring... yes, that is really nice, and really like the idea of havng index read from last to first via ^0, ^1
@Pheubel
@Pheubel 6 жыл бұрын
Dont you mean ^0..0 ?
@LittleBobbyHasTables
@LittleBobbyHasTables 6 жыл бұрын
If you know regex this is a bit confusing: ^ in regex means line START, but in C# it will mean index from the END... anyway, this doesn't mean I don't like the feature... it's just an observation...
@bradford8611
@bradford8611 6 жыл бұрын
The obvious one (-) couldn't be used as explained. Also not a fan of ^... What would you use? I wonder if (!, as in 4..!2) would be a better choice?
@perahoky
@perahoky 6 жыл бұрын
07:25 my teacher once said, "on a power point presentation, just keep only 5 words at once at a time on a page!" e.g. Strategy 1. Growing 2. Innovation 3. Improvements for all 4. Broader Ecosystem
@ryan.crosby
@ryan.crosby 6 жыл бұрын
That return switch syntax is so cool!
@Neme112
@Neme112 6 жыл бұрын
It's not a "return switch" syntax. It's a switch expression and you can use it anywhere you can use an expression. For example: `var result = person switch {...};` or `Console.WriteLine(person switch { ... })`
@uncommonbg
@uncommonbg 6 жыл бұрын
Yes, Kotlin does the same thing with "when" expression and I love it.
@marna_li
@marna_li 6 жыл бұрын
Nice to see that C# is evolving and diverging from the rest of the C-family. More functional. Less Java. Next step: Removing curly braces! Just kidding ;) It's really a living modern programming language!
@Speedow
@Speedow 5 жыл бұрын
I just learned from this video that I can use tuples in my value assigment constructors in a lambda expression instead of writing a block. amazing, off to refactor all my classes...
@eduard.schaefer
@eduard.schaefer 6 жыл бұрын
I like the development of C#
@mamunurrashid5652
@mamunurrashid5652 6 жыл бұрын
C# is awesome!!!
@hl2mukkel
@hl2mukkel 6 жыл бұрын
1:00 "This is becoming traditional, C# has a future and we're going to talk about it" _audience laughs_
@superstringcheese
@superstringcheese 6 жыл бұрын
If I was doing a code review and saw that new switch pattern they ended up with, I'd make the developer convert it all to a conventional switch. That is one of the most arcane blocks of code I've ever seen.
@Grimlock1979
@Grimlock1979 6 жыл бұрын
I have been waiting for that switch expression syntax for years!
@mike-e-angelo
@mike-e-angelo 6 жыл бұрын
What an excellent session. Very appropriate for an excellent language. :)
@tecgoblin
@tecgoblin 6 жыл бұрын
I've faced a case where I needed an Asynchronous Stream, and it was frustrating that I had to resort to normal for loops. Go C# :)
@Macellaio94
@Macellaio94 6 жыл бұрын
That is indeed awesome. Lots of stuff are great, i believe legacy code will benefit incredibly by combining the new nullable checks on strings, LinqToForeach\For and viceversa, or even the "fix all in the solution" in combo with .editorconfig... So much great stuff! P.S. the substing with .. is mindblowing
@synetic707x
@synetic707x 6 жыл бұрын
Love C#, C++ and Rust :)
@dppage
@dppage 6 жыл бұрын
C# needs a write-once, run everywhere GUI development environment. Xamarin doesn’t cut it. Xamarin Forms had potential, but they’ve made it clear that they aren’t interested in supporting MacOS after talking it up for a couple of years, and it’s so buggy it’s one of the most dreaded platforms on a stack overflow survey. Folks are still jumping to electron, react native, etc.
@stuartross5686
@stuartross5686 6 жыл бұрын
Like the string range function but why use ^ to refer to the end as this is the beginning in regular expressions shouldn’t it be $
@kingarthurthethirdthst3804
@kingarthurthethirdthst3804 6 жыл бұрын
Whoaaaa, new keywords! C# was certainly lacking those.
@TheNefastor
@TheNefastor 6 жыл бұрын
I love their energy :-)
@harrodharrod5239
@harrodharrod5239 6 жыл бұрын
shouldn't the last be ^0? Kinda coutnerintuitive indexing from 0, but from 1 when coutning backwards
@denys-p
@denys-p 6 жыл бұрын
How about discriminated unions and pattern matching that will have error/warning in non-exhaustive cases set?
@wertrager
@wertrager 6 жыл бұрын
Union types yes. I'm was wondering during the talk, could it be possible to implement Either using the ref returns, but I don't think it's possible without changing the runtime. Ceylon has a great syntax for this. ceylon-lang.org/documentation/1.3/spec/html_single/#unionandintersectiontypes
@robertmcalery9323
@robertmcalery9323 6 жыл бұрын
I'm sure they're looking into it. They just need more time to see how the F# implementation can be implemented in C#.
@lrhlpz
@lrhlpz 6 жыл бұрын
I don't think so, you are seeing it like "c# will be f# in the future", but it is not. C# will get any feature that is relevant to object oriented programming, not because f#.
@denys-p
@denys-p 6 жыл бұрын
Why not? Most of significant features since 3.0 adopted from FP or at least “neutral” (not related to OOP). Lambda functions + Linq. Type inference, tuples, records, pattern matching, null-propagation etc Async/await + tasks adopted from F# and they’re behave like IO Monad from Haskell. Not-null by default is also from FP, I can’t remember any more or less well-known OOP language with it. Besides that, this feature is really useful. Now I have to write in switch-case something like default: throw new NotImplementedException(); And get these exceptions in runtime if new option is added and not handled. With warnings/errors I’ll be able to write totally safe code here - compiler won’t miss unhandled case.
@Vindignatio
@Vindignatio 6 жыл бұрын
@41:20 I think null reference exceptions are a debugging problem not a language problem. If the exception included what method was trying to be called with the null reference it would be way better. I know the variable that is null might not be known (+ optimizations)(or even exist if chaining methods), but you know what method was being called on a null object.
@bradford8611
@bradford8611 6 жыл бұрын
It's a matter of communicating intent (especially to the compiler), a reference CANNOT be null, therefore dereferencing is safe... this is a long overdue feature. I believe that Anders has been asked the question many times and the response was he was unsure 'how' to implement without breaking the language [existing code] (as they are suggesting to do now).
@WhiteDragon103
@WhiteDragon103 6 жыл бұрын
The nullable reference type stuff is amazing. Finally I won't have to constantly bitch at my coworkers to fucking null check their god damn fucking shit over and over and over and over and then have to deal with the fallout and bullshit when they don't. The compiler will do that for me.
@Luke-me9qe
@Luke-me9qe 6 жыл бұрын
So apparently you bringing back pointer algorithm in a way, just a little safer?
@ВалентинТ-х6ц
@ВалентинТ-х6ц 6 жыл бұрын
13:29 How did he edit GrabBag.csproj file without unloading it? I have no such item in popup menu. Some kind of extension?
@bobbastian760
@bobbastian760 6 жыл бұрын
guys AT LEAST 1080, better 4K - so we can actually read the code!
@wertrager
@wertrager 6 жыл бұрын
Please do Nullable, Records, Either, Union Types for 8.0, then for 9.0-10.0 plan for Dependent Types (possibly by inlining parts of Roslyn with the type declaration), this would allow for Multiparty Session Types, which are BetterBestest)
@robertmcalery9323
@robertmcalery9323 6 жыл бұрын
Looks like the C# team is working overtime trying to bring F# capabilities into C#. Just have a look at the return switch pattern matching @48:00. They're trying to emulate F#'s expression based pattern matching mechanism, as seen below: Proposed C# syntax: return person switch { Professor p => ... , Student s => ... , Person p when ... => ... , _ => ... } Existing F# syntax: match person with | Professor p -> ... | Student s -> ... | Person p when ... -> ... | _ -> Similarly with all the deconstruction related pattern matching stuff. It's all copied from F#. Like they say: "Imitation is the sincerest form of flattery". NOTE: The big difference is that F# has exhaustive pattern matching. C#'s version is NOT exhaustive, making it far less powerful, as the compiler won't warn you of any missed matches.
@lrhlpz
@lrhlpz 6 жыл бұрын
C# is gaining some functional things, but it is not a functional language. F# is and will be better as FL.
@hamesjetfield0
@hamesjetfield0 6 жыл бұрын
How do you figure C# version doesn't have exhaustiveness checking? The code they showed was exhaustive so we didn't see any warnings but I don't see any reason why the C# version couldn't be checked for exhaustiveness.
@TheMonk72
@TheMonk72 6 жыл бұрын
Oh, did you just implement const parameters in C#?
@somebody_on_the_internetz
@somebody_on_the_internetz 6 жыл бұрын
Span and Range(index Backwards with..^) reminds me a lot of the nim-lang but there must be a lot of languages that implement it like that.
@vitaliiyarema
@vitaliiyarema 6 жыл бұрын
I am looking for a H1B job in USA as the C# .NET developer. Threre are a lot of such vacancies for Java developers but too few for C# .NET developers. I know a lot of people got H1B visas as Java developers, but nobody as the C# .NET developer from my country (Ukraine). But there are a lot of jobs for C# .NET developers in Ukraine. Does this mean that in the USA C# .language is much less popular than in others countries? May be I need to migrate to Java language to get H1B visa? I know even such a fellow from Ukraine who got job as the Java developer in Microsoft company!!!???
@theMagos
@theMagos 6 жыл бұрын
In the same way you specify nullable types with questionmark like "int? x", couldn't you specify non-nullable types with exclamationmark like "string! x"?
@IsmeGenius
@IsmeGenius 6 жыл бұрын
You want non-nullabe by default, preferrebly with no noise
@brunoccs
@brunoccs 6 жыл бұрын
What's that console he's using?
@metaorior
@metaorior 6 жыл бұрын
would i have to download 3.5 gb
@Void-uj7jd
@Void-uj7jd 6 жыл бұрын
No it will magically fly through the air.
@WorstDeveloper
@WorstDeveloper 6 жыл бұрын
Nice video, but it would be good if you recorded and uploaded this in 1080p at least. 720p videos is like 2010 level of quality.
@user-zu1ix3yq2w
@user-zu1ix3yq2w 6 жыл бұрын
Would've been okay if they were recording in 720p.
@borzak101
@borzak101 6 жыл бұрын
Well it's Microsoft. Suprised?
@juanrein
@juanrein 6 жыл бұрын
You could say this video is not that sharp
@klarnorbert
@klarnorbert 6 жыл бұрын
They're a 28B dollar company, but can't record their presentation in 1080p. Microsoft, you never change.
@Nolanyoyo
@Nolanyoyo 6 жыл бұрын
Whats it do, dont have a hour to find out
@marcosbeni5875
@marcosbeni5875 6 жыл бұрын
The nullable types feature is awesome and long overdue. However, not looking forward to that return switch monstrosity though; can you guys like... skip it? That stuff is impossible to read.
@harrodharrod5239
@harrodharrod5239 6 жыл бұрын
I think it was fairly readable up until they started doing the recursive patterns thingy with it.
@wisnu7734
@wisnu7734 6 жыл бұрын
C# is rock....i like it...
@binaryalgorithm
@binaryalgorithm 6 жыл бұрын
I did a lot of C#, then recently took a Java position. Not even close on language features, ease of use, and the IDE...
@fr3fou
@fr3fou 6 жыл бұрын
binaryalgorithm which way? C# > Java or Java > C#? Your comment can be taken both ways
@braed6202
@braed6202 6 жыл бұрын
Which isn't close?
@vangrails
@vangrails 6 жыл бұрын
Your words are very ambiguous.
@MikeSheen1972
@MikeSheen1972 6 жыл бұрын
Then he/she is obviously in the Java camp.
@StevenAkinyemi
@StevenAkinyemi 6 жыл бұрын
Duh, (s)he meant Java isn't close on language features, ease of use, ...
@TheNefastor
@TheNefastor 6 жыл бұрын
That range literal at 58:28 is coming straight from VHDL 😁
@suhuy2008
@suhuy2008 6 жыл бұрын
The default implementation mimics a little bit the Haskell type classes. There you can define one operation of a type class using another one. What would happen if I created a mutually recursive definition in the new c#? interface IFoo { bool Equal (T a, T b) => ! DoNotEqual(a, b,); bool DoNotEqual(Ta, Tb) => ! Equal(a, b); }
@wertrager
@wertrager 6 жыл бұрын
You can't do that, which of those would be the default?
@wertrager
@wertrager 6 жыл бұрын
You can't do that, which of those would be the default?
@wertrager
@wertrager 6 жыл бұрын
You can't do that, which of those would be the default? Typeclasses are something else, they generate constraints, not types.
@wertrager
@wertrager 6 жыл бұрын
You can't do that, which of those would be the default? Typeclasses are something else, they generate constraints and not types, or virtual types.
@wertrager
@wertrager 6 жыл бұрын
You can't do that, which of those would be the default? Typeclasses are something else, they generate constraints and not types.
@petter9078
@petter9078 6 жыл бұрын
Wish there was a TLDR of this stuff. Or if it was chopped so you dont have to watch it all in one sitting.
@sleeeptube
@sleeeptube 6 жыл бұрын
www.dotnetcurry.com/csharp/1440/csharp-8-new-features
@breathermachine
@breathermachine 5 жыл бұрын
"ref, readonly, in" sound like C#'s version of const correctness that's present in C++. *gasp*
@sergekg2kg844
@sergekg2kg844 6 жыл бұрын
Please add possibility use references on properties
@chidieberejoshua5314
@chidieberejoshua5314 6 жыл бұрын
What's the future of VB.NET?
@TaoriUTS
@TaoriUTS 6 жыл бұрын
was hoping for a demo of concept :(
@desi-musk
@desi-musk 6 жыл бұрын
I'm a JavaScript Developer and I am lost here...
@dumky
@dumky 6 жыл бұрын
Find more information on the previews that were demo'ed at github.com/dotnet/csharplang/wiki
@justnothing7080
@justnothing7080 6 жыл бұрын
return (middleName ?? "").Length;//this is how it should be done.
@WhiteDragon103
@WhiteDragon103 6 жыл бұрын
Don't you mean return middleName?.Length ?? 0
@onursahin7970
@onursahin7970 6 жыл бұрын
all these new things with ref sounds like const refences in c++
@IsmeGenius
@IsmeGenius 6 жыл бұрын
they are more like references in rust, cause they are safe
@TheoWerewolf
@TheoWerewolf 6 жыл бұрын
Dear God.. that new return/switch thing is hideous. Was someone trying to win an obfuscated code contest? Less clearly isn't always more.
@onlyice
@onlyice 6 жыл бұрын
Yeah... I have to agree... We can't let that happen.
@hblaub
@hblaub 6 жыл бұрын
Recursive patterns inside the "property matching"?! ..... I would like the power to do it but this syntax will become unreadable in a team with several developers and a huge legacy code base.
@tecgoblin
@tecgoblin 6 жыл бұрын
I love the new return switch - like the way it was before the introduced into it deconstruction. But I'm not fond of recursive patterns. To keep it readable you need to name your local variables full text (firstName, lastName etc), so in the end you gain like… 2 characters? And if you abuse it you end up with this unreadable example.
@robertmcalery4574
@robertmcalery4574 6 жыл бұрын
C# is looking more and more like C++ with each new release.
@JustinMinnaar
@JustinMinnaar 6 жыл бұрын
I agree, it's going to make reading for a nightmare.
@andrekohler5792
@andrekohler5792 6 жыл бұрын
Why do we need default implementations in interfaces when we already have abstract classes for this? This sounds like language bloat to me.
@wertrager
@wertrager 6 жыл бұрын
So that you can evolve your interfaces through time as requirements of your system change. This will save architects a ton of time, as they will not need to introduce breaking changes.
@wertrager
@wertrager 6 жыл бұрын
blog.idrsolutions.com/2015/01/java-8-default-methods-explained-5-minutes/
@mikebarber1
@mikebarber1 6 жыл бұрын
Also because Classes can only inherit from one abstract base. Where they can inherit from multiple Interfaces.
@hblaub
@hblaub 6 жыл бұрын
I don't like this! In C# we got extension methods already, so I find it better to tack something onto the interface later on. It's clear then to me that this extension came later and I can hide it with "using static" statements etc.
@hblaub
@hblaub 6 жыл бұрын
In Java 8, the JRE got Streams and a new functional approach - very useful but sadly not defined on Collection and such interfaces - so they introduced "default methods" and added ".stream()" to Java's collection interfaces. But in C# / .NET 3.5, LINQ got introduced with the help of extension methods so we just don't need this noise.
@elderofzion
@elderofzion 6 жыл бұрын
just chill out with the new versions... or you're gonna turn into java
@vp4744
@vp4744 6 жыл бұрын
Nice guys but a kludge of a language. The syntax is so noisy, why not do it in C++ and get the benefit of speed?
@braed6202
@braed6202 6 жыл бұрын
Uh, because C++ takes twice as long to write, is harder to learn and isn't safe?
@vp4744
@vp4744 6 жыл бұрын
Yes, C++ is not for every programmer. Only the good ones would benefit.
@braed6202
@braed6202 6 жыл бұрын
It's not even about that though, it's about how long it would take to write it. C# is much faster to write and will have less bugs, that's just a fact. If you want to chase a 5 or 10% performance gain for a web server, go ahead, waste your time.
@vp4744
@vp4744 6 жыл бұрын
It's not about 5 or 10%, but you have to make it work within a certain amount of time or memory. By the way if typing speed is your criteria, I don't think you're into real programming.
@greenscreen587
@greenscreen587 6 жыл бұрын
Except for Span, Memory and nullable references the rest is terrible and will confuse everyone. That switch wasn't even shorter. It was just obfuscated...
@bradford8611
@bradford8611 6 жыл бұрын
You might have not noticed (re: the switch) that by turning it into a return, that he could have gone on and made it an expression body, which is more 'functional like'. I am sure the jury is still out on it as far as the syntax (especially the recursive aspect, which I am not a big fan of), but the nice thing is that if you don't like it, you can still use the existing method.
@greenscreen587
@greenscreen587 6 жыл бұрын
Turning it into expression body gives absolutely no benefit here. Also, who uses so many switches that they need a shorter way to write it anyway? Going into more functional style of programming will make C# much more difficult to read. I would give C# team a break and focus on moving .NET to other platforms, because even though they say you can, it is still a very different experience than writing code for windows/iis and needs a lot of polishing.
@rockydirt
@rockydirt 6 жыл бұрын
lol... I don't understand why they troll JavaScript.
@themeeman
@themeeman 6 жыл бұрын
cause it sucks
@MikeSheen1972
@MikeSheen1972 6 жыл бұрын
Two different paradigms / philosophies. C# is a strongly typed philosophy - so javascript is the obvious target from the C# camp. I'm firmly in the C# camp, myself. I don't hate javascript, but I don't like it. Thankfully WebAssembly is gaining traction.
@prabhathamaradasa1263
@prabhathamaradasa1263 6 жыл бұрын
Little stolen from python...:)
@nightquest52
@nightquest52 6 жыл бұрын
Vars are plague of every coding language. So much effort to write INT instead of VAR.
@devoiddude
@devoiddude 6 жыл бұрын
Cringe!
What's New in TypeScript : Build 2018
1:17:17
Microsoft Developer
Рет қаралды 23 М.
Visual Studio Code Can Do That: Tips & Tricks : Build 2018
1:17:20
Microsoft Developer
Рет қаралды 24 М.
World‘s Strongest Man VS Apple
01:00
Browney
Рет қаралды 58 МЛН
Ozoda - Lada ( Official Music Video 2024 )
06:07
Ozoda
Рет қаралды 30 МЛН
🕊️Valera🕊️
00:34
DO$HIK
Рет қаралды 6 МЛН
Correcting Common Async/Await Mistakes in .NET - Brandon Minnick
1:00:11
NDC Conferences
Рет қаралды 167 М.
Git patterns and anti-patterns for successful developers : Build 2018
20:26
Microsoft Developer
Рет қаралды 129 М.
Why I Don't Like Singletons
29:05
The Cherno
Рет қаралды 82 М.
Change your habits: Modern techniques for modern C# - Bill Wagner
55:46
NDC Conferences
Рет қаралды 251 М.
An Introduction to Blockchain with Mark Russinovich : Build 2018
1:17:08
Microsoft Developer
Рет қаралды 38 М.
Visual Studio and Xamarin: The future of app development  : Build 2018
1:15:40
Microsoft Developer
Рет қаралды 9 М.
Why I’m Switching To Go in 2024
8:10
Awesome
Рет қаралды 75 М.
Just enough C to have fun
39:29
Kay Lack
Рет қаралды 54 М.
Why Isn't Functional Programming the Norm? - Richard Feldman
46:09