Is JavaScript a hard language to learn? (and other things)
(Source/Credits: https://dev.to/lucashogie/is-javascript-a-hard-language-to-learn-and-other-things-jme)
In a rush? I've marked the questions with bold to make it faster to read, don't mean to waste your ti...
In a rush? I've marked the questions with bold to make it faster to read, don't mean to waste your time! :)
Hi everyone 👋, hope you're having an amazing day. My name is Lucas, I've been learning Javascript recently. I'm quite new to developing, and I was wondering, is JavaScript said to be a hard language generally, and if not, what would be some languages that are identified as 'hard'?
Now that we're on the topic, I'd also be really interested if any of you have any amazing resources you would suggest for learning JavaScript. So hard I've found Egghead.io pretty awesome myself. How condensed the information in each tutorial is and that it is well-edited is great. The speed and quality of each tutorial allows you to grasp relatively hard concepts to learn quickly.
I'm really curious to see your answer(s)! 👀
EDIT: thank you all so much for your responses!! I REALLY appreciate it!
Comments section
alansolitar
•May 1, 2024
I don't know it it's necessarily hard, but it is quite different than many other languages in some respects. In particular, some of the more functional aspects of javascript can be confusing, if you are used to more object-oriented paradigms.
nijeesh4all
•May 1, 2024
Js can be little hard to learn at first. Thats because if you are some one who is coming from c, c++ , or java like languages it will really easy for you to learn the basics because most of the structure is same (like for loops and while loops, if-else, etc ).
But you will struggle a little to understand the event-loops, asyc etc.
Once you have an idea about how Js works. Js becomes a really fun language to work with.
This video helped me a lot understand how event loops work: youtube.com/watch?v=8aGhZQkoFbQ
pclundaahl
•May 1, 2024
I'd personally say I found learning to be productive in Javascript to be easier than in Java, and substantially easier than, e.g., C or C++. However, I feel like there is a much wider range of applications that you would use JS for, so I think a lot of that came down to learning how to organize code for different project scales.
I would say that JS has a lot of strange mechanics under the hood, and it definitely took me a long time to start getting really comfortable with them. Expect it to be an ongoing journey (though a fun one!)
Good luck, and enjoy the ride!
andrewbrooks
•May 1, 2024
JavaScript can be a language that can really make you go wtf if you don't take the time to understand the mechanics behind how it works.
A great read to demystify JS is You Don't Know JS. It helped me a great deal and I still reference it from time to time.
github.com/getify/You-Dont-Know-JS
pclundaahl
•May 1, 2024
I came here to say this, as well. Reading and taking the time to really grok You Don't Know JS was a major turning point for me.
felipperegazio
•May 1, 2024
I think is a matter of ask yourself first:
What i want to do with javascript?
I think the language itself is pretty simple and easy to achieve a basic knowledge
Now, your goals will define if javascript is easy or not for you.
If the ideia is get a job as a junior dev, if you want to build a product, is just for fun?
I think that matters.
But at the end, programming itself is hard, and i think thats a big part of the pain & fun :P
kspeakman
•May 1, 2024
No, Javascript is not a hard language to learn. It does have some notorious footguns that you would do well to avoid. The biggest one of these being implicit type conversions. For example. Javascript section starts at 1:22. The way it handles implicit casts means you have to care an awful lot about type equivalence. In particular use
===
to check for equivalence in type and value. Using only double-equal will silently do an implicit cast if the types are different.Another honorable mention is JS's numeric type. Floating point numbers in particular do not behave like you would hope. Try adding
.1 + .2
and you get0.30000000000000004
. If I need a money calculation, I will send it to the server to calculate and show it on the front-end as a string. Or worst case, I will convert the floating point to an integer (multiply by 10s until the integer has enough precision for your calculation), the perform the integer-based calculation, then convert back to a float (divide by 10s).These are more-or-less avoidable problems.
The thing that IS hard about Javascript (and front-end in general) is its dev ecosystem. There are a lot of moving parts. Best to look for templates or starter packages at first. e.g. Create {Insert view technology} App.
ahferroin7
•May 1, 2024
Given that you're new, probably not very if you can find a good tutorial, but that doesn't mean it's a great choice for a first programming language.
Put simply, JS is different. Not bad, not hard, just different. It has a lot of peculiarities that aren't present in other languages. That can make it a challenge for experienced developers to learn the language, and can also make it challenging for new developers who started with it to branch out into other languages (the
this
keyword, the wholenull
/undefined
insanity, and the prototype-based object model come to mind as the three biggest peculiarities here).As far as resources, I don't have any good ones to suggest for learning initially, but once you're actually using it, especially for web development, MDN is an indispensable resource for looking up information about the Web APIs.
weptim
•May 1, 2024
Traversy media vanilla javascript crash course on udemy
chrisachard
•May 1, 2024
JavaScript definitely can be difficult to learn - but it can also be one of the easier languages to learn; it's mostly about how you try to learn it, and what you try to learn.
I think there are three main problems with learning javascript:
this
means at any given time, type coercion, variable scoping... (etc). That all makes it a bit trickySo! My major recommendation is to do two things:
Hope that helps!
And oh yeah - as an egghead instructor myself, I can say that egghead is great :)
lucashogie Author
•May 1, 2024
Hey, Chris! Thank you so much for your response. And it's so cool that you're an instructor on Egghead (and thank you for being one, I appreciate you)!