Get your JavaScript in order

In my last article, back in August 2011, I discussed a method I use to modularise CSS in a website build. In this follow up I’ll introduce a means of modularising your JavaScript to make it easier for you and your teams to develop and maintain. This isn’t the only way you can do this, but it’s a method that’s been working for me – and one you could also find useful when trying to organise your projects.

Recent browser wars have seemingly focused on JavaScript performance these past few years, and we’re using larger quantities of the stuff than ever before. We are moving into an era where we’ll be using more and more clientside scripting to handle what have traditionally been seen as server-side things, such as using JS template engines to render HTML. With this in mind, I’d say better organisation of your JavaScript is more important now than ever before.

Before we get going, I think its worth stating that I am no hardcore JavaScript programmer. I am a frontend developer with a design background, although I do seek to improve my JavaScript skill set. This solution was born from trying to make my life easier and so hopefully it can do the same for you.

My old approach

Thank you for reading 5 articles this month* Join now for unlimited access

Enjoy your first month for just £1 / $1 / €1

*Read 5 free articles per month without a subscription

Join now for unlimited access

Try first month for just £1 / $1 / €1

TOPICS

The Creative Bloq team is made up of a group of design fans, and has changed and evolved since Creative Bloq began back in 2012. The current website team consists of eight full-time members of staff: Editor Georgia Coggan, Deputy Editor Rosie Hilder, Ecommerce Editor Beren Neale, Senior News Editor Daniel Piper, Editor, Digital Art and 3D Ian Dean, Tech Reviews Editor Erlingur Einarsson and Ecommerce Writer Beth Nicholls and Staff Writer Natalie Fear, as well as a roster of freelancers from around the world. The 3D World and ImagineFX magazine teams also pitch in, ensuring that content from 3D World and ImagineFX is represented on Creative Bloq. 

Latest in Javascript
Speed up JavaScript
21 steps to super speedy JavaScript
Angular 8
What's inside Angular 8?
brain.js neural network
Use brain.js to build a neural network
Explore data visualisation with p5.js
Explore data visualisation with p5.js
WebGL 3D
Create a WebGL 3D landing page
JavaScript code splitting
All you need to know about JavaScript code splitting
Latest in How to
Rob Redman's snowy image illustrates the AE tutorial: TDW313.PT_AE_Snow.indd
How to create realistic snow with particle systems using After Effects
Ivan Mironenko ZBrush character tutorial
Craft a game-ready character asset using ZBrush and Substance 3D Painter
Oliver Schümann ZBrush bizarre baby tutorial
Create a bizarre baby sculpture in ZBrush
Alireza Khoshpayam arch-viz tips
Speedy tips to create beautifully photoreal archviz using 3ds Max and Corona
Maya 3D abstract strands tutorial
How to easily create complex and abstract animation using Maya
Whiskytree battle damage effects tutorial
Create gnarly battle damage for vehicles using a mix of Maya and Nuke