Welcome to another developer fundamental video. I think you know what that means.
"How's it going John?"
"Not bad partner. Follow me I'll cover you."
A developer needs to solve problems that there aren't clear answers to.
The best developers are the ones who are left to their own devices to figure out a problem.
They are able to find errors in their code and solve it themselves.
They have questions or something they don't understand.
Well no problem.
They know how to use the resources they have to figure it out.
At the end of the day we are engineers.
This is what we do and this is a developer fundamental.
How can we solve this problem you're having when I'm not around to answer these questions for you.
So how can you practice this?
Let me introduce you to your most important resource
as a developer: Stackoverflow. Stackoverflow is probably in the top five most used tools by any developer.
Whether you're a game developer or a network admin a security expert or a web developer.
Every day people in the field post questions you get answers from some of the best in the world.
The website is so extensive that the question you have is most likely already asked and answered.
I can't remember how many times stackoverflow has saved me when I was stuck on a problem.
So in this short video I want to show you an important skill a developer should have - that is problem solving.
In real life, You don't have a teacher or
an instructor you can just ask for an answer every time you are stuck.
No, most likely you have to figure things out yourself using the tools at your disposal.
I'm not joking when I say most developers spend half their time on google.
I want to start practicing that muscle.
When you have a question ask yourself,
"Knowing what I know and the tools at my disposal what is the best way for me to get to the end - to solve
this problem?"
The first step when you are stumped is to Google. And most likely one of the first links that pops up
if you include the word Javascript or CSS or HTML
well most likely one of the first links will be stackoverflow.
So let me show you an example and take you through a real life scenario.
I've got a piece of text which is a string and I need to find how many exclamation marks it has.
Well again just Google something along the lines of "check if string contains substring javascript".
So I just Googled this.
Let's see what pops up.
And yeah we have a whole bunch of things, and you can see that the first two links are stackoverflow.
So I would click on this and see that,
all right the question is, you know, "I would expect a string that contains method but there doesn't seem
to be one." well, Javascript doesn't have one.
And people have answered this and you can see over here that there's a few things.
One while there's 49 answers that's a lot there's votes, that's all this.
It's active.
I usually like looking at the both because the top answer will have the most upvotes.
You can see here that this person has a ton.
It also has a checkmark.
This checkmark means that the person who asked the question has verified that this infact works.
And usually I like looking at the top answer and
then kind of browsing through the second answer as well.
Just make sure that I didn't miss anything because sometimes when new things happen this question might
have been ask let's see when it was asked.
It was asked eight years ago.
Maybe the top answer since then, maybe Javascript included a contains method that we can use on strings
and maybe the top answer now isn't exactly the top answer anymore.
So I like scrolling through or making sure that you know maybe the first three answers are good but
if you scroll up over here we see that this person actually kept updating their answer and even has
the ES6 method "includes".
So now that I know I see that, oh! I can just use the 'includes' function and with the 'includes' function
I can just do something like this.
I can say does the string
"Helloooo!" with an exclamation mark.
Well does "Helloooo!" have an exclamation mark?
and I get an error, well because if I look over here it's not 'include' it is 'includes'. Let me try that again
and I get 'true'.
If I do a let's say an 'a'.
I get 'false' because well, it doesn't including anything.
So there you go stackoverflow
just answered my question.
And you can see over here there's a few other things that you can look at.
One is, you can look at some of the comments that people have made and comments usually have votes as
well so I like looking at comments with a lot of votes.
And you can see people have provided valuable links.
You also see that on the right hand side you have linked answer so maybe this page doesn't answer you
but stackoverflow is smart enough to say, "Hey! maybe this is why you're looking for:"
and you have 'related' you have a ton.
The last thing I want to point out is you also want to look at usually the person that's answering.
You see that 'Fabien' which has a lot of gold stars and a lot of points on stackoverflow,
well this person answering.
This person looks pretty pretty credible from all their stats.
So that is most likely a good answer by this and actually know a few companies that look at stackoverflow profiles
to see how good of a developer a person is, because if you're a developer that answers questions
on stackoverflow and provide a lot of value,
well, you must be a good developer.
So remember this Googling and stackoverflow is very important.
If you don't find the answer there you can create an account and
ask yourself the question on stackoverflow.
But better yet go to the zero-to-mastery Slack chat
and if your question wasn't answered on stackoverflow
again, go to our community here and you have a ton of channels that you can ask questions in.
For example if you are on channels of here you'll see all the channels that we have if you have
Bootstrap questions, if you have Github questions, you go into the community and you ask all your questions.
The Javascript channel is always always active.
Very very helpful people on there.
And remember you have a community of developers even after you're done with this course
where they're willing to help you.
So it is good to practice not just asking questions all the time but discovering answers yourself.
Learn to debug your own code.
Develop them muscle and you'll be a great developer.
See you in the next one. Bye-bye