DEV Community

Fernando Doglio
Fernando Doglio

Posted on

What's the hardest part of JavaScript you've had to deal with?

I'd like to know from the newcomers to the language, or even those who've been with it for the past few years. What's been the most complicated, frustrating even, concept (or part in general) of JavaScript that you've found?

I'm looking to write about them in order to help others who're just starting out, trying to get them to avoid the frustrations others experienced and get them to like the language sooner than later :)

Anyone up for a friendly discussion?

Top comments (22)

Collapse
 
vimmer9 profile image
Damir Franusic

The ecosystem around it, npm and the apsurd number of dependencies for simple web apps. I also think it doesn't belong on the backend. Just my opinion, people mostly disagree and praise node.js like it's some sort of miracle, which it surely is not.

Collapse
 
deleteman123 profile image
Fernando Doglio

Interesting take on it! What's your back-end tech of choice then, if you don't mind me asking? Thanks for sharing!

Collapse
 
vimmer9 profile image
Damir Franusic

I don't usually do fronted stuff, my domain in backend C network programming. In the past year I have used both React for UI and Node for backend. I decided to reverted to my good old friend Php and store the data in mysql od postgres. Also, I just couldn't stand that MongoDB abomination.

Thread Thread
 
deleteman123 profile image
Fernando Doglio

Hahaha, interesting! I wonder why that would be, I want to keep asking you questions! What's so wrong about Node that you rather work in PHP?! I worked in PHP for almost 10 years, I couldn't see myself going back to it...
And you're not happy with MongoDB? I mean, it's not perfect, but neither is any product, so why the hate?

Thread Thread
 
vimmer9 profile image
Damir Franusic • Edited

Don't know, personal preference for PHP. I also got used to writing SQL and working with mysql cli.

Thread Thread
 
patrickdesign profile image
PatrickDesign

So your arguments basically boil down to "I'm not used to these tools, therefore they are an abomination" ?

Thread Thread
 
vimmer9 profile image
Damir Franusic

No I said it's a personal preference. I used the word abomination in the context of MongoDB because SQL language is in my opinion much better for fetching data and has been a standard for a long time. I didn't like the custom filter syntax of MongoDB. As far as performance goes, I haven't tested that but the word is that MongoDB excels at writing lots of data. Btw I'm not really obsessed with mysql either; been using postgres a bit lately.

Thread Thread
 
rabatelr profile image
rabatelr

I dont see why using Nodejs would force you to connect your app to mangodb? And I agree with Patrick, you obviously don't know enough to deliver such a strong statement as "abomination" as SQL and noSQL are for different uses. You should use one or the other according to the needs of your project.

Thread Thread
 
vimmer9 profile image
Damir Franusic

Well again, personal preference. I know that MongoDB is better when you're dealing with high number of write ops (CDRs for example) and I know enough to construct my own opinion. I'm sorry if anyone is offended by my choice of words. Node can also work with both SQL and noSQL, I'm aware of that. Any DB software is a great achievement and I'm aware of the effort involved. To each their own, at least we have options right?

 
deleteman123 profile image
Fernando Doglio

Well, I'll give you that having a single approach is simpler indeed, that also works against adoption from new developers who don't really like the paradigm or being forced to work with a single provider (such as Microsoft).

Personally, I like the varied approach JS gives you, and the mess with teams you mention I've never experienced it myself. It's always about setting standards from day one and then making sure everyone follows them. But that should be done with any technology, you can have JAVA as your main language, but still, there are different ways to write JAVA, so code standards apply. With JS it's the same thing.
I won't speak to your React use case since I don't know React nearly enough to have an opinion about it, but considering there's so much work being done with it, I would say it probably has its merits.
I personally hate JAVA because of how much you need to write with it. In fact, any self-respecting JAVA dev will probably not code JAVA without Eclipse or one of the main IDE, which I think speaks to how un-user friendly that language is, whether JS can be written with any editor without too much fuzz.

That being said, I'm not here to start a flame war about best or worst programming languages, rather I want to understand what are the pain points of JS developers in order to see if I can provide some help, so thanks again for sharing!

Thread Thread
 
justinformentin profile image
Justin Formentin • Edited

You mention needing other libraries to do different things, and that's really one of React's strengths. I think the problem comes from people thinking React is a framework. It's not, it's a view library. It has a lot of built in features, sure, but it's not meant to be an all in one solution. And that's great, because all in one solutions are often very heavy, and you're forced to carry the weight for parts you don't intend to use. React starts off incredibly lightweight, and if you need to add something to it, you can pick and choose the solution best suited for your application. You can do anything with react+other libraries as countless of companies have showed us. Needing to use other libraries to build complex applications isn't a con. And anyway, with enough experience you'd be surprised how complex of an app you can create with just plain react.

Collapse
 
deleteman123 profile image
Fernando Doglio

Wouldn't you say the "insane number of ways to do the same job" is a "problem" of all languages? Is there a language you think simplifies this approach?

Also, what do you mean by JavaScript tends to be messy? Could you elaborate a bit more?

Thanks!

Collapse
 
etampro profile image
Edward Tam

I think it is a matter of how insane it is. One example language that is more unified would be Ruby, which favors convention over configuration. I feel like people in the Ruby community can get behind small number of frameworks because of this philosophy a lot easier comparing to the JS community.

Just my 2 cents.

Collapse
 
darkes profile image
Victor Darkes

Personally when I first tried learning everything being asynchronous and functional was what I struggled with. Now that I've had more experience in general, new things come easier to me.

Collapse
 
deleteman123 profile image
Fernando Doglio

Asynchronous behavior is a really big issue for newcomers, I've seen it in person with jr devs!

Thanks for sharing!

Collapse
 
jennrmillerdev profile image
Jen Miller

I've been using npm (for React and Angular) apps for a while and I find npm some of the least pleasing parts of my dev life.

I don't know if I've ever found a nice article about the basics of npm in the context of a React app. There are basics articles about npm (without React), but getting a React app working with npm requires so much more 'magic'

Npm itself is a tool, I try not to spend time much more time than I need to either. As long as it gets the job done, I'm happy. But that could be because I lack a fundamental knowledge on it.

Collapse
 
deleteman123 profile image
Fernando Doglio

NPM is definitely a very misunderstood tool! It is quite powerful and yet, not a lot of people know everything it can do!
I actually have an article waiting to be published that covers NPM, sadly not in relation to React apps though. I might take a look at that in the future, thanks for sharing!

Collapse
 
laurieontech profile image
Laurie

I've always maintained the hardest part of understanding JavaScript is knowing what layer of the application a given thing is part of. It all runs together with ECMAScript versions, browser support, JSX, frameworks, etc. I actually wrote a post to try and separate everything out for people.

Collapse
 
nahuef profile image
Nahuel

promises!! Learnt by myself on a project deadline as a trainee, nightmare fuel right there!

Now I love them and even gave a talk at my company about promises and async await!

Collapse
 
deleteman123 profile image
Fernando Doglio

Thanks for sharing and congrats on overcoming a nightmare! Going from a novice to giving a talk about it is amazing! Way to go!

Collapse
 
a544jh profile image
Axel Wikström

this

Collapse
 
deleteman123 profile image
Fernando Doglio

Yeah, that can be a problem. Has it become an easier topic now with arrow functions and their lack of context?