r/learnjavascript • u/VasylievCode • Mar 25 '24
if Javascript not for me?
Hello guys. I am really depressed and upset.
I study Javascript at the course and everytime whet its time to make some homework i cannot do it. i rewatch theme videos many times, but i am watching at the task and do not realise where to start, where to go .
I have full time job where i spend 8 hours and spend all my free time studying HTML, CSS, JS.
Last month i started DOM in JS and tried to do calculator and it was unsuccessful, got the task with already ready HTML and CSS to make Accordion but i failed. And every next fail makes me more depressed.
I feel myself stupid, nervous, depressed and my question is
How To Get To Know If Coding Is Not For Me?
p.s. i am trying to push as hard as possible, but who knows, maybe i am that one person who was not born for coding.
1
u/XtremeX9x Mar 25 '24
I don't have much advice but I'm in quite a similar boat as you. Don't give up bro!
1
u/VasylievCode Mar 25 '24
I have masters degree in Mechanical Engineering but it was much easier for me to become a mechanical engineer. There was some flow
4
u/thoflens Mar 25 '24
If you're a mechanical engineer, I can assure you you're smart enough to be a developer. Just keep going.
5
u/superluminary Mar 25 '24
Coding is hard. At a certain point it just clicks, and you see it’s just a string of instructions reading from left to right, top to bottom, and a pointer crawling along the line left to right one by one. And then some instructions like function calls or loops can move the pointer.
This is your base abstraction. If you can see your code like this then everything else will make sense.
0
u/delventhalz Mar 25 '24
Not necessarily left to right. Nested functions are right to left. Math follows order of operations. But overall, I agree with the point.
-1
u/superluminary Mar 25 '24
It’s going right to left because the function exits so the interpreter moves the execution pointer to the last place on the stack.
2
u/delventhalz Mar 25 '24
Does there being a low-level technical explanation for it help clear things up for new learners who were confused by your asserting code runs from left to right?
2
u/lt_Matthew Mar 25 '24
A calculator is not a beginner task
Here's my advice for programming
Tutorials: a tutorial should teach you how to do one thing. Even if you're a complete beginner, don't look up tutorials for entire projects. Instead try and make something on your own, and look up tutorials for specific elements, like a button or processing an input.
This makes it way easier to digest the language, because you're not overwhelmed with everything it can do. It makes it easier to understand the code because your functions are all separate from each other. A tutorial that teaches how to make a whole website or app will just create a situation where you don't know what each line is responsible for.
Learn by doing: create a GitHub account if you don't have one already and just make random projects. Don't worry about finishing them, they don't need to be useful. Just make whatever. The more code you write, the more you will start to understand it. And you're building your own library of code you wrote, that you can copy the next time you need a certain functionality.
2
u/Old-Performer-1521 Mar 25 '24
My advice. Start as soon as possible with a real project that motivates you. When I build things that are fake I and others devs that I know don’t tend to learn quick enough. Building a calculator or todo list is boring.
Maybe your project is a big. Break it down into smaller chunks. Every time you complete a chunk it’s a win :) you need to think as if you’re building a real project then it becomes fun.
Happy coding
1
u/Gnommer Mar 25 '24
Maybe try to get yourself comfortable with JS first before trying to use it on websites? I know JS is meant for this, but if you have problems then writing some node scripts could help you get your head around basics.
Some ideas: fetching and refactoring data from API (e.g. swapi.dev ), changing file names, creating CLI calculator, reading data from text file...
1
u/delventhalz Mar 25 '24
I don’t know whether or not it’s “for you”, but what you are doing now clearly isn’t working. Just pushing yourself harder rarely does. Neither does shaming yourself. You need a new approach.
One thing about learning to code is the knowledge is pretty sequential. If you miss an earlier lesson, it can make later lessons that much harder. Was there a first lesson where you felt lost? Can you go back and drill some early foundations you missed the first time?
1
u/sheriffderek Mar 25 '24
People will say positive things like just keep trying and stuff, but whatever you’re doing isn’t working. You’re not getting the correct concepts. You’re watching the wrong videos (too many times). You’re putting too much energy into the wrong parts.
So, let’s break it down.
What’s your conceptual model for how programming works? What are the things JavaScript does? What do you want to do? How can us use JS to write a program to do this? Can you write out the pseudo code?
1
u/celda_maester Mar 25 '24
If you keep trying, you will get it in a while no matter how hard it is period.
But if you are just learning to code as it is in trend don't do it it will get harder and harder as you move forward, It's not necessary to learn code you can do lot of other things and get hired and earn well.
1
u/cantonic Mar 25 '24
You are pushing yourself too hard. You’re frustrated that the thing you are pushing to learn is still hard to learn no matter how hard you push.
Give yourself a break. You are smart and capable and your struggle is one that everyone has as they try to learn new skills. And give yourself a break by stepping away! You are working full time and then trying to work hard after work too and your brain and your body need rest. You aren’t giving your brain time to digest and retain information.
I think it might help to break down your goals into smaller goals that are more manageable. And to work on a goal for a day or a week until you feel comfortable with it. Instead of making a calculator, can you make a single addition machine? Can you create a button where when it is clicked the value of the button is displayed?
Break your journey down into smaller steps. This is a marathon, and marathons have water stations throughout the race to make sure runners can hydrate and get the support they need. You also need rest and support!
1
u/carnepikante Mar 25 '24
Does this course/exercises have a deadline? If so, drop'em and do practices at your own time. Also, as other user said, calculators are not easy, try to do something easier. Also, try to "play around" with methods and functions, make an array and use slice, splice, sort, etc. to be more familiar with those things and eventually you will understand what they do and how/when to use them.
I think the most difficult part is the abstraction. I'm a web dev for 13 years now and when i want to learn something that has another kind of abstraction that the ones i'm used to, it is really hard at the beggining.
1
u/Coraline1599 Mar 25 '24
It sounds like you need a good tutor.
Not one that will give you answers but can help start building strategies for solving things and helping you develop approaches.
I think you likely need 2-4 sessions to get you on the right track.
For now, there are two things you can work on.
make a plan, especially with DOM stuff you want a wireframe at least and some pseudocode
further out what are the minimum things you need to do and in what order (ie, must make a button before you can create an event listener for the button)
if you don’t know how to do something, think of what smaller thing you can do. Can’t do a whole calculator? What about adding two numbers together? Can’t add two numbers together? Try to get a number to appear on the screen. Can’t get a number to appear on a screen? How about just console logging it?
once you do the smallest thing, think about the next thing you can do.
It takes a lot of practice to break things down and also to learn to solve problems how a computer would solve a problem.
Finally, the last piece of getting started is coping with feelings. You’ll fail a lot. You’ll eat a lot of humble pie. But you will finally solve something and it will feel really good. Learning to work on stuff along with the feelings takes time.
1
u/MortgageBrilliant472 Mar 26 '24
I don't think anyone is a natural programmer. It takes a lot of deliberate practice, come on!
0
u/GeriToni Mar 25 '24
Try other programming languages too. I personally don’t like JavaScript but I manage to accept it after they made ecma 6 modules with classes a standard My favorite programming language is Java.
At the beginning it was hard for most of beginners in web development. I remember when I first started I could barely find the css classes names in html files and I was the one who named them. Then the html and css and some confusing methods to manipulate the dom, like use this instead of that cause that is not in use anymore etc.
Then came the js frameworks. Then other js environments like node js, electron js. I can’t believe I went thru all of that. But now I feel comfy to do whatever full stack app. I do regret I didn’t insist so much in Java like I did in web app dev, since was way easier for me. I love Spring boot, I have just one personal project created using it.
12
u/thoflens Mar 25 '24
A calculator is not easy to make, so relax, the way you're feeling is very natural. Every time I am in a similar situation, I remind myself that at some point not far away in the future, the things I struggle with will be easy and natural, because that's always how it goes if I keep going even though it is hard.
Here's my recommendation: Forget about the DOM and websites and practice plain, vanilla JavaScript. Open your editor or any online playground (because that takes away the barrier of setting up and environment) and start doing simple exercises - write functions that take zero or more arguments and do things like: Capitalize the first letter of a string, capitalize every letter efter a period, reverse a string, detect if a string is a palindrome, capitalize every second letter, sum two numbers, print only odd or even numbers, construct an array of odd or even numbers, merge two arrays, convert a number to a string and vice versa. From here, try working with objects and learn about some of JS' built-in functions like map(), find() and filter().
I could keep going, but I really suggest you to get comfortable with JS like this before delving into websites and DOM manipulation.