4 ms·
>What if you don't test with the right sub-class? What if it's an int, but it's out of the range you expect? Type systems can do all this and more. https://gi
by runT1ME 13y ago
>What if you don't test with the right sub-class? What if it's an int, but it's out of the range you expect?
Type systems can do all this and more.
https://github.com/milessabin/shapeless/wiki/Feature-overview:-shapeless-2.0.0 https://github.com/milessabin/shapeless/wiki/Feature-overvie...
They can assure you handle all possible control flow cases with ADTs and pattern matching, they can facilitate automated testing, etc.
Just because it's not how java/c# do it, doesn't mean it's a limitation of 'typing'.
- ubernostrum 13y agoThe problem is that your argument is basically boiling down to "this hyper-experimental language that only three people on earth use can do it, therefore you should use Java/C++/C#".
- saryant 13y agoShapeless is a Scala library, not a language.
- asdasf 13y agoHow very dishonest of you. It actually boils down to "a bunch of common languages do it right, so use one of those instead of java".
- ubernostrum 13y agoWell, no, the dishonesty is basically in arguing that statically-typed languages have all sorts of wonderful features... while omitting that the set of statically-typed languages which have those features, and the set of statically-typed languages people actually use, do not overlap much.
- runT1ME 13y agoLinkedIn, Twitter, FourSquare, Netflix, Rackspace, Firebase, Hulu and a ton of others use Scala. How is that dishonest?
- ubernostrum 13y agoIt's dishonest because no matter how many hot HN-echo-chamber companies you can find using Scala, it is still a language that nobody uses, in terms of the broader industry.
- asdasf 13y agoNo. Discussing what static type systems do means discussing what static type systems do. Not pretending static type systems can't do anything java doesn't do. We don't judge dynamic typing by how shitty PHP is for the same reason. Dynamic typing is not what made PHP shitty, it just happens to be both dynamically typed and shitty.
- masklinn 13y ago> this hyper-experimental language that only three people on earth use can do it That's dishonest. That's the kind of stuff Ada or Haskell do. The linked repository is a Scala library.