Hey there. I hope that everyone reads it in good health.
I want to convey a message regarding the posts that I have been seeing on discuss lately. I find that most of them are generally tagged with
help and have doubts regarding a question or simply contains a link which redirects to their solution. It’s not bad to ask questions or doubts but at the same time if that doubt can be solved by oneself then it should be done.
There are hell lot of solutions in the topics that contains a simple mistake which cause them a WA or any other verdict. It is easy to find it at a glance. Well, it may not be the same for others or the one who has asked for help, but this behaviour will simply make them more ignorant to debugging their code and searching for errors.
Debugging a code is an art which everyone should know about. It not only makes us more capable in producing a strong code but also develops a habit to foresee the potential bugs without even causing them. Sometimes, a code might fail on some edge case, debugging, will make us think out of the box for those edge cases.
Some may argue that it is not productive to spend a lot of time in debugging when we can solve some problem or read another concept in that time… It is true that these alternatives will surely help but debugging is equivalently important. Now, regarding the time constraints, one can read the editorial or google the same thing rather than posting here.
Let me tell you what happens when you don’t do the hard work yourself. Suppose you have a code, a simple one and it gives you a WA. Now you post it on discuss and ask for help. Someone replies with the correct solution, say the part that was causing you an error was a comparison with
vector.size() and the suggestion was to use
(int) vector.size() inplace. You change it and voila! you get AC. It’s more a case that you will simply ignore the reason why that happened or forget it in the future. Now suppose you are asked the same in an interview. It is always necessary to have in depth knowledge of anything and you should know the if buts consequences. In debugging you would have come across the point of comparison and figured it out yourself which would be more benefitial. It may not be the best example but I hope you get the point.
Also, Iknow there are many coders out there on discuss who just come here to debug the codes because they like it. No offense is intended to them.
The whole point is spend more time in debigging and finding a solution yourself through editorial and google, it will be more valuable and you will learn more things. And only if you are not able to progress on your own then show up to discuss. People here are always happy to help.
P.s. I don’t like reading unformatted and poorly written code. It gives me a headache so that’s one more reason why I have made a topic of it.