News for hackers. Stuff that matters.
Re:Why C# is the best language for mobile development by bigdubs on Wednesday January 02, 2013 @02:40PM (#4998740)
Well, off the top of my head C# doesn't support mixins or multiple inheritance.

You can get around the lack of mixins with extension methods and tight scoping but it's messy.

Re:Why C# is the best language for mobile development by SeanLuke on Wednesday January 02, 2013 @02:53PM (#4998835)
> Well, off the top of my head C# doesn't support mixins or multiple inheritance.

I was not aware that Smalltalk provided either.

Re:Why C# is the best language for mobile development by dfox on Wednesday January 02, 2013 @03:09PM (#4998944)
There are libraries that add both of these features at once (either by defining new (meta)metaclasses or by simulating same effect through simple copying of methods from base classes.)

On the other hand, Smalltalkers are quite keen on adding new methods to almost any existing system class, so mixins are not often as useful. Also Smalltalk development often relies on IDEs that do pretty extensive code generation behind the scenes and I think that this image based development with no real source code to speak of, and lots of reflection based development tools, is more important aspect of Smalltalk than any OO features.

Re:Why C# is the best language for mobile development by amirrajan on Wednesday January 02, 2013 @03:07PM (#4998933)
That is a false statement. dynamic C# 4.0 can do mixins: http://amirrajan.net/Blog/dynamic-c-sharp
Re:Why C# is the best language for mobile development by bigdubs on Wednesday January 02, 2013 @03:59PM (#4999249)
so, yes this leveraging of dynamic metadata provider technically satisfies the requirements for a mixin, but you're still not applying this mixin to a poco, therefore i don't think it's fair to say the language/spec supports it natively.

this is another example of adding mixins to .net code via 3rd party library: http://remix.codeplex.com/

Re:Why C# is the best language for mobile development by amirrajan on Wednesday January 02, 2013 @04:09PM (#4999320)
"but you're still not applying this mixin to a poco"

Clarify?

Re:Why C# is the best language for mobile development by bigdubs on Wednesday January 02, 2013 @04:33PM (#4999445)
POCO = Plain Old (CLR) Object

The distinction I'm drawing here is what is meant by 'natively supports' and 'supported via a 3rd party library'

Re:Why C# is the best language for mobile development by amirrajan on Wednesday January 02, 2013 @07:51PM (#5000403)
That's what I need clarification on. the dynamic keyword wasn't provided by any 3rd party library (it's part of the C# language specification)... how is System.DynamicObject and IDynamicMetaObjectProvider different then System.Object? All poco's inherit System.Object. Do you consider System.Object as 3rd party? True, by default poco's don't inherit from System.DynamiObject. Does that make it not 'natively supported'?
Re:Why C# is the best language for mobile development by bigdubs on Friday January 04, 2013 @09:24PM (#5011167)
No, what I mean by that is in order to use mixins, in any example I've seen, you need to inherit from a class someone else provided that gives it.

Assembly provides all the mechanisms for the dynamic keyword, I wouldn't say it is a feature of x86.

Re:Why C# is the best language for mobile development by king_magic on Wednesday January 02, 2013 @03:05PM (#4998924)
C#'s (and Java's) lack of multiple inheritance is a virtue, IMO.
Re:Why C# is the best language for mobile development by bigdubs on Wednesday January 02, 2013 @04:04PM (#4999287)
I generally agree that use of mixins / multiple inheritance leads to architectural missteps.
Re:Why C# is the best language for mobile development by nnq on Thursday January 03, 2013 @03:06AM (#5001420)
...aren't they completely different tools? One uses mixins to keep the class hierarchy shallow, with fewer levels of inheritance. OTOH multiple inheritance tends to complicate an overly convoluted class hierarchy most of the time. It's true that in a language like Python people use multiple inheritance to "simulate mixins", but it's to the same good effect of keeping the class hierarchy short and flat, but in C++ at least I've never seen MI used to simplify things, as opposed to mixins that always seem well used...