S103 - What's Coming to C#?
Vložit
- čas přidán 31. 07. 2024
- Over the last year we shipped point releases of C#, full of small but useful language features. Mads will recap some some of these, before turning to the big things we have in store for the future: Nullable reference types, recursive patterns, asynchronous streams and more.
- Věda a technologie
Great session. Good to see C# preventing more run errors.
C# should be above Java in the list of most popular languages.
bp dev now oracle are going to start charging businesses for using java sde it will die.
Would like to see shorter videos of just the latest features. MS could also create a playlist to link each of the feature version together. I'm suggesting this for each tech. MS has.
Seriously. A full hour? A 5 minute highlight to sum up what's new would be great for the working stiff.
Thanks for improving C# to be more free styling. I was using C# from framework 2.0, that was kind of 2 different languages. Good job😬 ------- from a Chinese C# fan
I love c#
john avila 在中国用c#的都快饿死了
hi !! friend jin chen
@@user-mv9bn6vl9v come to latam here there are many companies with this technology, I have friends from china and from korea here they work
@@johnavila7651 There are fewer companies using C# in China. Chinese Internet companies mainly use java.
span.slice(1,2); is working in code before the array value assignment. but span.Reverse(); is working only after the array value assignment
Where can I get the "save the day with c#" tshirt?
that 'in' keyword melt my heart
Nice!
In span ranges can I use variables?
Yes, multiple inheritance is here! Fsck yeah!
With the introduction of default interface members to interfaces, what really is the difference anymore between interfaces and abstract classes?
You can inherit from multiple interfaces
Interface exposes the functionalities for the implementing class. Abstract classes are a partial implementation that must be extended upon.
Interfaces do not store data. Abstract classes can store data.
Abstract classes can implement an Interface.
Use abstract class to implement an interface when there will be multiple implementations sharing similar properties. e.g security configuration with username and password.
I looked last week and while C# has been on a upward path, Java has taken a nosedive ever since Oracle made the decision to start charging for the SE starting with version 11.
I am getting exception in the following code
var c = ref a.calculate(b);
Error CS8171 Cannot initialize a by-value variable with a reference
Please clarify my doubt
Where can I get a shirt like that?
what about vb?
If passing as non mutable ref is more efficient, then why not just do it always automatically without a new separate keyword to worry about?
Funny thing they still try to implement features from F# in C#. Things like pattern matching is way more intuitive in F# and I guess the default interfaces try to emulate the type system. Why not simply promote F# for functional styles and C# for object oriented? It makes way more sense (OOP kind of sucks in F# by the way)
I wonder how Javascript would fare if it were not essentially the browser language. :-) I wouldn't go near it.
I imagine that all of the Node.js folks would keep the numbers up. JS isn't just for browsers.
Will C# ever add a generic constraint for "numbers" which allows us to write generic methods which take int, long, float etc and use operators like + or - etc on the generic types, please?
For example a generic method with Sum(List numbers) where T : SomeNumberKeyword which allows use to pass a list of int or long etc and sum the values inside the generic method?
This is currently not possible because operators like + are not allowed inside generic methods, the only "workaround" is to copy/paste the method for every number type
There is a new feature called Shapes coming, probably for C# 8.0. A shape is basically an interface, i.e. it defines callable members, not there implementation, but with two important differences: 1) you can declare static members on it. 2) You can only use for generic constraints, you cannot implement it in classes (but you can inherit from other shapes when writing a shape). This would allow you to define a shape SNumber that defines the numeric operations like Addition, Substraction, Multiplication, Division, etc. and you can apply to a generic of a method like this: public static T Add(T x, T y) where T : SNumber => x + y;
Check out this GitHub issue for more infos: github.com/dotnet/csharplang/issues/164
Never seen these "shapes" before, thanks for the link!
to further simplify the syntax, Instead of ref int c, next we'll see int *c...history repeats itself. Just guessing :)
'int *c' is a valid declaration now, like c, c# has pointer in a way we need to explicitly say the code is unsafe, 'ref int' is a more safe way to deal with pointers like references
If history repeats itself, we should be able to use Smalltalk syntax in C# in some years. Would actually like that 😁
ref all the things
you can use a * instead of ref. :)
I use "ref" all of the time. It's almost a requirement when you do system-level work, and stuff where allocating data all of the time is prohibitive. Although I have no idea how adding an extension method make my life any easier...
Jesse Davis well, strings are immutable by default and are reference types. So basically 0 profit, still getting a copy. But ext-methods are more readable if named fluent way :)
Using caret in indexing to define X from the end is a terrible idea 'cause in RegExp it means "from the beginning". So if you work a lot with strings it will confuse you...
Good point!
Does anyone know what Windows laptop that is that the fella is using?
I think it's a Surface book 2
Rust S2
Edit: c# u2
Also.... is C# just now having support for passing by reference? What a great language it is......
You could always pass by reference. Is that what you got out of this video?
So, now that we can return a reference, does this mean we always have to be careful of returning a dangling reference?
no, just wrangling a deference... I could do more with VB6! and quicker! and then there was TurboPascal and Modula2 - a complete windowing OS in under 64 KILOBYTES. Just a bit more deckchair shuffling. I may try to use these features for a while, until the rug be jerked out from under my feet in the name of progress, yet again...
Is this still an interface? czcams.com/video/M0hdrybOKJg/video.htmlm35s
Because from my point of view this feature broke the definition of interface.
This looks like an abstract class...
the switch pattern is a big nope for me
in keyword for struct should be the default and be optional - struct should only ever be passed by ref (mutate) or by in (readonly). No other mechanism makes sense.
I am using c++ because I can make much faster application and I can make embedded application. If C# can evolve to do this I will use alot.
C# wasn't designed for that 😑
I know so I don't use so much.
Please, don't do default interface. It will make thing more complex than it will help.
What's Coming to VB.Net?
Seems no support
Coffin and nails!
"more freedom" is it really good? Everyone will do what they want, it will be unreadable hard to maintain code
Wtf.. where vb.net, yo?
Too long, didn't listen. Could please post an article so I can read it?
Adding more syntax sugar is not a feature, a feature is something like async/ await, LINQ, Extension methods or generics, by adding more syntax structures will make the language hard to learn and confused for the beginners,the written code will be more complex to read and understood. I'm not the one who can judge what language should be like but this is my opinion.
Stop moving the camera
Instead of faffing around with all this nullable reference types, you should just introduce Options.
Don't know why you're redoing Observables, which are a perfectly good way of dealing with asynchronous streams of data. Seems like a waste of time.
Make it like kotlin
Milad Azimi no
Nothing innovative unfortunately, but good work anyway :)
IAsyncEnumerable should shorten producer-consumer patterns A LOT and do that in asynchronous manner, this is kinda innovative I think
Microsoft version of JAVA. 😜😜😜
Well C# has actually more features that are still coming to Java, than vice versa. :)