4 ms·
This is awesome. Do you remember any of the causes of high defect indicators? And why wouldn't you recommend it? Too much work? I made a thing that takes a
by JesseAldridge 16y ago
This is awesome. Do you remember any of the causes of high defect indicators? And why wouldn't you recommend it? Too much work?
I made a thing that takes a screenshot every ten seconds while I work and another thing that sticks them in a window with a slider so I can look at them in sequence.
Just yesterday I noticed that I had been daydreaming a lot lately. So I made something that would go through the sequence of screenshots and compare each image with its previous one and count every instance where the two images were the same (or almost the same). That gave me a pretty good indicator of how much time I spent daydreaming. If the numbers are right, then when I'm working on something boring I spend as much as 40% of my time not actively typing or anything -- just thinking about random shit. I'm thinking I'll try mindfulness meditation for a while and see if that cuts down on the daydreaming at all. We'll see how it goes...
- zedshaw 16y agoYep, I wrote a bunch of C macros to prevent them and use them everywhere: curl http://zedshaw.com/dbg.h http://zedshaw.com/dbg.h The main thing that caused defects was not handling default cases in logic. Things like not filling in the dangling else of an if-statement, not trying to return a value from a function no matter what, and not having a default: in a switch. By always trying to include at least a comment there, or an assert it forces you to think about the logic of the whole statement and prevents bugs galore. Combine that with unit tests and you've got a good solid start. I don't recommend it because it's an insane amount of work above just writing code. I think it'd be something I'd force on high speed students in a kind of "Boot Camp" situation, but not on anyone else. In fact, I think most programmers couldn't handle having a giant bag of evidence staring them in the face telling them they suck. Also I think most programmers wouldn't get the stats behind the analysis and just keep screwing it up. I play guitar when I have to think about stuff. I take one to work, and when I'm stuck I bust out my guitar, a pen, and a note pad. I then noodle and practice, and as ideas come into my head I write them down without filtering. Basically, you need a hobby. :-)
- agazso 16y agoIn most recent C compilers you can turn on warnings for at least missing return values from functions and not having a default: in a switch. It is good practice to compile C/C++ programs with high warning level, and fix all the warnings before shipping.
- wnoise 16y agoWhen I'm writing code, a lot of the time the screen isn't going to change. This is not because I'm day dreaming, but because I'm thinking.