Thread overview | |||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
November 12, 2013 What’s Wrong with OOP and FP | ||||
---|---|---|---|---|
| ||||
I think you will be pleased with the argument, given D's philosophy: https://yinwang0.wordpress.com/2013/11/09/oop-fp/ |
November 12, 2013 Re: What’s Wrong with OOP and FP | ||||
---|---|---|---|---|
| ||||
Posted in reply to Luís Marques | On Tuesday, November 12, 2013 12:09:23 =?UTF-8?B?Ikx1w61z?=.Marques <luis@luismarques.eu>@puremagic.com wrote: > I think you will be pleased with the argument, given D's philosophy: > > https://yinwang0.wordpress.com/2013/11/09/oop-fp/ Yeah. Both OO and functional programming are useful, but trying to use any one paradigm exclusively always ends up contorting things. To make this clean, you really need to be able to mix and match paradigms as appropriate. On a related note, a classic blog post that I quite like on how Java takes OO too far is http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html The balanced approach that C++ and D take is definitely the better one IMHO (and D tends to do it better IMHO, since it better supports functional programming than C++ does, meaning that you end up with fewer FP solutions in C++ even when they'd be appropriate). - Jonathan M Davis |
November 12, 2013 Re: What’s Wrong with OOP and FP | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | Also, in the spirit of non-technical discussion, pro-D stuff, see slide 26: http://www.slideshare.net/jpetazzo/docker-and-go-why-did-we-decide-to-write-docker-in-go |
November 12, 2013 Re: What’s Wrong with OOP and FP | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | On Tuesday, 12 November 2013 at 11:27:51 UTC, Jonathan M Davis wrote: > On Tuesday, November 12, 2013 12:09:23 =?UTF-8?B?Ikx1w61z?=.Marques > <luis@luismarques.eu>@puremagic.com wrote: >> I think you will be pleased with the argument, given D's >> philosophy: >> >> https://yinwang0.wordpress.com/2013/11/09/oop-fp/ > > Yeah. Both OO and functional programming are useful, but trying to use any one > paradigm exclusively always ends up contorting things. To make this clean, you > really need to be able to mix and match paradigms as appropriate. > > On a related note, a classic blog post that I quite like on how Java takes OO > too far is > > http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html If Java takes OO too far, what to say about Smalltalk and derivatives? > > The balanced approach that C++ and D take is definitely the better one IMHO > (and D tends to do it better IMHO, since it better supports functional > programming than C++ does, meaning that you end up with fewer FP solutions in > C++ even when they'd be appropriate). > > - Jonathan M Davis The future belongs to multi-paradigm languages, I would say. What I miss still in languages like D, is the Hindley–Milner type inference, algebraic data types and pattern matching. -- Paulo |
November 12, 2013 Re: What’s Wrong with OOP and FP | ||||
---|---|---|---|---|
| ||||
Posted in reply to Luís Marques | Luís Marques: > https://yinwang0.wordpress.com/2013/11/09/oop-fp/ From the article: > but you can also write pure functions in C, for example: > > int f(int x) { > int y = 0; > int z = 0; > y = 2 * x; > z = y + 1; > return z / 3; > } > > You can do the same with assembly language too. Pure functions > don’t just belong to purely functional languages. You can write > pure functions in any language, but the important thing is, you > should be allowed to use side-effects too. Do you want to inform that author about the purity in D? :-) Bye, bearophile |
November 12, 2013 Re: What’s Wrong with OOP and FP | ||||
---|---|---|---|---|
| ||||
Posted in reply to Luís Marques | On Tuesday, 12 November 2013 at 11:39:23 UTC, Luís Marques wrote:
> Also, in the spirit of non-technical discussion, pro-D stuff, see slide 26: http://www.slideshare.net/jpetazzo/docker-and-go-why-did-we-decide-to-write-docker-in-go
Yes, Go has a big PR rolling machine on the web.
Given its spartan set of features and religious decisions, I doubt anyone would care, if it wasn't being developed at Google.
On the other hand, more people using strong typed languages with GC support as C and C++ replacement, is always positive.
Hopefully D will also have a piece of the pie.
--
Paulo
|
November 12, 2013 Re: What’s Wrong with OOP and FP | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paulo Pinto | Paulo Pinto: > What I miss still in languages like D, is the Hindley–Milner type inference, algebraic data types and pattern matching. Global type inference is too much complex in D, because of Turing-complete templates, OOP, very weak interfaces between modules in presence of separate compilation, etc, so it can't be done or it will become too much hard/complex/slow to do, so it's better to forget about it. Also, even in Haskell it's a good practice to write down the type signature of all global functions. The algebraic data types are handy, and Algebraic should improve (and if needed some feature should be added to D to make Algebraic better!). Regarding pattern matching, it introduces a significant complexity, but a limited form of it could be a good idea for D, with improvements in the switch and introducing an optional standard method unapply for structs and classes: https://d.puremagic.com/issues/show_bug.cgi?id=596 Bye, bearophile |
November 12, 2013 Re: What’s Wrong with OOP and FP | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | On 11/12/2013 04:20 AM, bearophile wrote: > Do you want to inform that author about the purity in D? :-) The author claims to have done programming language research. So, I guess he knows about D. (Come to think of it, people who created the Go language supposedly had such research as well but they did not (!) know about D. ;) ) I am surprised that the Reddit thread has not mentioned D yet: http://www.reddit.com/r/programming/comments/1qg5x8/whats_wrong_with_oop_and_fp/ Ali |
November 12, 2013 Re: What’s Wrong with OOP and FP | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ali Çehreli | Ali Çehreli:
> The author claims to have done programming language research. So, I guess he knows about D.
From what I am seeing in the last years in the good Lambda the Ultimate Blog, most people doing programming language research know everything about monads and zippers, but ignore D :-)
Bye,
bearophile
|
November 12, 2013 Re: What’s Wrong with OOP and FP | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | On Tuesday, 12 November 2013 at 15:27:36 UTC, bearophile wrote:
> Ali Çehreli:
>
>> The author claims to have done programming language research. So, I guess he knows about D.
>
> From what I am seeing in the last years in the good Lambda the Ultimate Blog, most people doing programming language research know everything about monads and zippers, but ignore D :-)
>
> Bye,
> bearophile
Sometimes I have feeling language researchers live in some strange imaginary world and never actually check how their ideas work in production code.
|
Copyright © 1999-2021 by the D Language Foundation