Categories: ProgrammingSolutions

Top 3 ways to debug your code while programming

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.

 This is how you can fix your problems effectively while doing code. Happy Coding!
Surya

Living in permanent beta mode: Learning, Improving & evolving. SPECIALTIES: Web Application Development, Digital Media, E-Commerce Solutions, SEO, CRM Solutions, Open Source Technologies, System Administration ( Linux ), VOIP Solutions, Cloud Computing, Web Security.

Share
Published by
Surya

Recent Posts

How to get the all the database and table sizes of MySQL or MariaDB?

If you are working with MySQL or MariaDB web server, sooner or later you will…

7 years ago

How to set or change default text editor for crontab in Linux?

To edit the crontab entries you use crontab -e. The command will check for the…

7 years ago

How to install Comodo SSL certificate with NGNIX web server?

Installation method for COMODO SSL Certificate If you have generated the CSR and purchased or…

7 years ago

How to give access to specific users to specific buckets on AWS S3

In AWS S3, you might want to provide the access to selected users to selected…

7 years ago

How to add or change the password (passphrase) of OpenSSH key?

It's possible you have earlier generated a ssh key without password/ passphrase. Later you found…

7 years ago

How to find files on linux OS ( distributions )

If you are working on Linux OS, finding files effectively always a tricky part. Like…

7 years ago