Should I learn it right now?

Hi, camper! I’m learning JavaScript Algorithms and Data Structures. I’m feeling so pessimistic about learning JavaScript because I’m unable to solve a single algorithm problem on my own. I had posted many times on it previously. I had a hard time learning JavaScript because I am a beginner in programming and this is my first programming language to learn. I have been stuck in the intermediate algorithm scripting part for over a month. Now I’m thinking to learn the next certificate which is Front-end Development Libraries because I feel like I had taken a lot of time to learn JavaScript. But I will also learn JavaScript with it. I started learning JavaScript probably in May. Is this right to do that? I was feeling so confused and perplexed about this situation that’s why I asked here.

What do you advise me to improve my logic skills?

What do you say should I learn JavaScript only on freecodecamp or should I also learn any other course. If I should learn any other course along with it, please advise where I could learn the JavaScript algorithms.

I cant really answer if you should just jump into the front end part, as i am also still learning the javascript portion. But the thing that helped me understand javascript better was just doing beginner challenges on I sat there for three hours trying to solve a simple problem until things starting clicking and i was able to understand things better. I also would look at some of the answers on here for problems that i couldn’t solve and spend time thinking about how this is actually working, not just writing the answer down and moving on. I did take a peek at the front end stuff after that, but im still spending most of my time on javascript.

Watching videos with someone explaining in detail how something works helped me with more of the complex parts of javascript. But everyone is different in how they learn. I have seen people recommend jumping around sections if you get bored or frustrated, which i have done a little here and there. Kept me learning without burning out when i felt like it was impossible to understand javascript.

1 Like

First of all, take a deep breath. Many, many learners suffer from “algorithm anxiety”. Algorithms are hard and are a completely different way of thinking. For some people it comes easier and for some people it takes some work. Most people do well on the simplest algorithms and all will eventually run into more difficulty at some point. It does not make them bad coders - there are many important things about coding besides algorithms. I don’t even think algorithms are the most important thing. You need some basic facility at least but there are plenty of great coders that aren’t the best at algorithms.

That being said, they are important for a few reasons.

  1. They come in handy.
  2. They develop an important part of your “coder brain”.
  3. They often get tested on job interviews.

…I feel like I had taken a lot of time to learn JavaScript.

JavaScript !== algorithms. Algorithms are a way of thinking that is not language dependent. At meetups I would often discuss algorithm solutions with other coders, and we’d all be coding in our own languages but could talk well about the algorithm.

It is separate from learning a language. We probably all could learn more JS and could all probably learn more about algorithms - but they are separate subjects. True, if JS is your first language, you tend to frame it as a JS thing, but it’s not. Algorithms are a way of thinking and attacking problems - JS is the tool you are applying to do that.

I’m unable to solve a single algorithm problem on my own

I find that very hard to believe. We tend to discount the simple algorithms we do all the time. Could you write a function that would take in an array of numbers and return the lowest one? That is an algorithm.

I would suggest going onto algorithms coding sites and just trying the easiest ones to build some confidence. Maybe go back and do the easiest FCC algorithms again and see if they are easier.

I don’t advise “cheating”, but if you do, see if you can delete it and then redo it from scratch. Then come back a week later and see if you can do it from scratch. If you learn it, that is the most important thing. And definitely look at other people’s way of solving them (preferably after you have your own solution). There are often several ways to attack these, some with different strengths and weaknesses.

I think of algorithms as a bunch of tools in your toolbox. Each algorithm you learn is another tool in your toolbox. It strengthens your “algorithm brain”. When you encounter a problem like that, you will be able to apply it. But also you will get better at solving them in general.

In short, relax. You’re doing fine. Take a deep breath. Just put in the time and you’ll get there.

1 Like

Don’t try make sense of learning javascript algorithms so much, just read what is does and apply that. Because the code languages are a made up thing to be used so the results make sense, if you have expectations of how would it work that is where you get stuck and give up.
In my beginner opinion…

1 Like

@Lego_My_Eggo I was feeling frustrated learning JavaScript algorithm that’s why I thought I should start learning any other course along with it. I try to solve algorithms challenges on my own but end up seeing the hint solutions. But when I see the hint solution I grasp a pen and paper and write it on the paper and try to understand the solution step by step. I want to solve algorithms problems without seeing the hint solutions. I just want to improve my logical thinking and desire to become excellent in algorithms.
Thanks for your suggestion I will do some beginners challenge in Codewars.

@kevinSmith I always try to keep my spirit up and not to be demotivated. But sometimes I feel so pessimistic about learning algorithms. I just want to improve my logical thinking and desire to become excellent in algorithms. I tried many ways to enhance my algorithms skills but nothing helped me much. I understand an algorithm is not only a JavaScript thing. Okay, I will follow your advice to solve the easiest FCC algorithm problem.
But what will you advise whether I should learn algorithms problems only on FCC or should also take any other course?
Should I learn front-end development libraries along with it or not right now?

As Kevin pointed out, is your problem really the algorithm, or is it using javascript to actually do what you want? Because like he said i have basically clumped algorithms together into learning javascript, which are not really the same thing as pointed out. A good way to think of algorithms is simply a list of instructions. Using a cook book to make a meal? you just followed an algorithm to make that meal.

