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

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...

StartUP

                                               StartUP Here I am Nitin Tiwari again for sharing some of my experience. Well for your kind information I am not that much experienced. I am just 19 years old but as Steve Jobs Sir says that age is irrelevant to experience. You gain experience by mistakes and events you encountered. And age is a thing you cannot control it will keep running until death will put a full stop at the end.                                                                             So this time I am thinking about my start up. I haven't started up yet. I am working under my father right now. But now I do 30 percent of his work, like i look after his shop...

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 ...