News for hackers. Stuff that matters.
Re:Spain builds submarine 70 tons too heavy due to wrong dec... by cm2187 on Sunday February 23, 2020 @01:50AM (#22395517)
Intuitively, only store numbers in their natural dimension. The same thing regularly happens in finance where interest rates (1.5% ie 0.015) is often stored as percent (1.5) in databases. And of course you never know what conventions people take, particularly in these days of super low interest rates. Then you have spreads which can either be stored in basis points (10bps), percent (0.1%) or natural (0.001). And currency of amounts, etc.

All table columns should also have unit in names, whether in charts, tables, database or variable names.

Re:Spain builds submarine 70 tons too heavy due to wrong dec... by TeMPOraL on Sunday February 23, 2020 @02:13AM (#22395578)
> All table columns should also have unit in names, whether in charts, tables, database or variable names.

Oh yes. That would mitigate a lot of stupidity. Imagine if math in programming and Excel had to have both a) always visible/known units, b) unit propagation and c) unit checks. So if A is seconds and B is kilograms, the compiler/spreadsheet wouldn't let you write C = A + B.

Re:Spain builds submarine 70 tons too heavy due to wrong dec... by selimthegrim on Sunday February 23, 2020 @08:16AM (#22396699)
Blockpad (http://www.blockpad.net) is the answer to your prayers.
Re:Spain builds submarine 70 tons too heavy due to wrong dec... by jmnicolas on Monday February 24, 2020 @05:16AM (#22402910)
Yet some people argue against strongly typed language ...
Re:Spain builds submarine 70 tons too heavy due to wrong dec... by Doctor_Fegg on Sunday February 23, 2020 @06:29AM (#22396355)
> All table columns should also have unit in names

Very similar to Hungarian notation: https://en.m.wikipedia.org/wiki/Hungarian_notation

Re:Spain builds submarine 70 tons too heavy due to wrong dec... by signa11 on Monday February 24, 2020 @04:16AM (#22402679)
so then, 'paul' stands for a 'pointer to a unsigned long' :)