Комментарии:
I really don't understand the thinking about the range with 'up till', when every single 'range' in most languages it is 'up including', so why the sudden change in expected behaviour?
Normally when you see [1..4] you'd expect 1, 2, 3 and 4 not 1, 2 and 3.
Tim, this a great video on the new features - although Im a bit late bc I'm relearning c# after a 15 year hiatus. I just finished the Mastercourse and I'm glad I happened to found this. Thank you!
ОтветитьThanks Tim, much appreciated
ОтветитьHi Tim, Between 30.15 - 30.18 you used “cart” twice in lines 11 and 17 however you should have used “cart2” at line 17 then the result might have been as predicted?
ОтветитьIt feels like Default Interface methods break O in SOLID
Ответитьbro, you aren't sending source code. unsubscribing
ОтветитьAnother Important Video !!!
ОтветитьIs C# 8.0 available only in .NET core or also in .NET framework?
As of 2021
I like the default interface method feature, but I think this encourages developers to write bad code. I see as a solution for this versioning. just create a folder v2 for example with the same interface but in different namespace. I would only use default interface method where versioning is not possible. greate video as always!
Ответитьwell... i was hyped until i realised i should need to cast it as the interface
ОтветитьI would guess the motivation behind using [^1] instead of [^0] is to follow convention established by other languages (such as Python). However using [-1] would have allowed various mistakes in index calculation to resurface. Hence they used a different char for "negative" indices while keeping the convention
ОтветитьWell I spent 10 years in c# programming. Loved the video.
ОтветитьThanks a lot! That's pretty clear!
ОтветитьHi Tim, really want to appreciate your effort here, these videos are super-helpful. I have one question though, providing default implementation to interface methods frees the class from implementing it, doesn't it violates the interface segregation principal? This way interfaces can easily bloat in a very short period and classes dont care as they dont have to implement them? What are your thoughts on this?
ОтветитьI think the default interface implementation is a nice alternative to extension methods (on interface). Also an up side is the class can have their own implementation if they beg a difference with the “extension method”.
ОтветитьGreat video! Thank you very much for creating it!
No. 2 default interface method - as I understand it is useful when a method receives object of type IShoppingCart already but now it needs to do something else, and you already have a tone of classes implementing this interface?
Your tutorials are just the best Tim! Easy to understand and rich in information. You have a fan here!!
ОтветитьI think default interface complicate things more with serious problems and bugs
ОтветитьImplementation in an interface definition? Inconceivable!
ОтветитьThanks!
ОтветитьI think default implementations in interfaces is a very bad idea.
ОтветитьPlease explain what and why of defensive copy
ОтветитьThanks Tim! Love your videos!
Ответитьlost interest at 5min in. really talk about what is new. I don't know why people explain stuff outside the main subject which is stupid for people looking for such subject. Did you think I'm looking for what is new in C# 8 while I don't know the deference between language and framework?!...
ОтветитьI am feeling ill today, so I'm lying on the sofa, catching up with a bunch of IAmTimCorey videos for fun. I thought I'd watch this one. I was curious about the default implementation of methods in interfaces. You mention that they don't cause a breaking change in the IShoppingCart example, but I see it as a breaking change, and here's why: The implementation of the interface (namely, the ShoppingCart class) doesn't break, it's true, but calling code could break. What if you had calling code like this: if (TheCart is IShoppingCart cart) { cart.CalculateSubTotal(); cart.CalculateTotal(); }? If CalculateSubTotal() needs to do something in order for the subtotal to display correctly in the UI, then ShoppingCart won't work properly. I realize that in that case, I shouldn't use a default implementation for CalculateSubTotal, but I'm struggling to find any case in which I wouldn't be testing the class from calling code to see if it supports an interface. The only case I can come up with is something like, say, double CalculateTax(), where there's usually no tax, and in that case my default implementation could return 0. Still, though, it's a source of bugs for my code if I forget to update the TenPercentTax class to override CalculateTax() and return SomeAmount * 0.10. I guess my point is, if the default implementation ever is incorrect, then I've got potential unforseen bugs in my code, and therefore, not using a default implementation forces me to address all classes that implement the interface. You could argue, correctly, that any code change is a potential source of bugs; I just see this one as inviting trouble, I guess. Just my two cents, and I realize not everyone will agree!
ОтветитьThank you. Your videos are great. It helps me a lot
ОтветитьWhen you write names[1..] for instance, what does it return? Is it just a view on the original array, or is it a new array object?
Ответить.net doesn’t “Compile the c#”. It’s a framework library to do useful things with c#
Ответитьsome of these new features give the programmers more possibilities to practice writing bad code and end up eventually with unmaintainable code
ОтветитьWouldn’t having default implementation of an interface defeat the purpose of interfaces because they are abstract
ОтветитьThanks
ОтветитьAnyone think that switch expressions look a lot like Rust's match expression?
ОтветитьWe need a video about C# 9 please Tim . thanks always
ОтветитьThank you!
ОтветитьI don't understand this using statement without curly braces. As I understand "the old way", it will tell GC explicitly when the variable is out of scope so it can proceed disposing it. But without braces, GC has to decide on its own when the variable is out of scope. So, how is that different opposed to not having using statement at all?
ОтветитьDo you have to be a paid subscriber in order to download the source code?
Ответитьswitch expressions seem very nice.
ОтветитьHi, excelent video. A question: you are introducing the Diamond Problem with this Default Interface Members. How's C# is going to handle this?
ОтветитьI started my own channel after being inspired by you. Thanks!
ОтветитьI'm on 12th minute and I already subscribed! Damn he is good at sharing the knowledge
Ответить