And stackOverflow...OMG! Ask a simple question on SO like "Hey, these four lines of code are in an IIFE, where is variable foo visible?" and you'll get
New JS programmers spend a lot of time in the magical incantation stage, copying and pasting random code from the web that they hope will run correctly but that they can't explain how it works. Some never escape it!
As a 100k user I'm certainly biased, but I don't agree with this at all. What it sounds like is confusion over what Stack Overflow actually is.
I think that you just made my point 😉
You just described the separation of concerns concept fairly well.
Hahaha this made my day, thanks for the laugh! definitely true though
This is hilarious and true. Very well put.
Beautiful description 😂
You're damn right
Back in the days, for me personally the most confusing thing was what 'this' actually is.
When I speak to many less experienced devs today, the most frequent struggle mentioned are 'scopes' and 'closures'.
Good one Ben! Or how Shakespeare would say... "This... or not this?"
Kind of silly, but sometimes knowing what some things are, but not knowing what they're called can be difficult or disheartening, especially in an interview or skill-building situation. Some examples that I've personally struggled with include, but are not limited to: closures, hoisting, various design patterns (module vs constructor vs API vs factory vs x100000 other ones), etc.
That feeling of inadequacy, followed by a realization that I actually knew what was being discussed all along (coupled with an "Oh, there's a name for that?") can take a while to shake off.
It can also be hard to discern "Is this a programming thing?" or "Is this a insert framework context here thing?" since JS is prone to having multitudes of vocabulary words being tossed around at any given time.
I definitely agree and feel your pain on that one. I'm a young developer and I often times leave interviews thinking, "I just know how to code I don't know all these technical terms." It's so frustrating and I feel slow or lost at times.
That's one of the most frustrating things when you knew a topic all along but you just didn't know one of the terms for it.
I was going to say this and scopes, but since it's mentioned already, I will say: Compilers and Presets and Browser Support!
There is so many to figure it out, TypeScript & Babel & ES2015 & ES2016 & ES2017 . and the whole ECMAScript 6 Compatibility with browsers, See This Compatibility Table for example.
If a client asks to support IE8 I just make him pay its support as a brand new project. That's it.
We do exactly the same, old and non standard browsers are quoted as an extra and separate part of the project.
I think Elm will be the norm soon. I haven't had a bad experience with it yet either. Even though I haven't used Elm for to long, I can't help but feel it's just the permanent way to go. I can't wait for it to be everywhere.
Can't see this happen.
Elm is awesome, but it's also rather different and self contained. Many (JS) devs sadly just don't like FP.
Ironically, FP-ness is general and transfers even to OO languages. E.g. JS's Array.map, reduce, filter, lambdas, etc.
Yeah, I understand your point FP to me is great but I just started programming and didn't like learning OOP with JS. So it was easy for me to switch paradigms or practices a little. Everyone has there preferences though.
When first starting out as more of a hobbyist one of the first things I struggled with was how best to use objects and the object structure to store and use data. When to use OLOO vs. a class-like structure to properly scope functions, when to use prototypes, etc. Much of this has been "figured out" or at least made easier in the latest versions of ECMA which is nice.
Working with promises / async and chaining multiple things together to ensure state came together properly (in the jQuery days) and you didn't get "undefined" for your variable that logged just fine in the console was the next annoyance. Abstractions for these are pretty high quality now and somewhat easier to use but I definitely recommend gaining understanding before using otherwise it will bite you eventually :)
this (as has been said) is also an issue for me. Can still bite but at least I know to think "hey which this is this?" now.
I also have issues keeping up with best practices. In ReactJS, I started with the create-react-app boilerplate. As soon as I got something concrete going for an app, my co worker was adamant that React Boilerplate because it's super efficient and ASYNC REDUCERS AND SAGAS WOW!
This compounds because React is just one part of the entire JS ecosystem and even just keeping up with it can be hard.
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.
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.
Been using JS for... 17 years or so... and I still struggle with the different ways other developers find ways of doing stuff. I'm talking from formatting (2/4 spaces, double/single quotes) to OOP/FP/ES6 or weird patterns like jQuery plugins or JSX files.
Other languages (C/C++/Java/C#/Python/Go) seem to be teach on a more standard form and it's easier to read code written from a guy on the other side of the world from 10 years ago. You can't even find two JS code bases with the same formatting for documentation.
Have you had a look at prettier? Sounds like you might like it. Its a tool that takes care of all the formatting for you, all prettier code looks exactly the same. Their goal is to make formatting discussions a thing of the past:
Declaring a "class" with a function, and adding methods dynamically with this weird prototype object. How weird!
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 ?
Callbacks and closures
The easiest way I can tell you about what a callback is: it's just a function passed as a parameter to another function. jQuery uses callbacks a lot. Still trying to wrap my head around closures.
Callbacks were impossible for me to wrap my head around when I was first getting into JS. Beforehand I had mostly been coding in Ruby and things are just not done that way (well, asynchronous programming in general is not really a Ruby things)
Same as me... I started my coding journey with python. What a beauty that language is 😍
Keeping up with patterns and best practices as the language and ecosystem evolves is a struggle for me. Other environments seem a lot less likely to change from under my feet.
That is very true.
At some point I have realised how flexible this language is and the amount of surprising ways I have seen people using it so far only made me want to finally find those best practices for me.
asynchronous nature in debugging and this
ASYNCHRONOUS. Y E P. 100%. When I hopped from Java to JS, the fact that JS is asynchronous is definitely the biggest trip up.. 😅
same here : )
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.
It makes me wonder everyday why Node.js was/is a thing that grew beyond just an April Fools joke.
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.
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.
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...
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.
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?)
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.
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.
More on topic though: Debugging is somewhat hard for me, because the functional style and ES6 stuff such as arrows functions make that a line does more than one thing and at different times:
somepromise.then(x => dothiswith(x));
If you put a breakpoint what will it catch: The promise's then or the actual function passed to the then? I can't do it without a good IDE. Newer Webstorm versions help though.
Callbacks and promises!
These can be difficult for me sometimes too!
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'.
Graduating from basic loops to higher order functions.
ASYNC CALLBACK FUNCTIONS WITH ARGUMENT YOU ARE SUPPOSED TO REMEMBER!!! BUT MOSTLY THE PACKAGE MANAGER, DEPENDENCIES, AND TASKRUNNER.
I MISS THAT PLAIN OLD JS WITHOUT THE NODE PREFIX.
The 300 ways to do the same thing.
Everyone else already said "this" but I think it's classes and abstraction. So abstract!
endless frameworks and relative technical stacks.... 😂
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.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.