Maybe write some pseudo code first. Breaking down the one big problem into a smaller list of problems. Then if the pseudo code is a fairly logical list of things to follow with the desired endpoint, try and follow that list you just made. That is basically all that an algorithm is, a list of instructions. I then would try and google how to make javascript do what i needed at that step, then move on to the next step, and console.log along the way to make sure i wasn’t messing things up to bad.

My problem was after coming up with the list of instructions, i didn’t know what to type to make javascript actually work. which i guess is more of a language problem then an algorithm problem.

Algorithms is just a fancy way to say ‘practice solving problems like a programmer’. Learning how to think like a programmer is hard, and these challenges give you tasks that represent some of the same core ideas.

You just can’t learn these by reading answers, no matter what others may say. But these challenges are hard and it’s normal to struggle.

I would follow the same process no matter where you practice algorithms and problem solving:

  1. read the problem carefully
  2. write down a plan of attack
  3. try your plan
  4. research any snags for hit with the plan
  5. try to fix the plan
  6. repeat 2-5 until you are stuck
  7. share your plan, code, and where you’re stuck on the forum
1 Like

I always try to keep my spirit up and not to be demotivated. But sometimes I feel so pessimistic about learning algorithms.

Yeah, join the club. I know things are tough in the apocalypse, but one of the best things I did was join some local meetups. Talking with other developers I found out that my frustrations were completely normal.

I just want to improve my logical thinking and desire to become excellent in algorithms.

It’s like a muscle - the more you use it the stronger you get. Some people naturally have a lot of muscle, some very little. But everyone can get stronger if they work at it. Maybe I’ll never be big like Arnie, but if I work hard, I can accomplish a lot and be the best version of me I can be.

I understand an algorithm is not only a JavaScript thing.

Right, but just to emphasize, it is completely language independent. I actually once as an experiment wrote out the pseudocode to a bubble sort and walked my wife (who is very smart, but know nothing about computers and struggles with math) through it. Once I explained it, it made perfect sense to her. We put some numbers on some note cards and she was able to do it no problem. This is a woman who has never coded in her life.

As Leggo points out, there are two issues here: 1) Figuring out the algorithm. 2) Understanding how to implement it in JS. Most algorithms don’t involve crazy JS so the issue is usually the first one. Before I even think about JS, I try to understand the challenge. Just like in walking my wife through a sort algorithm, I try to imagine it - in that case, a stack of cards makes sense. If you can, try to understand what is happening on a conceptual level. Without thinking about a computer language, how would you solve this if it were a problem in the physical world (acknowledging the limitations that computers will have, in general). If it is too complex for my brain, I may use a whiteboard and/or get some actual physical cards.

But what will you advise whether I should learn algorithms problems only on FCC or should also take any other course?

I have always said that FCC is a great framework for learning, but probably won’t be your only source - it is not comprehensive. I had to take a lot of little side trips.

So yeah, learn from other place. I like the site, but there are others. There are also countless videos of people solving various algorithms. I would definitely want to look at those after I solve the problem - if for no other reason just to have a window into how someone else thought of this problem. I also recommend the book Cracking the Coding Interview - it’s a great resource with a lot of great information, notably a big section on algorithms. It’s in Java, but that’s OK since the algorithm is the important thing. You can also go online and people will actually walk you through some of the interview questions they’ve gotten - very informative.

But again, take a deep breath, this stuff is hard, take your time. If you put in the time, you will improve.

1 Like

@Lego_My_Eggo I feel like my situation is that sometimes I don’t understand how to break the given problem into chunks. Or how do I start the solution? Sometimes I’m unable to guess to solve this problem, which method should I use? If I would be qualified to find a method, I’m incapable to find the right way to use it in a solution. But when I look at the solution to a problem. So it makes sense and I feel like, Ah! that’s what I had to do. I’m confused! Maybe I’m unable to think like programmers that’s what my problem is or I don’t know what the problem is?
You asked me to write pseudo-code. Will you write pseudo-code for the following problem Wherefore art thou please?

1 Like

@JeremyLT I’m stuck very badly in these algorithms challenges. I feel like I didn’t learn anything in the basics and intermediate algorithms because I solved every single problem seeing the hint solutions. I tried to solve problems but was unable to do that.

If you don’t mind will you explain what will you plan to attack the following problem where art thou?

I won’t write out the solution for you, but I’d be happy to work with you to develop your own solution.

Have you done all of the previous basic and intermediate algorithm challenges without copying the solution? It might be easier to help with the first challenge you can’t do without copying.

In any case, the very first step is to make sure that you understand what the function arguments are and what the final task is. Can you describe what needs to happen in your own words?

If so, can you say how you would do the task by hand?

1 Like

I hope I will become stronger in algorithms.

Okay, I will learn more from other places. Thanks a lot for your advice.

Just to be clear, I think that if you start a program (like FCC), I think it is a good idea to finish it - to not jump around from thing to thing. But taking little side trips here and there, definitely.


You should ‘choose your own adventure’ but you should also make sure that your ‘adventure’ has goals and direction :slight_smile:


@kevinSmith Yeah! I have understood completely what are you saying.

@JeremyLT In the challenge Where art thou I understand FCC challenge has given us an array of objects and some of them have matching names and values pairs to the second argument. The array of objects is given as a first argument. We have to return those names and values if each of them are matching to given second argument.

Ok. So if I gave you a roster of people, like a class roster, how would you make a list of all people named ‘John’ on the roster?

@JeremyLT A list of student names has taken part in any class???

@JeremyLT Will, you explain a little bit what the class roaster is?