Does functional programming work?
retard
re at tard.com.invalid
Sun Jan 3 20:15:28 PST 2010
Fri, 01 Jan 2010 22:23:03 +0000, dsimcha wrote:
> == Quote from Nick Sabalausky (a at a.a)'s article
>> "Walter Bright" <newshound1 at digitalmars.com> wrote in message
>> news:hhgvqk$8cj$2 at digitalmars.com...
>> > An interesting counterpoint to the usual FP hype:
>> >
>> > http://prog21.dadgum.com/55.html
>> Didn't read the original article, but the one being linked to is
>> completely in line with how I feel about not just FP, but all
>> programming paradigms, for example, OO: It's great as long as you don't
>> pull a Java or (worse yet) a Smalltalk and try to cram *everything*
>> into the paradigm.
>
> I actually think Smalltalk had the better idea. Java doesn't support
> any paradigm besides OO well, and neither does Smalltalk. The
> difference is that, in Smalltalk, at least everything is an object, so
> you can do "pure" OO well. Java is "almost pure" OO, but it lack of
> ints, floats, etc. being objects, combined with its lack of support for
> any paradigm that works well without ints, floats, etc. being objects,
> makes the language feel like a massive kludge, and leads to debacles
> like autoboxing to get around this.
>
> In multiparadigm languages like D, C++ and C#, the lack of ints, floats,
> etc. being objects is less of an issue because, although it's a wart in
> the OO system, noone is forcing you to use the OO system for
> **everything**.
In Java generics doesn't work with primitive types, in D it does. And
generics often happens to be the most useful way of providing
polymorphism in that context. In "pure OOP languages" all primitives are
objects so normal sub-typing works. That also solves the issue, although
it has an impact on performance. These are the main reasons why Java
feels kludgy in this area.
More information about the Digitalmars-d
mailing list