??? 10/15/08 14:37 Read: times Msg Score: +1 +1 Informative |
#159089 - Good example of counting dangers Responding to: ???'s previous message |
This is also a good example of the problem with the human memory and with assumptions. I know that \n can become two characters in the RTL, and have used my fopen(fname,"rt") for more than 20 years. I still gave you the wrong answer. If I had written code which manually counted characters, I would have produced a bug.
The world is full of traps. You may live long by learning how to disarm traps. Or you may live long by learning to avoid the traps. Or you may decide to totally ignore them. If you did a school project, I would give "incomplete" or "failed" unless manually counted constants where replaced by proper code constructs. If it was a commercial project, I would not pay the full amount until it was corrected. The problem is not if your code works or not. The problem is that the code is fragile. And fragile code is dangerous. It is so easy to break it. And it is not easy to know that it has broken - you may send out 100 units, and only ten of them will produce a dangerous measurement every three months. The customer complains and when you run your own unit, you do not see any problem. |
Topic | Author | Date |
How many bytes will be written ?? | 01/01/70 00:00 | |
return value? | 01/01/70 00:00 | |
OT: That's why you should never use TABs! | 01/01/70 00:00 | |
go ahead and use tabs | 01/01/70 00:00 | |
No, don't! | 01/01/70 00:00 | |
Any programmers editor | 01/01/70 00:00 | |
insert spaces for TABs | 01/01/70 00:00 | |
Oh Yes ... the sprintf()... | 01/01/70 00:00 | |
So here we go | 01/01/70 00:00 | |
Wrong! | 01/01/70 00:00 | |
Valid warnings. But... | 01/01/70 00:00 | |
No buts! | 01/01/70 00:00 | |
maintability and engineering | 01/01/70 00:00 | |
Not entirely true? | 01/01/70 00:00 | |
You are correct | 01/01/70 00:00 | |
Good example of counting dangers | 01/01/70 00:00 | |
Good interaction.![]() | 01/01/70 00:00 |