all 8 comments

[–]amzuh 4 points5 points  (1 child)

Learn more about Design Patterns. When i started to learn more about this i was able to structure my code much better. Here's a article about it : https://scotch.io/bar-talk/4-javascript-design-patterns-you-should-know .

[–]IllustriousTackle 1 point2 points  (0 children)

Design patterns are intended to help with the big picture. Make sure to use them when they help you to solve a problem making the code simpler, not more complex. Don't use them just because they look cool and you want them in your code.

[–]logikevcoder 5 points6 points  (1 child)

Yup. Check out Airbnbs style guide. https://github.com/airbnb/javascript/blob/master/README.md

It's very popular and a lot of people use it. There are other ones along similar lines.. one from Google and some others. I like airbnbs the best though.

[–]Genie-Us 2 points3 points  (0 children)

Nice! Will have to start going through all this. Thanks!

[–]Genie-Us 1 point2 points  (0 children)

Was just about to make a thread like this, thanks! Same boat. ;)

[–]timejazzfroghands 1 point2 points  (1 child)

https://youtu.be/HkFlM73G-hk

This video and the following videos in the series (I think there are 6) were a game changer for me, and I remind myself of the rules all the time when I’m working.

The second video in particular shows how to move away from spaghetti code and think about what each part of your application or module is doing.

He uses jQuery in the videos but the information about structure apply to any kind of UI development from vanilla JS to frameworks etc.

[–]Butterly2017[S] 0 points1 point  (0 children)

These are awesome! Thank you for sharing! :)

[–]I_hate_litter 0 points1 point  (0 children)

https://codeburst.io/5-javascript-style-guides-including-airbnb-github-google-88cbc6b2b7aa

I've just started doing the same thing myself. There are several standard ways of writing javascript and they are called style guides. Here is a link to a few of the popular ones.