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
@stilkov What do you mean with "Point" class?
1
@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
@dkrizic Yes. So many concepts conflated in that example.
1
@stilkov So what do functional languages improve in this example?
1
Replying to @dkrizic
@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.

Sep 12, 2013 · 8:28 AM UTC

2
1
Replying to @stilkov
@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.
2
Replying to @stilkov
@stilkov @dkrizic I'm not feeling guilty for using a real world model in this case and staying with Point#distance