Programmers tend to learn more by searching the internet for answers to their questions. However, some individuals prefer learning through a one-on-one person teacher who lectures and can provide answers to their question. The great thing about using the internet as a schoolroom is that there are whole communities of programing folks out there who can answer your questions. On the internet, you have access to limitless solution at your finger tip. Certainly, your questions have probably been answered, and the answers are waiting online for you to find them. If you encounter an error message or have trouble making your code work, you won’t be the first person to have such problem, and finding a solution is easier than you might think. However, structuring your question in a right an understandable manner will go a long way to fetching a solution timely.
For an instance, the error below was committed on purpose in python programming language environment.
result = (23 + d)
When you run the above command in python interactive shell terminal, it will flag error as shown below;
The error message [4] appears because Python couldn’t understand your instruction given in [3]. The traceback/file part [1 & 2] of the error message shows the specific instruction and line number that Python had trouble with. when you are not sure what a particular displayed error means, search it online. In a case like this typical error encountered. Enter NameError: name 'Print' is not defined (including the quotes) into your favorite search engine, and you should see tons of links explaining what the error message means, what causes it and how to resolve it as shown in in the figure below;
There is possibility that someone else had the same error message as you and hit the internet for help and some other helpful person already answered it. Although the person in question might have forgotten, the internet does not forget. Also, there a platforms where solutions have been provided for common coding errors encountered by programmers in any programming language. Of which the error you are looking to resolve might be one. Software developer's takes looking up for answers to technical questions one of their job routine because no one man is an isle of knowledge.
Asking Smart Programming/Coding Questions
In any case where you can’t find the answer by searching online, try asking people in a web forum such as Stack Overflow or at Learn Programming Subreddit. But getting answer from this forum requires that you post your questions smartly such that others will be motivated to help you. To begin with, check out the FAQ (Frequently asked questions) sections at these websites about the proper way to post questions.
To make your question smart, ensure it has the element listed below;
- Briefly explain what you are trying to do, not just what you did. This gives your helper a foreknowledge of what you want to achieve and know if you’re on the right track.
- State the point at which the error happens. Maybe at the very start of the program or when you added a particular line of code.
- Copy and paste the entire error message and your code into Pastebin or push it into Github. These websites provides a platform to share a large amount of code to coders community, without losing any text formatting. Also, you can put the URL of the posted code in your email or forum post.
- Clarify options you’ve already tried to solve your problem. This will guide them in what next to suggest or tried out as possible solution for the problem.
- State the programming language you are using and the version as the case may be (the sample error committed above was in python 3 interpreter. There are basic key differences between Python version 2 interpreters and Python version 3 interpreters).
- If the error came up after you made a particular change to your code, explain exactly what you changed.
- State if the error is being reproduced every time you run the program or whether it happens only after you perform certain actions.
- Ensure you follow good online etiquette as well. Do not post your questions in all caps or make unreasonable request from the people trying to help you.
Conclusion
Conclusively, for most people, their PC is just an appliance instead of a tool. But learning to code/program with it grants you to one of the most powerful tools of the contemporary world, and you’ll have fun along the way. You must note that, Programming is not brain surgery or insurmountable mountain - it’s fine for beginners and amateurs to experiment and make mistakes. But, be rest assure that there are tons of help channel available online if you can explore them appropriately. And whatever the error is somebody somewhere is ready to help once you can adequately help them to understand your issue.
Thanks for reading this article so far. If you like these blog post, please share it with your friends and colleagues. If you have any questions or feedback, please drop a note.
Best regards!