Archives for Jed Wesley-Smith

Scala and Erasure

Mention generics to anyone who knows much about them and they'll usually have an opinion on type reification and erasure. For the uninitiated, erasure is where a List of Strings (or a List parameterised by the String type) "forgets" that it has been parameterised by the String type once it has been compiled – ie. the type parameter is erased. Reification is the opposite, the type is remembered, or reified. Different platforms have different strategies for their generics implementations.

Continue reading »

Exceptions are Bad™

**Exceptions should be used for exceptional circumstances!** Exceptions are to be used when bad shit happens. Not because you got passed some bad data (as in not passing validation), but because someone pulled the plug on your disk drive, or an earthquake hit your data-centre. They're for bad shit alright?

Continue reading »