Google it or ask it?

This post is specifically for people who are just starting to code.

Note: This post is based on my starting to learn web development so some parts may not apply to everyone.

So what happens when you encounter an error for something you tried implementing as it is - let us say from a tutorial or a video?

You probably encountered an error. And the first tendency is to ask someone why am I getting this error.

One of the earliest and best scoldings I received early on was:

"Don't ask because you don't know. Ask because you tried to know, you put in some effort and got stuck after it. Earn your answers after making your efforts. Don't ask me for what is evident. Ask me what's not anywhere."

Look around and make an effort to know. Don't think it should be obvious on the first try. Go around and spend some time to know.

So while asking as a newbie is understandable, it can be avoided and reserved for things that cannot be solved very easily.

Before you begin to ask, understand Googling for your errors.

Spend some time reading, googling and understanding your error. It's okay you don't know anything. It's alright. Try to know. Try to read stack overflow, blogs, and articles and see explanations on each solution. If you don't understand go to the next solution. Read a LOT. If you feel confused, read MORE, and dive deep into knowing what's happening. Spend 30 minutes at least. Not after 2 minutes do you say I am not getting a solution? Before asking, make effort to find your solution. Why? Because it will teach you so much more than any readymade solution.

And unlike some fields, a lot of errors in technology are documented and standard, that is, it is likely to solve most part as of your problems.

But as a beginner why does Googling doesn't seem to give you a solution at times?

The answer can be that it depends on the context. A given problem can be solved in different ways and in different languages too.

So if you specify very vaguely, you are likely to get a very broad search of results. Like something unrelated to the language you want it to be in.

What should you do then? Specify your problems well:

Which language are you seeking help in?

What are you trying to do?

Being specific can help you to narrow down close to your desired result.

But that also may not be sufficient, sometimes we think we know the problem but what if we don't?

I will mention the two types of errors I encountered as a beginner while trying to solve my errors.

Syntactical error: Error due to missing some major syntax. This can be easily spotted. Watch every line of code and see if you missed anything. As a beginner pay a lot of attention to syntax errors as they are more common. The syntax can be easily found online for different parts like a for loop declaration or if-else statement or how to assign values or function definition etc.

Logical error: meaning I thought that this logic will work here but it was not meant to be. This was obviously because I assumed that everything works everywhere. But it did not. Sometimes theoretical logic assumed may not work practically.

Then we should try to debug or find out what each statement is trying to do.

Two best friends to help you understand why the output is not coming are typeof() to understand how the type is calculated. and console.log! Use it as a beginner to understand what is happening. It will teach you about data types and logically where the program stops acting as you wish it to.

Once you start checking and understanding what is each line trying to do, it starts giving more clarity on how everything works under the hood. This helps us to also ask better questions to Google or anyone who might help us out.

Let us say even after all these efforts we do not conclude then it is alright to ask what should be the approach to solve the given problem.

Asking is not a problem, but asking without making an effort to understand it, is.

And if you want to stay for long in the industry, research before you ASK!