I have a major setback with JS/Python

Thing is I am bussy with trying to learn JS for awhile now and I am facing a simulair problem that sorta let me gave up onto Python.

I am very capable when it comes to understanding half of JS. I get what the functions are and what most of the code does. So I have a pretty much solid grip on the most basics of it. I tested it out by doing some simple quize onto w3schools and notice it here in the lessons as well.I also have the wanting of figuring out everything untile i can answere almost basicly everything about them.

However when the code becomes any longer then 3 lines and things start to be more complicated. I completly get lost and fail to see what is happening. I try reading over some answere to them and how they work. Only to figure out i can read the text but have no way of understand it.

I feel like i am to stupid to understand and I should’t be here and just find something else that is easier to do.

Can you provide some sort of code that you find difficult to understand and which parts do you feel are making you more confused? That way it should be easier to help out either directly or by redirecting to specific articles/posts.

Understanding comes in waves, each time you practice you will find something new, especially of functionality that you thought that you already understood 100%.

The feeling of stupidity will follow you every day as long as you want to continue to learn/grow as a developer, and any other career that you end up improving your knowledge actively, it’s part of the process of learning.

I’ve been programming professionally for 7 years and when learning something new or that I “feel” I should understand/know by now that feeling of stupidity also sets in, what you have to understand is that is normal to struggle and to “feel” that it’s complicated.

The important part is to keep “googling” for the answers, getting lost in the code, asking questions and struggling, you’re not stupid, you just haven’t found the right explanation that “clicks” for you :smile:

2 Likes

3 line isn’t that much, so I’d focus on why after three lines you start getting confused and you isolate that issue. It could be anything like confusing naming conventions, complex problems (math problems are dense), over complexity, and or not understanding the original issue at hand.

It sounds like you kinda get the syntax of the language, but I’m not sure if you actually understand what the syntax means. There is a difference between knowing words, and having an expansive vocab, and understanding what a poet means in his poems. Yes you can understand the words, but understanding the meaning of those words is totally different.

When your just starting out you need to focus on the basics, mainly the flow of logic from 1 line to the next and how different syntax affects the code.

I want to point out programming its not easy to do. Jumping to other languages wont change the fact programming is hard and complex. (Python actually has easier to learn syntax compared to JS, and less funky quirks) It maybe difficult, but I believe anyone can do it, as long as they have three things. If you have time, grit and an internet connection you can learn programming. Time gives you time to study, time to bash your head against the wall, and gain experience thru failure. Grit keeps you at it even though you just spent a bunch of time bashing your head against the wall!. An internet connection will give you a way to tap into basically infinite knowledge, it just make time and some good google-fu to get those answers.

You will feel stupid on day 1 and day 10000. If you don’t, then you aren’t learning anything worth learning. You get experience by being stuck, and figuring it out after a while. Stick with it and keep grinding against the problems you have. If you don’t understand something, google it, figure out what you can, test it out yourself, rinse and repeat.

3 Likes

You are not dumb. Understanding big parts of code is a skill. When I attended bootcamp one kind of homework that was a big problem for all students was to take a website one of the teachers build and modify it. Even changing font color can be a problem.

What helps me is taking code somebody else wrote and modify it for my own use:

I made a job scraper using this code.
I did not understand much at first like for example the promises or what the cheerio does here.

Copy the code you do not understand and paste it to something like repl or codepen. Modify it/break it by adding your own stuff, changing variable names etc. Have fun with it. This will help you understand what is going on.

2 Likes

Three lines is definitely too low, but almost every programmer has a comfort zone of how big a function should be before they can’t keep it all in their head. Mine is only about a dozen lines, which is also pretty short by many of my peers’ standards.

Work on recognizing patterns in code like loops and conditions and such and you’ll see how things fit together and increase that 3-line limit of yours. And the best way to do it is practice, practice, practice. And if you still like your code in little chunks, don’t be afraid to break things up into lots of little functions with long descriptive names (and rely on your IDE’s autocomplete)

1 Like

What I like to do is open up a word processor like Google Docs, add a two column table of let’s say 20 rows, and write questions on the left about the code and then answer them myself on the right. For example:

What arguments does function highest_function takes? It takes self, and projects

What is the argument self? It refers to the blah blah

What’s the first thing highest_function does? It checks if projects is empty

If projects is empty, what does it do? It returns None

If projects is not empty, what does highest_function do next? It declares a new variable, highest_value, and sets it equal to new_function

What arguments does highest_function pass to new_function? It passes projects

And I just do this line by line. I did it when I was learning to code, and I do it now at my job whenever I get a huge task or have to decipher a giant file with 1000 lines of code.

2 Likes