What are/were your biggest struggles in learning JavaScript?
This question can refer to specific code issues (like working with arrays) or learning issues (like following a tutorial but not remembering afterwards).
I'd like to hear it all!
Also, if you're more experienced, but you still remember your struggles with JS, feel free to chime in.
Latest comments (65)
endless frameworks and relative technical stacks.... π
I used to be a full time developer in the early days of my career and I could spend hours testing out new things, reading up on best practice and spend time understanding so that the hours of pain became muscle memory fixes driving really efficient code. Heck I even spent time helping others out on a few select SO tags.
Now? I changed role and moved into IT architecture along with a wife and child I've now become a "hobby Dev" working on personal projects.
Why is this information important? Well I loved node and JS but now I really don't know.
I can spend a few months busy with life and suddenly the whole js world has changed. I can't keep up.
I no longer have a clue how to structure my code.
I have no idea which version of node I should be using.
I look at the cool framework I was just understanding and I see it's in ruins and deprecated.
I read a tutorial and everything but the inside of the function looks like it's written in another language.
I find I'm starting out all over again each time.
I load up my editor and after printing out to the console I look at the clock and realise my hour of coding time before worj is over.
The speed of node ecosystem movement is infuriating.
I won't be changing my preferred language anytime soon though.. theres something perverse trying to keep up with it all.
My first programming language outside of the modified BASIC language for some old hand-me-down I got when I was 12, was Ruby. I went to a meetup and learned some of it. Damn did I love it. But I kind of knew then I wasn't going to work with it. JS is pervasive and while it is certainly monolithic in terms of tooling and ECMA trying to figure out what JavaScript actually is (is it OOP? Prototypal? Functional? Β―_(γ)_/Β―) I like it.
I still have some trouble with it but all in all. It's a fun language. Well designed? Debatable. Ruby is beautiful. But I guess JS is the way forward for now. (Seems Elm and Web Assembly might be better options?)
Algorithms! Those are my biggest issues with javascript. It's such a fun language to learn, but somehow, I've found it a bit daunting to solve common questions, whether with inbuilt functions or not.
Where to begin. I come from a strongly typed, compiled background, and JS seems like a hodge podge of a dozen different languages. Every new ES version released seems like the try to pivot and make the core language more like something else. It's confusing to me when JS wants to be object oriented, and then doesn't. The whole idea of a DOM really confuses me, and don't get me started on 'this'.
DOM APIs are probably the hardest part. You never know all the nuances of each of those methods...
For instance, just yesterday I found a bug in my library because I used
.offsetParent
to get the first "positioned parent node", and I discovered that this property will give me the nearest "table" element if no positioned parents are available...For me it's not about the language but more about the tool sets around it, things like Webpack. Lots of varied documentation styles and not enough working examples.
I'm more of a "backend" web developer who actually loves JS, so I'm definitely not a JS expert but my biggest issue is time (or more precisely lack thereof) in small to mid solo projects.
The amount of tooling (though it seems lots of people are converging towards Webpack + Babel + ES6) required to setup any web framework with "modern" JavaScript is kind of ridiculous. Especially if you have a "legacy" jQuery + backend app that you want to slowly port over.
React seems fantastic but the learning curve is quite steep if you combine the tutorial, ES6, all the react-* libraries, your own brain that keeps asking "how do i do this jQuery three-liner in React" and so on.
I am super happy that the ecosystem is so vibrant and huge and it's harder now for a single person to keep all of this in their brain but I feel like that server technologies have more of a grip in the evergreen issue of "complex vs complicated". Most of the server side web frameworks now are immensely complex but are not complicated to use.
React to me seems both, and again, I'm not an experienced frontend developer so it might just be me.
Am I making sense?
I completely get what you're saying about the setup pain with all the tooling. It feels like a lot to keep track of for sure.
Lots of good answers here, but I'd like to add that, due to JavaScript's history, people don't learn it the way they do other languages.
In my experience, when people pick up languages like Python or any of the C family, they grab a book and work through it. Along the way, they're learning how the language works and the ins and outs of how to solve problems using that language. So, things like syntax, common patterns, and the quirks of that language are naturally introduced.
With JavaScript though, new people just start grabbing at tutorials that show them HOW to do some specific thing or HOW to use some new framework. At no point are they learning actual JavaScript.
Learning React, Angular, Ember, Lodash, or any other plug and chug tool is not learning JavaScript. Going through a "What's new in ES6!" blog post is not learning JavaScript. Even learning Node is not learning JavaScript.
Read You Don't Know JS, all of it and actually LEARN JavaScript.
You know, I never thought about it, but this makes so much sense. Fantastic points.
One: I can follow along with a tutorial no problem, understand what they're saying, write it all myself (instead of copy/paste) and all makes sense. Go to apply it on my own, either starting with a new project or adding it to something I was already working on - and I get a type of paralysis. Applying it on my own, without someone walking me through it, is regularly a huge hurdle for me. It's almost like my brain just isn't really absorbing it. Or so much of the other code (their styling and html and such) is taken care of that when I mix in the new stuff I don't know how it plays with everything else, because I didn't have to think of that in the walkthrough. I normally work it out and I'm fine, but it often stops me for awhile.
Two: Setting up my own dev environment. This still gets me almost every time, though I'm getting better. When you're learning the language so much is guided and focused on the actual language and on using tools that handle most of the other stuff for you. Which is great, in it's way....it's just hard when you go out on your own to really find a flow that works and lets you see what you're changing as you go.
As for point one exactly how I feel, I go along with tutorials but when it comes to working on my own I hit a brick wall.
Personally the biggest issue was learning how to structure my code. At the time when I was learning there wasn't really any idiomatic way to organize your codebase.
Should I say I made a fool out of myself in an interview, when I was asked related to Javascript:
'What is the result of 3 divided by 0 (3/0) in Javascript?'
With my Python Ninja Hat still on, with lots of sprinkles of common sense, was quick to say, '
ZeroDivisionError
, or an error similar.'For once in my life, I felt 100% confident about an answer, except to JS, when you divide a number by 0, you're in
Infinity
.smh
.map(index, item)
vs.map(item, index)
(The latter is the better BTW)double
trouble 0.1+0.2 != 0.3null
,undefined
, andundeclared
===
and!==
Each one on it's own is an inconvenience and every language has its issues. But put all of these together and it makes coding a terrible experience.
Javascript really is the English of programming languages. It's ubiquitous and it's surprising how much gets done in it, but it's not a beautiful or good language by any stretch of the imagination.
It makes me wonder everyday why Node.js was/is a thing that grew beyond just an April Fools joke.
As a complete beginner ,t he biggest trouble is finding the right guide(which or whose learning path should I follow ???).
Angular or React or Vue???(which front end framework)
ES5 , ES6, ES7 , ES8 ?????(How many things should I learn ???)
Babel , JSX and how many more ?
I think you use JSX with React anyway. Just HTML in your JavaScript which is a React thing.
Declaring a "class" with a function, and adding methods dynamically with this weird
prototype
object. How weird!But really, learning JavaScript has been, fortunately, quite easy forward for me. I'm kind of puzzled of all the issues about it.