Hacker News new | ask | show | jobs
by rue 5317 days ago
Scala, with its “type-level programming”, crazy operator overloads and weird DSLs, is at a similar precipice as C++ was back when people started doing insane stuff with template metaprogramming (around the time of Alexandrescu's “Modern C++ Design”, 2001 maybe?).

Unfortunately, I don't think many Scala users were around at that time or in that community, so lessons of the past might be learned the hard way again.

There are many encouraging signs too, though, toward better and simpler practices. We'll see which way things go.

1 comments

Yes, I guess I answered the letter of his question... but I personally wouldn't use collection types indexed by a size unless (a) I really really needed to be sure about this particular invariant (b) there was a bit more sugar and automation. In most cases the added verbosity and complexity involved would not generally be a win over just using an assertion. However, it is nice to know you have the option of static enforcement should it be desirable.