After you've done some functional programming, you start to wonder how you ever could have considered methods on a “Point” class a good idea
2
19
6
@dkrizic A class with two or three coordinates. And the kind of method I'm referring to is something like "distance"
1
@stilkov Ok, "Point" literally. A method like double d = p1.distance( p2 ); ?
1
@stilkov So what do functional languages improve in this example?
1
@dkrizic You just build a function distance(p1, p2) without feeling guilty. Not that you couldn't do that in Java, but you typically don't.
2
1
@stilkov Ok, now I get you, but like @rotnroll666 I do not feel guilty adding Point#distance, I don't know how to do it better in Java
1
@dkrizic @rotnroll666 That's my point: what's idiomatic in Java doesn't necessarily make sense.
Sep 12, 2013 · 8:34 AM UTC
2


