User | Kudos |
---|---|
5 | |
3 | |
2 | |
2 | |
2 |
LabVIEW is well-known for being a safe yet powerful programming environment (no pointer violation, no crash for failure to allocate memory, no need for a 64 bit version, etc), but unfortunately, it still allows the careless programmer to perform invalid operations.
I suggest that, in the same way that taking the absolute value of an unsigned integer is forbidden (as well, of course as its negative value), taking the inverse of an integer (be it unsigned or not) be forbidden.
In short, we should be warned like this:
Considering that there are very few perfect squares among integers (not mentioning I32 for which this should be totally forbidden), I would also suggest preventing taking the square root of integers (and completely banning integer from all special functions), like this:
This (and many similar interdictions), would force a careful attitude from the programmer, who would need to write proper code such as this:
Edit: In fact, after reflection, I think the invert function is way too dangerous and should be banned altogether, considering that its argument can be equal to zero. Same thing for the square root function, since there is about a 50% chance that its argument will be negative.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any idea that has not received any kudos within a year after posting will be automatically declined.