Hacker News new | ask | show | jobs
by dragonwriter 911 days ago
> IMO using operator overloading for this kind of thing makes it hard to read, since I have to be extra careful to mentally parse whether that `*` is a multiplication or units

Units are inherently exactly multiplication.

5 meters is:

5 (unitless) * (1) meter

1 comments

Yes. There are many (infinitely!) ways to write an equivalent expression, most of which are not as clear to read as the standard format.