Re: Blog post : OOP composition with mixins

2015-09-01 Thread via Digitalmars-d-announce

On Monday, 24 August 2015 at 11:10:16 UTC, Dicebot wrote:
Rough summary of the talk I have given for recent Berlin D 
meetup event:

https://blog.dicebot.lv/posts/2015/08/OOP_composition_with_mixins


I'm having trouble resolving that DNS name.


Re: Blog post : OOP composition with mixins

2015-09-01 Thread Dicebot via Digitalmars-d-announce

On Tuesday, 1 September 2015 at 10:18:08 UTC, Luís Marques wrote:

On Monday, 24 August 2015 at 11:10:16 UTC, Dicebot wrote:
Rough summary of the talk I have given for recent Berlin D 
meetup event:

https://blog.dicebot.lv/posts/2015/08/OOP_composition_with_mixins


I'm having trouble resolving that DNS name.


Technical server issues, should be back now.


Re: Blog post : OOP composition with mixins

2015-09-01 Thread Dicebot via Digitalmars-d-announce

On Tuesday, 1 September 2015 at 13:44:15 UTC, cym13 wrote:
BTW, a bit HS but in your article about Rust 
(https://blog.dicebot.lv/posts/2015/01/thoughts_about_rust_from_d_programmer) there is a “” lying in the first example.


Thanks, fixed.


Re: Blog post : OOP composition with mixins

2015-09-01 Thread Dicebot via Digitalmars-d-announce

On Tuesday, 1 September 2015 at 14:11:44 UTC, Meta wrote:

On Monday, 24 August 2015 at 11:10:16 UTC, Dicebot wrote:
Rough summary of the talk I have given for recent Berlin D 
meetup event:

https://blog.dicebot.lv/posts/2015/08/OOP_composition_with_mixins


Are you planning on submitting this article to Reddit/Hacker 
News?


There is something wrong about submitting own articles into 
aggregators :) Feel free to do so if you want to.


Re: Blog post : OOP composition with mixins

2015-09-01 Thread cym13 via Digitalmars-d-announce

On Tuesday, 1 September 2015 at 11:36:49 UTC, Dicebot wrote:
On Tuesday, 1 September 2015 at 10:18:08 UTC, Luís Marques 
wrote:

On Monday, 24 August 2015 at 11:10:16 UTC, Dicebot wrote:
Rough summary of the talk I have given for recent Berlin D 
meetup event:

https://blog.dicebot.lv/posts/2015/08/OOP_composition_with_mixins


I'm having trouble resolving that DNS name.


Technical server issues, should be back now.


BTW, a bit HS but in your article about Rust 
(https://blog.dicebot.lv/posts/2015/01/thoughts_about_rust_from_d_programmer) there is a “” lying in the first example.


Re: Blog post : OOP composition with mixins

2015-09-01 Thread Meta via Digitalmars-d-announce

On Monday, 24 August 2015 at 11:10:16 UTC, Dicebot wrote:
Rough summary of the talk I have given for recent Berlin D 
meetup event:

https://blog.dicebot.lv/posts/2015/08/OOP_composition_with_mixins


Are you planning on submitting this article to Reddit/Hacker News?


Re: Blog post : OOP composition with mixins

2015-09-01 Thread Meta via Digitalmars-d-announce

On Tuesday, 1 September 2015 at 14:32:11 UTC, Dicebot wrote:

On Tuesday, 1 September 2015 at 14:11:44 UTC, Meta wrote:

On Monday, 24 August 2015 at 11:10:16 UTC, Dicebot wrote:
Rough summary of the talk I have given for recent Berlin D 
meetup event:

https://blog.dicebot.lv/posts/2015/08/OOP_composition_with_mixins


Are you planning on submitting this article to Reddit/Hacker 
News?


There is something wrong about submitting own articles into 
aggregators :) Feel free to do so if you want to.


Sounds good to me.

https://www.reddit.com/r/programming/comments/3j8bi2/oop_composition_with_mixins_in_the_d_programming/


Re: Blog post : OOP composition with mixins

2015-08-31 Thread jmh530 via Digitalmars-d-announce

On Monday, 24 August 2015 at 11:10:16 UTC, Dicebot wrote:
Rough summary of the talk I have given for recent Berlin D 
meetup event:

