Bjorn, >If the assignment error (using assignment instead of comparison within >an if statement) can evade the attention of the programmer, then surely >the misinterpretion of a reversed comparison is also possible. Here I >assume that both cases occurs because the programmer does not have the >sufficient time to dwell upon each line -- this is usually the case >during debugging sessions. Time to dwell. The issue we have avoided so far. Developers do not have time to study source in detail. They scan it quickly and of course lots of mistakes are made. The contribution that cognitive psychology can make to guidelines is to come up with the answer to the question "How should source code be organised to minimise the cost of understanding it?" The cost factors being things like time taken to understand it (sitting looking at the source) and cost of misunderstandings (a change made on the basis of a misunderstanding that then has to be fixed). >It would also be interesting to conduct similar studies for other >typical coding standard guidelines (not only to Derek and I, but to >the programming community at large). Unfortunately most coding guidelines are not worth the paper they are written on. Some reasonable ones include: If you were worried about flying in airplanes that followed unusual guidelines, how about nuclear power plants: http://www.nrc.gov/NRC/NUREGS/CR6463/ch4c.htm and a copy of the famous Indian Hill C standard guidelines: http://dogbert.comsc.ucok.edu/~mccann/cstyle.html No prizes for spotting the good ideas that are unenforceable in practice, the obscure rule included because somebody once spent a week fixing exactly that problem, the complete lack of alternative proposals when a particular construct is banned (in some cases the cure can be worse than the illness), the occasional really good guideline and other assorted issues. derek -- Derek M Jones tel: +44 (0) 1252 520 667 Knowledge Software Ltd mailto:[EMAIL PROTECTED] Applications Standards Conformance Testing http://www.knosof.co.uk - Automatic footer for [EMAIL PROTECTED] ---------------------------------- To unsubscribe from this list, mail [EMAIL PROTECTED] unsubscribe discuss To join the announcements list, mail [EMAIL PROTECTED] subscribe announce To receive a help file, mail [EMAIL PROTECTED] help This list is archived at http://www.mail-archive.com/discuss%40ppig.org/ If you have any problems or questions, please mail [EMAIL PROTECTED]
