Front-end developers are often stuck between the devil and the deep blue sea: confronted with ever-changing technologies and toolsets, while yearning for the familiar comfort of old habits.
But if we keep things exactly the same, it’s much harder to make progress. The key to good development is to regularly reflect on our process: changing habits that hold us back, and adopting new behaviours to boost our production, creativity, and enjoyment. To that end, here are four ways to improve your working life in 2016:
-
Lint your code
Linting is any process that inspects your code for consistency and possible errors. More broadly, linted code conforms to a shared set of conventions for naming, spacing and style. It’s especially valuable in teams, since well-linted code is easy to share and integrate, but it’s also useful even if you are a lone wolf: developing code to a consistent set of standards means that it’s much easier to reference work you’ve completed in the past.
Linting can take many different forms:
- For HTML, formal linting is essentially validation, but it can also be a shared set of conventions: using a shared standard of tab indentation in code, for example. It might be a resolution to use semantic HTML5 markup, such as the
<main>
and<figure>
elements, rather than generic<div>
tags, or to use correct typography in body copy. - CSS Linting is not without its detractors; the good news is that many preprocessors, such as Sass, already have (or can integrate) linting tools. CSS linting can range from the conventional (property / value pairs on separate, indented lines, alphabetical ordering) to questions of compatibility (which CSS properties and values should continue to receive vendor prefixes in the stylesheet); at the top end, CSS linting also integrates with the naming conventions of OOP-style CSS development systems, such as BEM.
- The range of JavaScript linting tools - such as ESLint - is also strong.
As with all new habits, adoption of linting can slow production down a little at first, but the investment rapidly pays off; the key is to make a manageable series of conventions and stick to them
- For HTML, formal linting is essentially validation, but it can also be a shared set of conventions: using a shared standard of tab indentation in code, for example. It might be a resolution to use semantic HTML5 markup, such as the
Start a developer’s diary
Developers tend to be so busy hacking on code that it’s easy to take for granted the immense progress made in a year. Unfortunately, doing that also inevitably means forgetting a portion of what we’ve achieved. To act against this, keep a log of the discoveries you’ve made while developing. The best possible way to do this is to blog it: doing so shares your work with the community, but many developers hesitate in doing so, as writing up a good blog post can take a considerable amount of time, and not everyone wants to put their work in public. But many alternatives exist: you could save interesting code as a gist, or in a blogging platform like that provided by CodePen.
It’s also very useful to keep note of mistakes: assumptions made and confusions encountered. While often wince-inducing, writing them down allows you to acknowledge the errors and learn from them, rather than brushing them under the rug.
Take on a style guide
Site style guides - conventions for the visual appearance and behaviour of site elements - really came into their own last year. Traditionally thought of as giant tomes of discipline that fell from the lofty perches of designers onto the heads of developers without consultation or justification, style guides have developed into living, breathing, dymamic digital documents that can significantly speed up site development, and make pages more consistent.
Take care of yourself
Keeping up with regular exercise and maintaining a healthy diet can feel like a distraction. In reality, they are an investment, fuelling your body to create better and more productive code, allowing you to work longer (if that’s what’s needed).
Try to take regular breaks from work. Keep healthy food at your desk. And schedule exercise, to keep your body and mind in trim.
Whether you take on these practices or others of your own choosing and design, it’s important to create some change in your development life, in order to improve and grow.
Photograph by Lord James, licensed under Creative Commons
Enjoy this piece? I invite you to follow me at twitter.com/dudleystorey to learn more.