https://blog.dicebot.lv/posts/2015/08/OOP_composition_with_mixins


It seems like mixin templates can be used like alias this, but 
mixin templates are more general. When would I want to use alias 
this instead of a mixin template?


Re: Blog post : OOP composition with mixins

2015-08-31 Thread Dicebot via Digitalmars-d-announce

On Monday, 31 August 2015 at 14:44:27 UTC, jmh530 wrote:

On Monday, 24 August 2015 at 11:10:16 UTC, Dicebot wrote:
Rough summary of the talk I have given for recent Berlin D 
meetup event:

https://blog.dicebot.lv/posts/2015/08/OOP_composition_with_mixins


It seems like mixin templates can be used like alias this, but 
mixin templates are more general. When would I want to use 
alias this instead of a mixin template?


`alias this` is more suitable for cases when reused functionality 
is self-contained and useful separately. It is closer in spirit 
to inheritance because you take existing entity and provide its 
API as part of new aggregate.


As a simple rule of a thumb, I'd go for `alias this` approach 
when mixed in functionality does not need to know anything about 
surrounding context (== has no template parameters). mixin 
template feels more convenient for small configurable building 
blocks that don't have well-defined semantics without any 
specific context.


Important difference between `alias this` and `mixin` is that 
`alias this` allows implicit casting to the aliased field type - 
which can be both merit and drawback depending on design 
intentions.


Re: Blog post : OOP composition with mixins

2015-08-31 Thread Abdulhaq via Digitalmars-d-announce

On Monday, 24 August 2015 at 13:28:23 UTC, Atila Neves wrote:

On Monday, 24 August 2015 at 11:10:16 UTC, Dicebot wrote:
Rough summary of the talk I have given for recent Berlin D 
meetup event:

https://blog.dicebot.lv/posts/2015/08/OOP_composition_with_mixins


Nice. I've only just started exploring code reuse with template 
mixins, and used it to great effect in my last project. Blogs 
like this are useful since there aren't many examples in other 
languages (Ruby modules come to mind).


Atila


Inheritance certainly is 'the base class of all evil'. I have a 
theory that the reason inheritance is so overused in OOP 
languages lies in the way it is taught - the OOP aspects cover 
much of the syntax of the language and hence much teaching 
material revolves around inheritance. This makes the student 
believe that inheritance is therefore the 'right way' to proceed. 
Many years of pain have, however, taught me to avoid inheritance 
and to prefer composition - even/especially when using e.g. Java.


Re: Blog post : OOP composition with mixins

2015-08-25 Thread thedeemon via Digitalmars-d-announce

On Monday, 24 August 2015 at 16:21:04 UTC, Dejan Lekic wrote:

What I think D community would benefit from would be a series 
of Idiomatic D articles.


This collection of short pieces comes to mind:
http://p0nce.github.io/d-idioms/


Re: Blog post : OOP composition with mixins

2015-08-24 Thread Atila Neves via Digitalmars-d-announce

On Monday, 24 August 2015 at 11:10:16 UTC, Dicebot wrote:
Rough summary of the talk I have given for recent Berlin D 
meetup event:

https://blog.dicebot.lv/posts/2015/08/OOP_composition_with_mixins


Nice. I've only just started exploring code reuse with template 
mixins, and used it to great effect in my last project. Blogs 
like this are useful since there aren't many examples in other 
languages (Ruby modules come to mind).


Atila


Re: Blog post : OOP composition with mixins

2015-08-24 Thread Dejan Lekic via Digitalmars-d-announce

Good article.

However, composition also has some drawbacks and they should be 
explained.


Speaking about Java and inheritance, and popular believe it is 
overused - Yes, maybe it is, but Java does not have language 
features D has, and it should not be blamed for that. Interesting 
article for those looking for more serious criticism of Java 
and inheritance: 
https://www.cs.auckland.ac.nz/~ewan/qualitas/studies/inheritance/TemperoYangNobleECOOP2013-pre.pdf


What I think D community would benefit from would be a series of 
Idiomatic D articles.


Blog post : OOP composition with mixins

2015-08-24 Thread Dicebot via Digitalmars-d-announce
Rough summary of the talk I have given for recent Berlin D meetup 
event:

https://blog.dicebot.lv/posts/2015/08/OOP_composition_with_mixins