Love that C# keeps growing functional. Soon I won't have to beg people to do Haskell at work.
@willinton063 жыл бұрын
@@PaulSebastianM too abstract for most, including me
@obinator90653 жыл бұрын
@@PaulSebastianM don’t like the syntax
@TNothingFree3 жыл бұрын
When I learned Kotlin all I was thinking was "Why C# doesn't have it?" You can see real progress when you look at new languages like Kotlin and Rust which are absolute stunning from my point of view. Because they already implement immutability and record classes. Awesome!
@obinnaokafor62523 жыл бұрын
Scala is better with those things.
@reubenator3 жыл бұрын
"Stunning" is the correct word, when a language construct just allows you to express your intent without the word salad. I actually love that these languages continue to evolve, refine and learn from each other, it ultimately helps us devs "get to the point"
@matsalritzson34923 жыл бұрын
It doesn't go only one way. Rust is copying async/await from C#.
@AlexFeature3 жыл бұрын
The one thing that I absolutely love about C# is its elegance. It is such an intuitive and beautiful language.
@calvinwilson36173 жыл бұрын
Bringing some of the advantages of js/ts into C# just in time for blazor, i love it
@JosephHerrington3 жыл бұрын
With the changes in 7.x, 8 and now 9, it seems like they are laying the groundwork for transitioning to a more Functional style of programming. This reminds me of Scala. And I’ve always been a fan of Scala!
@beshy90123 жыл бұрын
I love c#.net core
@johnthetactician3 жыл бұрын
Hell yeah, screw Java
@charlesbaldo3 жыл бұрын
N7 Commander John Adopt Blazor and you can screw JavaScript too.
@hanspetervollhorst13 жыл бұрын
waiting for go#
@willinton063 жыл бұрын
@@hanspetervollhorst1 G#
@cascadengineering3 жыл бұрын
Blazor is not fit for interactive web-sites and is worse than React+TypeScript+ModX where you can also leverage SignalR to talk to C# API.
@r1pfake5213 жыл бұрын
What's the behavior of records with "advanced" types instead of basic string or int, for example will it be possible to add a List or Dictionry property to a record? How will it be immutable, since the List itself can still be changed? How will the copy (with expression) work with these types, will it "copy" the list reference or will it create a real copy of the list? How will it work with custom types as record properties, how will it be able to copy these or will it just "copy" the reference of these properties?
@yusufmohamedsalh83213 жыл бұрын
I think video is quite non explainory ,the one should try it himself
@rabidtommy3 жыл бұрын
Asking all the difficult questions, ones which will need answers
@ehsnils3 жыл бұрын
One thing that I think that records should have is a way to declare common fields for multiple records, especially for the case where you have the records stored in a database table where you want to have a unified declaration of primary key.
@facundo913 жыл бұрын
07:58 You mean "p1 == p3: {isEqual}". Please add a note, otherwise is confusing.
@briannielsbergh3 жыл бұрын
one word: AWESOME!!!!.....love the progress in the C# language.... .P Keep up the good work.
@zemom.a.81713 жыл бұрын
I wonder if theres ever gonna be rust-like memory handling? Instead of creating Verona to implement safe memory deallocation why not make this a thing in C# for the devs that need it?
@Rafael-vn2bo3 жыл бұрын
C# 9, years ahead of Java.
@ryanleemartin77583 жыл бұрын
F# 4, years ahead of C#9 . Sorry, I couldn't help myself.
@danielecerro37973 жыл бұрын
@@ryanleemartin7758 Q#, billions years ahead?
@charlesbaldo3 жыл бұрын
Daniele Cerro Z# the Omega
@ryanleemartin77583 жыл бұрын
@@danielecerro3797 HA! well If quantum computing was actually real, maybe. Let's hope!
@ryanleemartin77583 жыл бұрын
@@charlesbaldo Shit. I'd try Z# the Omega.
@Conficient3 жыл бұрын
Great description of records and why you would use them, thanks
@lbobrov3 жыл бұрын
I remember, that somewhen in the years between 2000 and 2007, there was a video podcast series which was called "The .NET Show" with Erica Wiechers :)
@ericnyamu99813 жыл бұрын
does the female name make it easy to remember the show ? lol
@SOMEONE-eq5bu2 жыл бұрын
@@ericnyamu9981 lol 😂😂🤣🤣, good point
@helshabini3 жыл бұрын
I wonder how would records work with EF. If I change an object in my context via a wither, will it change the record value in the database or recreate it with a brand new Id?
@simplegameplay14693 жыл бұрын
Definitely looking forward to use C# 9, 8 was an amazing entry. Now is there any way of making infix functions or there will be?
@nissanGold3 жыл бұрын
Wow records look like a really good and valuable feature! Great job dev team :)
@obinnaokafor62523 жыл бұрын
Yes it is very a valuable feature. Soon we will have record struct also. And these underpinning would help pave way for a better and superior discriminated union (DU) feature in C#.
@konstantinsarychev93053 жыл бұрын
Nice, but what about lists (or other custom ref types) inside records? Are the also going to be compared by content? And are they also get assigned by cloning the entire content?
@jackshen10283 жыл бұрын
Haskell has a huge code base for the immutable record style
@jasonracey96003 жыл бұрын
Every new C# version comes with a "new" feature that Scala has already had for a decade. Maybe C# 10 will have Option[T]? Or function currying? Or everything immutable by default? Place your bets.
@RenegadeVile3 жыл бұрын
Nearly every feature from every language has been done at some point somewhere else. Keep in mind that they're not claiming to have invented the wheel here. This is a new feature FOR C#, not a new feature among all programming languages.
@TheRetrospective3 жыл бұрын
Now that one sees this, it's so obvious. I'm only wondering why this wasn't part of C# much earlier, like 10 years ago? I guess sometimes innovation takes time to emerge and implement.
@orlovsskibet3 жыл бұрын
Your user name is so much embodied in your comment 😁
@bar10dr3 жыл бұрын
Awesome video, great dev presentation
@IBITZEE3 жыл бұрын
That guy really knows his stuff...
@aregaz213 жыл бұрын
Love your explanation, guys. Thanks for making this video 👍
@NevadaWilliford3 жыл бұрын
Personally, I think this looks great. Also, very clearly presented. Great job.
@phantastik33893 жыл бұрын
I hope you guys have a book ready so can study c#9
@SJ-mp2hk3 жыл бұрын
This was awesome! Thank you 🙏🏾
@FilipCordas3 жыл бұрын
I like typescript syntax with {...p1} then the f# way makes a bit more sense. On that question can you use with keyword with two different record types?
@Kitulous3 жыл бұрын
Why would you need it? 'with'-expression allows you to get an existing record WITH some other properties. If you need to fully overwrite the record just pass the second one lol.
@FilipCordas3 жыл бұрын
@@Kitulous It just a personal preference mostly because it would work for arrays as well not just objects. And this is not only a see for using modified object you do use it for shallow copies as well
@yusufmohamedsalh83213 жыл бұрын
Hi Jared,you should press 'insert' to get rid of the cursor.
@joshdeshazer16983 жыл бұрын
I love it ready to use records. Thank you team
@marcosrocha3 жыл бұрын
So, we might substitute our POCO classes for records?
@s3rg3yg3 жыл бұрын
And DTOs
@RenegadeVile3 жыл бұрын
That's pretty much what records would be useful for yeah.
@mp95083 жыл бұрын
Syntactic saccharin.
@chrissolutions3 жыл бұрын
@@JP-hr3xq Disagree. I love switch expressions.
@Novalarke3 жыл бұрын
C#9? I know it well: C#, E#, G#, B and D# . . . What? Oh.
@hanspetervollhorst13 жыл бұрын
Can you define methods on records?
@r1pfake5213 жыл бұрын
Yes, it's just "syntax sugar" they are still normal classes, you can even subclass them.
@RenegadeVile3 жыл бұрын
Like the other commenter said, all record does is generate common operations for value types for you. So member-by-member equality comparison, etc. things you would commonly do when implementing interfaces like IEquatable. But beyond that, it's still just a class so you can do everything else with them that you can with a class. However, once you start considering adding complex methods and states to your record, you should start asking yourself the question whether it should be a record at all.
@RayHorn51280880563 жыл бұрын
Could have done record with a smart superclass but what they hey. Kudos for the effort.
@obinnaokafor62523 жыл бұрын
What do you mean by "with a smart superclass"? Just asking an honest question. Thank you.
@Kitulous3 жыл бұрын
@@obinnaokafor6252 Probably something like class Person : Record {} which would take care of equality and stuff
@RenegadeVile3 жыл бұрын
@@Kitulous Wouldn't you, at some point, still need to define the equality comparison, for example? A member-by-member comparison? This is something that record also avoids. If you add a new property to Person, but forget to add it to your equality check, you've introduced a sometimes subtle bug.
@freezefrancis2 жыл бұрын
Records are just scala case classes i believe
@paulfunigga3 жыл бұрын
A whole zoo of features
@Zapanath3 жыл бұрын
I guess we can get rid of F# now. Records is only new to C# , F# devs have had records for ages.
@Samiron3 жыл бұрын
Is the record reference type? Can I create value type "record"?
@tbg101013 жыл бұрын
When will I be able to use some of these nice things with readonly structs?
@krigrtrue3 жыл бұрын
Where is extend everything
@DheerajUthaiah3 жыл бұрын
Wow!!
@ihorbond3 жыл бұрын
Amazing! Excited to try these out in the .net 5 app I'm about to build for a client !
@clay99633 жыл бұрын
He uses vsvim...
@joaoalexandretoledo38843 жыл бұрын
He wrote VsVim!
@willinton063 жыл бұрын
@@joaoalexandretoledo3884 damn
@Rauly45573 жыл бұрын
Very Cool!
@brunoccs3 жыл бұрын
What's the difference between struct and record?
@willinton063 жыл бұрын
Deconstruction is easier
@ikanreed8163 жыл бұрын
Records aren't value types, regardless of whether they're mutable, they're still passed up and down the stack as references.
@wizardarss3 жыл бұрын
Such magic only hurts. Make better compilation with CoreRT. Good innovations: stack allocated, intrinsiсs, BCL optimization, nothing else.
@zemom.a.81713 жыл бұрын
Project snowflake/Rust-like deallocation would also be a very nice tool for developing every application thats involved in the media/digital art industry.
@Esico63 жыл бұрын
Feedback from customers? Which customers? C# and .Net is free.
@piromanaBG3 жыл бұрын
You can pay for support
@willinton063 жыл бұрын
KZbin is free yet we’re KZbin customers
@crash19981003 жыл бұрын
18:20 Why not just use readonly
@zemom.a.81713 жыл бұрын
Yeah...
@r1pfake5213 жыл бұрын
One difference between readonly and init is that you can set init properties in an object initializer syntax which is not possible with readonly
@crash19981003 жыл бұрын
@@r1pfake521 Oh, I thought it was. Kinda weird that's not possible for readonly
@davidmil153 жыл бұрын
@@crash1998100 it’s not weird really. The initializer syntax is just sugar for setting properties and that happens after construction.
@LivingTheDream213 жыл бұрын
I feel like Rich Lander is abrasive or condescending. 1:06 6:02 and probably more, but I'm just at the 6 minute mark.
@mihaimyh3 жыл бұрын
So, records are the way to go from now on, we ditch classes?
@zemom.a.81713 жыл бұрын
Well, records ARE classes. And in OOP,mutating states are sometimes requires. If you, for example, have a UI system and bind a textbox to a string-property to determine a class's state, then making the class immutable would be counter-productive since often times user-input needs to mutate object-state.
@r1pfake5213 жыл бұрын
@@zemom.a.8171 I always wonder what kind of software the "everything immutable" people develop, because I can't see how developing something like editor with UI or games with so many game states would work reasonable without mutable objects, it sounds like a horrible mess to me, but maybe im just not lighted by the power of "everything immutable" yet.
@matsalritzson34923 жыл бұрын
@@r1pfake521 In a proper functional programming language you have copy on write. Under the hood it's still references to the same objects. But once you start to change something you create a copy of it and do your modifications there. The cool thing is that this simplifies stuff alot when dealing with threading. Some stuff will be more difficult, but others will be alot easier.
@RenegadeVile3 жыл бұрын
No, records will be primarily useful for DTOs or plain old data classes. If you have any experience with C++, for example, there we would use structs that just contain some public members and that's it. For things that still require methods, state or complex logic, you'll still want to use classes. Especially if you need reference semantics for your type as opposed to value.
@CoryTaylor9043 жыл бұрын
So basically, they are picking f# features and running with it.
@bruceke133 жыл бұрын
OMG MY EYES, THE WHITEMODE
@3N353 жыл бұрын
Voavv. Çok iyi olmuş.
@3D_Printing3 жыл бұрын
"Hello world,"
@gavinlangley84113 жыл бұрын
Record sounds great but you need the idea of key, key matching and data not equal. So you need something like Record as (TKey, TValue) ...
@user-gt2gy8wo3h3 жыл бұрын
Could you pls share the vim emulator extension name you were using in VS?
It's a bit disturbing to see a space between method name and {, and no space between method name and (. But at least you use the superior bracing method. ;)
@rehanahmed62103 жыл бұрын
👍👍👍
@madmonad36783 жыл бұрын
Sadly immutability is still not fully embraced; as "x with { ...}" is a poor substitute for value optics like lenses. Secondly it's ridiculous that C# still hasn't added a discriminated union type similar to F#.
@mariacobretti3 жыл бұрын
PogChamp
@siyabongadlamini29043 жыл бұрын
I love it
@nitsanbh3 жыл бұрын
“Records” exist in Python and Kotlin for years now... they’re called “Data Classes”
@RenegadeVile3 жыл бұрын
WEll, in all fairness, in C# itself, they're also existed since its inception. Either use structs or implement the required overrides and interfaces in a class. This is just a quality of life improvement.
@47Mortuus3 жыл бұрын
delegate*
@uthoshantm3 жыл бұрын
I feel C# is becoming more and more bloated.
@sps0143 жыл бұрын
I Don't think so, C# is evolving in the right direction.
@nissanGold3 жыл бұрын
Most of these features look like syntatic sugar if you dont want to learn it you dont have to.
@brokula13123 жыл бұрын
@@nissanGold And how do you know what you have to or not to learn? It is bloated. Beside C++ probably the biggest bloat in industry.
@obinnaokafor62523 жыл бұрын
That is a very wrong notion to hold. C#/ .NET is still one of the top fastest and most productive platform out there. With record, one can cut down all the ceremonies and boilerplates codes. Unless you are being paid by the lines of code you write?
@obinnaokafor62523 жыл бұрын
@@brokula1312 So you would want C# to just remain the way it is since 20 years ago? If not there would not have been LINQ, Lambdas, async await, extension method etc. Languages which are still relevant evolve. And C# is still one of the relevant languages out there. Records are good with machine learning and building models. And it helps cut down some boilerplates. Even Java is getting reocrds.
@josephang99272 жыл бұрын
I hate that fat cursor.
@NativeEngine20173 жыл бұрын
Only C++ )))
@RenegadeVile3 жыл бұрын
My mind went straight to C++ too at the sight of record.
@westernvillager3 жыл бұрын
Very nice talk! But please improve your typing 😜
@anomalii77203 жыл бұрын
Hmmm, something i will NOT use.
@vivekvenugopal84113 жыл бұрын
That makes two of us
@r1pfake5213 жыл бұрын
Same, for these "dumb" serialization classes I never cared about value equality, constructor deconstruct or anything like that, so they only contain public get, set properties which isn't really that much code and I would rather have the "default" reference equality in the rare cases where equality is used for example if I have to remove these objects from a list or dictionary I want to remove the actual instance I pass and not some other instance which has the same values.
@user-dy8dl6xu5w3 жыл бұрын
Too weird syntax
@obinnaokafor62523 жыл бұрын
How is it weird? Could you clarify?
@user-dy8dl6xu5w3 жыл бұрын
1. Why can not create a new instance "inline" without a ctor without the new keyword init? (duplicate ctor for example)
@willinton063 жыл бұрын
@@user-dy8dl6xu5w that’s as old as time, it’s not a C# 9 feature
@janjoska25493 жыл бұрын
Jees, use resharper.
@kotzulla3 жыл бұрын
someone still using c#????
@RenegadeVile3 жыл бұрын
Yes? A lot of people? A lot of people also still use C and C++, both to great effect. Programming language is just a tool. It's much more important how you use it, and what you use it for.
@jake82173 жыл бұрын
Oh my sweet summer child...
@dsmyify3 жыл бұрын
It feeds the family.
@marcusreinicke3 жыл бұрын
Excuse me, but I find most innovations easy especially those that were not shown, just garbage. Most changes make the source code less legible. Unfortunately, this is not an innovation, it is something that very specific people wished for. It seems to me that you don't have any decent ideas for improving the C # language. Maybe you should turn away from C # slowly, because the straight lines are becoming more and more weakened. That's my personal opinion, but it makes me sad to see C # continue to degenerate. I would advise a programming team to forbid C # 9.0 in the style guides. Only bad
@asadahmed49933 жыл бұрын
Haha copying python now! no wonder Python is the boss 😎
@obinnaokafor62523 жыл бұрын
Async & await? Linq and Lambdas? Auto-properties? Lol
@piromanaBG3 жыл бұрын
Sorry: IndentationError
@paulwojcik18563 жыл бұрын
Have just learnt Python (for a real job), been programming professionally since DOS 3.3 and have used every language you can imagine. Thank god I have C# for my job (Windows/Linux/Cloud + embedded) and don't have to use Python all the time, what an awful piece of work that is. Passing self to every class member so that it knows it is itself (even though I indented under a class def), really? Its like handing myself my own picture and ID every morning just to know who I am when I wake up. And what about a ++ operator so I can increment values inline (C and C++ had it when python come along) or a simple switch statement, huh? Maybe Python should get the basics right before bragging :-)
@milisha983 жыл бұрын
@Asad Ahmed Records were found in many languages before Python was even a twinkle in Guido van Rossum's eye. Even other Microsoft languages, such as F# even has had records and discriminated unions since inception.
@RenegadeVile3 жыл бұрын
No language is the boss. Depends on what you need done.