DEV Community

Discussion on: jQuery to ES6 and what if you don’t need a JS framework…

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

Man I want to review that code, it's good but there are a few small nitpicky things 😎

Collapse
 
joethom profile image
Joe Thom

Ha, thanks - the plan is definitely to open it up for feedback, nitpicking and PR's if there is interest. The more collaboration the better 👍

Out of interest what would you change?

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

Just a few little thing really, I'm all about details.

There are some let's that should be const because you don't change the values of them, I use way more const than let usually.

Perhaps more destructuring would be great.

I would also not use uppercase variables for the window object literals. Uppercase is is generally used for constants.

The try catch, not sure that's doing much because errors will be reported either way and there is no fallback logic anyway to handle a fault.

The comments could consolidated to reside in the jsdoc block with a @description, you might not need to explain as much with the comments, line by line.

That's mostly opinion and subject to code style and reasons I'm not aware of 😋

Thread Thread
 
joethom profile image
Joe Thom

The 😈 is always in the details..

Agree that there are probably too many miscellaneous let's lying around.. For the window objects I guess I see them as constants in some ways - as in they are used throughout the application and shouldn't be changed, however they are appended to so perhaps uppercase is not appropriate.

The try catch is more to stop the whole thread crashing (known potential other issue..) if there is an error within a function handler. And with the comment's style it was more for the purpose of this article rather than for production, but none the less a good point.

Really appreciate the feedback, will keep you posted if we manage to open source it ✨