I sourced a shortlist on bad ideas and practices still used amongst my fellow programmering piers. Implicit cast was ranked highest of all as a bad practice.
Note that Fortran from 1960s got it right from the start. It distinguishes between integers and logical values and will not cast implicitly.
(ignore the arithmetic IF statement says the man behind the curtain)
Hmm…
A little late to this discussion but I kind of wish the compiler would disallow the following:
a = 0
if a
# do something
end
Since it’s “always going to take that path” it could warn the programmer that something is awry…or disallow it.
In my particular case I assumed since it compiled that it would be treating integers as “0 is falsey, else is truthy” but didn’t…
Actual use:
c = 32
if c.bit(0)
# do something, always gets here...
end