On 05/09/12 03:42, bearophile wrote:
Nicholas Londey:

for example degrees west and kilograms such that they cannot be
accidentally mixed in an expression.

Using the static typing to avoid similar bugs is the smart thing to do :-)

I'd be interested to know if that idea is ever used in real code. I mean, it's a classic trendy template toy, but does anyone actually use it?

I say this because I've done a lot of physics calculation involving multiple complicated units, but never seen a use for this sort of thing. In my experience, problems involving units are easily detectable (two test cases will catch them all). The most insidious bugs are things like when you have used constants at 25'C instead of 20'C, or when you have a sign wrong.

Reply via email to