Harsha sent me this. I am sure you must have seen this many times.
Remove this bug from code................
##########################################################
#include < stdio.h >
#define LAST 10
int main()
{
int i, sum = 0;
for ( i = 1; i < = LAST; i++ ) { sum += i; } /*-for-*/ printf("sum = %d\n", sum); return 0; }
And the developer fixes it this way
#include stdio.h;
#define LAST 10
int main()
{
int i, sum = 0;
/*
*/
for ( i = 1; i < = LAST; i++ ) { sum += i; } /*-for-*/ printf("sum = %d\n", sum); return 0; }
Mere isolation of the problem doesn't help. It should be removed completely. Make sure that it never returns. If your business has a problem, find out what causes it and then rework on the whole thing to eradicate the root cause completely. Just solving the problem for the time being wouldn't help. Better management not about not making mistakes but about learning from them. Ensuring that the same mistake is never repeated. The worst part is people are happy with isolating the error and move on. That is lazy psyche working. NMJ or Not my job attitude. It is short term. Leaders work for long term and root out the problem. What are you doing then? Still finding those '/* */' handy?
No comments:
Post a Comment