Make the Type System Do the Work
11–20 of 141 posts
Re: Make the Type System Do the Work
#12The Boost.Units[1] library takes this even further, allowing you to do things like divide a length by a time quantity and get a velocity, again with compile-time type checking. [1]: http://www.boost.org/doc/libs/1_55_0/doc/html/boost_units.ht...
Re: Make the Type System Do the Work
#13Re: Make the Type System Do the Work
#14Re: Make the Type System Do the Work
#15To take this to the current state of the art, look at Haskell, Agda, and Idris. Latter two being dependently typed. Steps for learning Haskell: https://gist.github.com/bitemyapp/8739525
Re: Make the Type System Do the Work
#16I particularly like Go's type system, though, because it makes it very simple:
type celsius float64
There's no overhead and it doesn't attempt to prevent you from doing any calculations as a float64; the type checking just prevents direct assignments from a celsius type to another type.Re: Make the Type System Do the Work
#17Interfaces are better but extend poorly through subclassing as well.
Composition is infinite but difficult to define over time when things change (usually resorts to more subclassing or more injection strategies).
I wish this article were valuable to solving the actual problem but its just a primer on OOP vs using primitives which is not particularly instructive or useful to solving real world problems.
Re: Make the Type System Do the Work
#18To take this to the current state of the art, look at Haskell, Agda, and Idris. Latter two being dependently typed. Steps for learning Haskell: https://gist.github.com/bitemyapp/8739525
Personally, I'm learning Haskell first, because Haskell is the most popular of the three and there is plenty of good learning material. As far as Adga and Idris go, I think Idris looks more appealing.
Re: Make the Type System Do the Work
#19To take this to the current state of the art, look at Haskell, Agda, and Idris. Latter two being dependently typed. Steps for learning Haskell: https://gist.github.com/bitemyapp/8739525