Tuesday, April 29, 2014
The social sciences...
The social sciences... There's good reason to be suspicious of its results...
Geek: integer overflow checking...
Geek: integer overflow checking... This morning I ran across this short article that describes how to implement integer overflow checking in languages that don't expose the underlying hardware's overflow flag. Java is such a programming language, and CERT has a fine implementation of routines that provide the check.
I've long been surprised that Java doesn't include such checks, at the very least as options. In general Java tries very hard to be “safe” (for example, with array bounds checking and stack overflow checking) – but not on something as common and pernicious as integer overflow. It's a mystery to me.
Probably because of my “upbringing” on computer hardware and assembly language programming, I've always been very conscious of the possibility of integer overflow in my own code. Despite that, I've been burned by it several times, most especially with numeric comparisons (which I've blogged about before).
Just a few weeks ago, a colleague from a job I had almost 15 years ago contacted me out of the blue. This fellow happens to be Russian, and worked with me on Java code back then. He asked me if I'd ever heard of “integer underflow”, and if I could explain it to him. I could, of course, and I did. But once again I was shocked to discover that a well-educated, experienced, and superbly competent software engineer didn't know about something so basic. I engaged him in an email conversation about it, and I think I know now how such a thing happened: his education in computer science assumed the presence of a high-level programming language, and he only learned how computers actually work in broad, abstract brush strokes. Once again, what surprises me the most about this is just how productive a software engineer can be with such a (to me) gaping hole in his knowledge...
I've long been surprised that Java doesn't include such checks, at the very least as options. In general Java tries very hard to be “safe” (for example, with array bounds checking and stack overflow checking) – but not on something as common and pernicious as integer overflow. It's a mystery to me.
Probably because of my “upbringing” on computer hardware and assembly language programming, I've always been very conscious of the possibility of integer overflow in my own code. Despite that, I've been burned by it several times, most especially with numeric comparisons (which I've blogged about before).
Just a few weeks ago, a colleague from a job I had almost 15 years ago contacted me out of the blue. This fellow happens to be Russian, and worked with me on Java code back then. He asked me if I'd ever heard of “integer underflow”, and if I could explain it to him. I could, of course, and I did. But once again I was shocked to discover that a well-educated, experienced, and superbly competent software engineer didn't know about something so basic. I engaged him in an email conversation about it, and I think I know now how such a thing happened: his education in computer science assumed the presence of a high-level programming language, and he only learned how computers actually work in broad, abstract brush strokes. Once again, what surprises me the most about this is just how productive a software engineer can be with such a (to me) gaping hole in his knowledge...
Synaesthesia beneficial?
Synaesthesia beneficial? Ever since I first heard about this condition, some 40 years ago, it's fascinated me. I've met just one person who had it; when he heard certain sounds (especially pure notes), the colors he perceived changed. I'd love to experience it myself, though I'm not at all sure I'd want it permanently :)
“Man posters”
“Man posters” Via my card-carrying ancient-American mom. I couldn't possibly pick a favorite out of these :)