C#'s Best features you might not be using

  Рет қаралды 28,844

dotnet

dotnet

Күн бұрын

Пікірлер
@wowojune9184
@wowojune9184 Ай бұрын
02:26 Pattern matching 10:04 File scoped namespaces 12:12 Init and required; 16:04 String literals 22:23 Records
@mmfarahat1
@mmfarahat1 Ай бұрын
Thanks 👍
@leakyabstraction
@leakyabstraction Ай бұрын
Another feature that I think few people use: value tuples & tuple destructuring assignments. Especially with async methods, where you can't use out parameters, it's super comfortable to return and assign multiple values. (I always find it odd how many developers seem to hate tuples, and they'd rather define a pointless class or struct just to be able to return multiple pieces of data from a single method)
@dr.angerous
@dr.angerous Ай бұрын
What ur talking about.
@bondymagnomous3544
@bondymagnomous3544 10 күн бұрын
The problem is, when you return something like (int myInt, string myString) and then your colleague needs to extend it, and starts returning (int myInt, string myString, Dictionary dict).
@lateefkareem
@lateefkareem 11 күн бұрын
Aside from pattern matching, I am already using all the features talked about in this video.
@cowboybebop2094
@cowboybebop2094 Ай бұрын
Wonderful session!! Thanks!!
@djflymethod
@djflymethod Ай бұрын
The required keyword makes parameter objects so much more useful as well. The pattern matching I’ve seen abused pretty badly though but I suppose any feature can be abused
@konrad2431
@konrad2431 Ай бұрын
All C# really needs is discriminated unions. F# type system is as good as Rust one. If C# had F# type system while still being C# it would be perfect... I like F# but I hate lack of { and } that makes code so much harder to track... I'm not a fan of trying to make everything backward compatible because it leads to weird design decisions and it doesn't leave much room for innovation - making the language feel "outdated". Would be cool if M$ actually created new language that is compatible with .NET ecosystem and takes all the best from Rust, F#, C#, Kotlin
@leakyabstraction
@leakyabstraction Ай бұрын
I agree, after having worked a lot with TypeScript in recent years. I'm originally coming from a dotnet/C# background, and I loved C# to no end, but these days I feel that its type system is sadly getting highly antiquated, often forcing you to jump through so many unnecessary hoops due to its rigidity. For example we have a model-driven application platform that is based on a JSON schema contract system from the consumer side, and it's virtually impossible to precisely model the component hierarchy in C# with inheritance (e.g. oneOf). I often feel like screaming when I have to resort to something crude or time-consuming while knowing that it would be the most trivial and elegant thing in TypeScript.
@pookiepats
@pookiepats Ай бұрын
It’s called V
@michaelgaziotis2538
@michaelgaziotis2538 Ай бұрын
First off, F# (being a functional-first language) has an older, better and more powerful inference and pattern matching model than Rust does, by a mile. And inference and pattern matching, make all the difference when using Algebraic Data Types like Discriminated Unions. Not to mention the immutable data types, which empower functional programming. I feel like dismissing and not using a really powerful functional language that has interoperability with the whole .Net ecosystem and seems to suit your requirements, only because of something as superfluous as handlebars { }, is preposterous. It takes about 1 day of programming in F# or Python to get used to it. Certainly not something as important to create a whole new .Net language around. Otherwise, patience, Discriminated Unions are coming to C#
@konrad2431
@konrad2431 Ай бұрын
@@michaelgaziotis2538 It's not only { and } but other stuff like args as well... No ( and ) you just separate it by space. I really love certain stuff F# has to offer, but I also don't want to write everything in purely functional manner. C# is simply more readable to me and doesn't make my eyes sore. V lang looks neat. I know I would be missing a lot of stuff from .NET ecosystem though... I might try it out for fun tho.
@mohammedalsaedi1410
@mohammedalsaedi1410 Ай бұрын
Here is some features you might not be using : DARK MODE!
@Gary216-vf2hh
@Gary216-vf2hh Ай бұрын
is there a book to incorporate all new features , remove outdated or old ones? a simplify , up to date best practice C#.
@leakyabstraction
@leakyabstraction Ай бұрын
I think that the backwards compatibility is getting a bit excessive, and it would be a good idea to "purge" every once in a while to avoid having a system that carries your 20 years old mistakes and now-obsolete approaches. I don't think everything can be handled in a purely additive fashion, and as the options to do the exact same thing grow, it gets more and more confusing, especially for new developers. But of course I do love C#, and I appreciate the innovations which were introduced - my biggest real issue with the language is actually that the type system feels extremely rigid these days. As another commented mentioned, we'd arguably really need discriminated unions. I personally also really miss the literal types that I use in TypeScript - it feels like C# is not just rigid, but also lacks expressive power and precision with that "a string is a string is a string" behavior. And if you want to avoid primitive obsession, it's always an overhead, even in the simplest cases.
@roddypine6077
@roddypine6077 2 күн бұрын
Really - Just kill 60% of all product source code - Can't imagine that happening at my work where we have apps that are running c# source since 2005.
@richardhauer4696
@richardhauer4696 Ай бұрын
not to be "that guy" but my OCD is getting itchy. @ - at sign & - ampersand { } - braces or curly braces ( ) - brackets or round brackets [ ] - square brackets if English isn't your first language, these things have different names than those used in the **otherwise wonderful** video
@dr.angerous
@dr.angerous Ай бұрын
Great showcase thanks
@olivier0003
@olivier0003 Ай бұрын
Fine to resume all these new features, Thanks
@hobis0b
@hobis0b Ай бұрын
C #이 언어 사양으로 개발되지 않기를 바랍니다. 그리고 golang과 같은 플랫폼 멀티 플랫폼에 더 중점을 두었으면 좋겠습니다. 그리고 성능에 더 중점을 두어야 합니다. Windows와 같은 운영 체제에 의존하는 언어는 지금 미래가 없습니다.
@omidpurdarbani
@omidpurdarbani Ай бұрын
C# does not depend on windows, its cross platform, you can run it anywhere, it is also getting much more faster in new versions with help of spans
@rich_in_paradise
@rich_in_paradise Ай бұрын
10:50 if Microsoft cared about how much horizontal space we have for code, they'd do something about the ludicrous number of margins for indicators, code folding and other junk to the left of the VS editor window.
@jem64130
@jem64130 Ай бұрын
File scoped namespaces : One more thing that has been around in VB since forever.
@positronalpha
@positronalpha Ай бұрын
I'm mostly baffled by the fact that people still default to fields and then use underscore prefixes to make sense of things.
@TheoWerewolf
@TheoWerewolf Ай бұрын
I really wish they'd: (a) Stop trying to turn C# into JavaScript, (b) Stop overloading every keyword into the ground, (c) Stop making C# as unreadable and cryptic as possible, (d) Stop trying to make C# overly terse... really, you type it once and the IDE helps you type it in most cases.
@Coburah
@Coburah Ай бұрын
I think that they're doing great design on the language. But to each their own! 😊 All of the changes listed in the video (except file scoped namespaces and strings literals) do not ONLY make the language more terse, but also improve the correctness of code. A regular switch statement is more prone to errors than a switch expression (this is true for statements VS expressions in a lot of cases). Init and required improves correctness when you are forced to use property setters instead of constructor arguments, deserialization being the prime example. Records improve value semantics and are immutable and therefore increase correctness. Etc
@Cryogenic1981
@Cryogenic1981 Ай бұрын
a) Is false b) there's no way to evolve a language without new keywords. c) Modern C# code is quite more readable than equivalent code written in say C#1.1 imagine that string mess without interpolated raw string literals. d) We have a VB programmer over here ... Relax it's not Perl, and new syntax in C# rarely for terseness but instead for new abstractions.
@NickMaovich
@NickMaovich Ай бұрын
you either don't know C# or you don't know Javascript. Which is it?
@UnashamedlyHentai
@UnashamedlyHentai Ай бұрын
(a) i don't want my language to have modern features (b) i don't want my language to have more features (c) i have difficulty learning new syntax (d) i want my language to stay exactly as it was when i learned it so i don't have to learn new things
@aborum75
@aborum75 Ай бұрын
@@NickMaovichperhaps both?
Advanced Pattern Matching in C#
26:24
dotnet
Рет қаралды 11 М.
번쩍번쩍 거리는 입
0:32
승비니 Seungbini
Рет қаралды 182 МЛН
Какой я клей? | CLEX #shorts
0:59
CLEX
Рет қаралды 1,9 МЛН
Their Boat Engine Fell Off
0:13
Newsflare
Рет қаралды 15 МЛН
Testing.Platform, the new way to run .NET tests
30:15
dotnet
Рет қаралды 13 М.
What's New in C# 12 | .NET Conf 2023
35:28
dotnet
Рет қаралды 58 М.
The New Option and Result Types of C#
15:05
Nick Chapsas
Рет қаралды 84 М.
Every single feature of C# in 10 minutes
9:50
Train To Code
Рет қаралды 164 М.
Is C BETTER than C++ for beginners? // Code Review
31:16
The Cherno
Рет қаралды 89 М.
Andrew Kelley   Practical Data Oriented Design (DoD)
46:40
ChimiChanga
Рет қаралды 153 М.
Deep dive on native AOT
27:47
dotnet
Рет қаралды 6 М.
번쩍번쩍 거리는 입
0:32
승비니 Seungbini
Рет қаралды 182 МЛН