What’s Wrong with OOP and FP

bearophile bearophileHUGS at lycos.com
Tue Nov 12 04:20:56 PST 2013


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


More information about the Digitalmars-d mailing list