Skip to main content

What are some silliest mistakes that you made while coding?

Ohk I remember one, we had a product at Waayoo and me and Amit Saini were working on a nitrogen inflating machine. And Everything was setup, the machine’s embedded part was working, we had a software application written in python, to interface with the embedded part. We did that and it started working fine. But Then we need to make some changes in it, so Amit Saini sir started making changes in his side of function. so function was something like this, all we had to do was to check of the value is 0 we will initiate the system and then will change it to to 1 statically, and then that starting function will never run again. And the code goes like this -
function initiate(int check){
if(check==0){
startagaint();
check==1;
}
}
That was the code, and this function has to be called several times in the whole process, after a time we got stuck whenever this function called the second time it always keep repeating itself. and we had no idea why.
And in Amit sir’s defense the fonts were a little small and we were in little depression, so we took 8 hours checking out 2000 lines of code, looking in every function. And then we started looking in to python code, but find nothing. And after 8 hours Sir pointed out this error himself.
So if you have got the error then its ok , if not the let me reveal it that the value of check was never 1 it was always 0, and after this function another function was called which always checked if the value was 0 it called the initiate function again. When we start the machine for the first time it never checked the value of check. But after a specific situation we had to check if we need to restart.
That’s how it happened :P
Happy coding ;)

Comments

Popular posts from this blog

The coding of love ;)

They used to work everyday, competing who would work more efficiently, quicker and better at the same time. This competition made them enemy, they hate each other. The only thing they had in their microchips that they have to win, the more they lose the more the hate increased. This is the rule of a computer programmed robot, it works only the way it has programmed. It can only do those things that we have told it to do. These two robots were the best among others. They never made any talk, but they both understand the power of their opponents. The AI programming, Artificial Intelligence made them in this way so that they could read the moves and create their own strategy. The first Robot name was Naina, the others name was Rudra, it was just the name, they were designed in this way, The competition was about to make themselves multitasking, they both could implement themselves, program themselves, to be whatever they want. They were genius in solving the mathematical problems, they c...

Daughter is a daughter till the end of life

                        Each Girl deserve to live free A saying has became very famous "Son is son till he gets his wife, daughter is daughter till the end of life." We all have heard lots of things about humiliating behavior of men towards women/girls. First of all I would not declare them men although , but sometimes god also do mistakes. What kind of mentality those people have who doesn't understand a girls's importance to us.                                                                                   I don't need to explain anything, all of us knew the importance. From our birth to death girls make a great role. We get birth from our mother and after death the person who bury or burn us also took birth from ...

Wallflower's Diary 1

I like people laughing. I like people smiling. I like everyone around me to stay happy. It bothers me most of time when I see anyone struggling with their fate. Usually its hard to keep everyone happy. But It is possible to keep them satisfied. satisfy every one by truth and right that's what I think is an easy task to do.                      It become easy to stay happy when you attach your happiness with others. Then not only you , but everyone around you will help you to keep you happy, cause they will work for keeping themselves happy. World would have a better place without jealousy , money , greed . We all know this still we are unable to detach ourselves with these things. Anyway never stop hoping. Cause that is the only tool we got to face uncertainty of world. We all knows that money is not going to help us fighting with our future problems. May be for a while money will work , but later we need people to help us. Its ne...