Look at any in house IOC based app which are a significant % of non CRUD
 apps . Im a c# dev for the last 13 years  so i see how its evolved and  a
lot of code. I can point to some newer open source code but  I dont think
that tells you the scope its being used. Im not saying there is no
inheritance ..just less...

Yes compilers probably use it a lot more than most apps but its dangerous
eg these 2 C# to native compilers
https://github.com/mosa/MOSA-Project/tree/master/Source   Done well , uses
inheritance were appropriate and lots of interfaces
http://cosmos.codeplex.com/SourceControl/latest#source2/IL2CPU/Cosmos.IL2CPU/IL/Add.cs
 Not good  , i tried to make some changes for cross assembly inlining and
generics  and gave  up after a week.  Truely painful.

What advantage do you get for inheritance vs an interface .

Common code  ? Better done with constructor injection  ( interface , Func
or action )  , or factory pattern .
Performance .   Yes you can avoid more virt calls.

I think it comes down to the fact that when you pass common  / shared code
in via an interface there is less scope for obuse by the less eperienced
devs.  (Sure you have protected and private  but changing an interface or
an external class makes the dev ask the question is this the best way as
 that code can be used in many places. )

IOC made interfaces far more common  , as well as the Service / IService
pattern .
Then i saw more and more passing in Func<T> / Action<T> implementations
especially in place of the  factory pattern i was sceptical at first but
its very flexible and quick to write.

Ben


On Thu, Aug 29, 2013 at 3:01 AM, Jonathan S. Shapiro <[email protected]>wrote:

> On Tue, Aug 27, 2013 at 8:18 PM, Bennie Kloosteman <[email protected]>wrote:
>
>> - Inheritance used less and less and instead of a common base code ,
>> people are using a common class ( often injected with IOC) but are using
>> Action/Func delegates more and more to tie interfaces to common
>> implementations .  I think this is noteworthy as its similar to the way
>>  impl is done on an interface in some newer languages.
>>
>
> You've made variants of this statement before. It seems contrary to the C#
> code that I tend to see. What would you cite as supporting evidence?
>
>
> shap
>
> _______________________________________________
> bitc-dev mailing list
> [email protected]
> http://www.coyotos.org/mailman/listinfo/bitc-dev
>
>
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to