C# 8 interfaces: Static members
-
Static members give us the ability to run code from an interface without an instance of that interface.
I'm obviously wrong, but I thought interfaces were so that you weren't bound to an implementation?
Sorry, nothing funny/insightful there. I'm just irked at the design choice...
-
Static members give us the ability to run code from an interface without an instance of that interface.
I'm obviously wrong, but I thought interfaces were so that you weren't bound to an implementation?
Sorry, nothing funny/insightful there. I'm just irked at the design choice...
If you're wrong, so am I. I don't understand why you'd want to use an interface for any of that. The author even shows that you can do exactly the same thing with a class at the end of the article. I have to agree with his earlier post instead: Jeremy Bytes: Interfaces in C# 8 are a Bit of a Mess[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Static members give us the ability to run code from an interface without an instance of that interface.
I'm obviously wrong, but I thought interfaces were so that you weren't bound to an implementation?
Sorry, nothing funny/insightful there. I'm just irked at the design choice...
If the static methods on the interface were limited to calling other methods on the interface, and static data members limited to interfaces or simple primitives, then I might agree with this idea. But yeah, it's borked, in my opinion.
#SupportHeForShe Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
-
Static members give us the ability to run code from an interface without an instance of that interface.
I'm obviously wrong, but I thought interfaces were so that you weren't bound to an implementation?
Sorry, nothing funny/insightful there. I'm just irked at the design choice...
:doh: Only because you can, it doesn't mean that you should...
M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.
-
Static members give us the ability to run code from an interface without an instance of that interface.
I'm obviously wrong, but I thought interfaces were so that you weren't bound to an implementation?
Sorry, nothing funny/insightful there. I'm just irked at the design choice...
Well thankfully, you can still implement interfaces the right way if you choose to...
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013 -
If you're wrong, so am I. I don't understand why you'd want to use an interface for any of that. The author even shows that you can do exactly the same thing with a class at the end of the article. I have to agree with his earlier post instead: Jeremy Bytes: Interfaces in C# 8 are a Bit of a Mess[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Probably Microsoft needs it for Android or iOS. Or at least this was the case with interface default implementations.
No more Mister Nice Guy... >: |
-
Static members give us the ability to run code from an interface without an instance of that interface.
I'm obviously wrong, but I thought interfaces were so that you weren't bound to an implementation?
Sorry, nothing funny/insightful there. I'm just irked at the design choice...
Glasses of water give us the ability to make TVs explode.
I wanna be a eunuchs developer! Pass me a bread knife!