If you do programming, you will definitely face problems with your code and stuck somewhere. That situation is pretty frustrating for beginners. Lets know how to deal with these situations and get the answers of the problem.
1. Debug your code
- Check for error messages in the trace log. You will most probably get the line number where the problem is, like missing semicolon, or braces are not closed properly. Most probably you will get something useful piece of information to fix the code.
- Delete the lines and add one by one until the problem started coming.
- Print the custom logs on log files and do check them.
By this time at-least you will know where the problem is.
2. Find solutions Online in Google or StackOverFlow
- Paste the error code in Google along with the programming language. You will get the answer in top 5 links provided by google.
- Make Google your friend – If you don’t know how to do a specific thing, you can always search in Google or StackOverFlow like How to do loop in Java or C.
3. Ask questions in IRC
If the Google Searches or StackOverFlow doesn’t solve your problem. Ask the problem in Internet Relay Chat ie. in Freenode.
Make sure you ask right question with some lines of code pasted on Pastebin, so that others can look into that. Be Thankful to people who helped you while fixing the code.
If you want to know, how to ask questions smartly follow the below mentioned guide.