News for hackers. Stuff that matters.
Re:The Haskell / Snap ecosystem is as productive (or more) t... by mtrimpe on Friday April 27, 2012 @06:24AM (#3898398)
I agree very much.

As far as I'm concerned Java's biggest failure, orders of magnitude worse than all others, is to make java.lang.String a final class.

Re:The Haskell / Snap ecosystem is as productive (or more) t... by masklinn on Friday April 27, 2012 @06:32AM (#3898416)
I don't know:

1. having nullable references by default strikes me as a bigger issue

2. I don't see any reason I'd want to subclass String, actually (though I could see wanting to create an alternate implementation e.g. ropes-based). So String being a final class makes perfect sense as far as I'm concerned (unless it were an interface or some sort of "proxy" class as is often done in Cocoa). On the other hand, I'd give a phalange to easily create an unrelated type (typesystem-wise) with the same implementation. What `newtype` provides in Haskell.

Re:The Haskell / Snap ecosystem is as productive (or more) t... by mtrimpe on Tuesday May 01, 2012 @05:13PM (#3916396)
I must agree with the nullable one. Let's say the biggest failure that I haven't heard anyone else talk about.

As per your #2, that's what I was hinting at except that the implementation effort of final vs. non-final is negligible, thus making it harder to excuse as far as I'm concerned.

Re:The Haskell / Snap ecosystem is as productive (or more) t... by riffraff on Friday April 27, 2012 @08:51AM (#3898791)
how would a nominally different string type be better than wrapping the string ?

I mean I understand why having a Name, ZipCode or UUID stringish class helps ensure program correctness, I do not understand (out of ignorance) how it would improve your code vs a wrapper.

Re:The Haskell / Snap ecosystem is as productive (or more) t... by masklinn on Friday April 27, 2012 @12:41PM (#3899871)
> how would a nominally different string type be better than wrapping the string ?

* It is significantly less verbose, therefore simpler and more likely to be used at all. And less error-prone

* It can provide string APIs working on itself (either by default or through the aliasing declaration) precluding the need to manually re-implement things like comparisons or printing

Re:The Haskell / Snap ecosystem is as productive (or more) t... by scanr on Friday April 27, 2012 @08:53AM (#3898796)
It's amusing that in a thread about the advantages of Haskell, immutability is being identified as the largest failure a language has made.

I don't think immutable Strings are a bad idea but I do think it's unfortunate that Java:

- Made Strings immutable, used them everywhere, and only later worked out that perhaps CharSequence would have been better in a lot of places.

- Didn't provide a sensible way to handle Object extensions

Re:The Haskell / Snap ecosystem is as productive (or more) t... by ben0x539 on Friday April 27, 2012 @09:14AM (#3898857)
A class being final means that you can't derive from it in Java, not that instances of the class are immutable.
Re:The Haskell / Snap ecosystem is as productive (or more) t... by cashew on Friday April 27, 2012 @07:38PM (#3901517)
To ensure immutability of a type in Java, you typically need to prevent it from being extended.
Re:The Haskell / Snap ecosystem is as productive (or more) t... by yxhuvud on Friday April 27, 2012 @02:10PM (#3900325)
Biggest failure? try Integer(100) == Integer(100) and Integer(200) == Integer(200)
Re:The Haskell / Snap ecosystem is as productive (or more) t... by pjmlp on Friday April 27, 2012 @08:07AM (#3898673)
Why a failure?

String is final in most languages OO languages.

Re:The Haskell / Snap ecosystem is as productive (or more) t... by Produce on Friday April 27, 2012 @08:38AM (#3898766)
I would consider having any final classes in a standard library to be a failure. One of the pillars of OOP is extensibility.
Re:The Haskell / Snap ecosystem is as productive (or more) t... by pjmlp on Friday April 27, 2012 @10:59AM (#3899327)
Then you should learn about the fragile base class problem,

http://www.cas.mcmaster.ca/~emil/Publications_files/Mikhajlo...

API design is a very complex issue. Any change in a base class can have unintended consequences.

Specially in components sold as libraries to development companies, where you as a customer don't have access to the source code.

You're right, one of the OOP pillars is extensibility, but inheritance is just one way of doing it.

Re:The Haskell / Snap ecosystem is as productive (or more) t... by soc88 on Friday April 27, 2012 @08:23AM (#3898723)
Replied to the wrong comment?