Skip to main content

Code Resolutions for the New Year

Hello World and Happy New Year!

It's a gift to be alive and I wish you all love, light and all good things.

Go chase your dreams!

Meanwhile, I needed to write this down.

 

Code resolutions for the year:

1) Work with Sanjay, my web developer, to make a beautiful jQuery plugin for a responsive lightbox.
We have a rudimentary one that just about works with video, audio, images and galleries, but it needs to be more flexible. Almost all responsive lightbox plugins nowadays come with a fee, for some reason, and while I have no issue with that, the world could use a free, lightweight one.

2) Put up more code snippets and demos online.
No need to expound on this one.

3) Be more open to using pre-processors and frameworks for CSS.
I avoid these, since I find that they can result in bloated code and unnecessary overhead. I use my own light-n-easy responsive framework that's tweaked for each project. However, if a large production team is using LESS/SASS or Bootstrap/Zurb, I'm totally happy to work them them. I've read enough of the documentation to not want to use them just yet, but to be ready to work with them if I have to.

4) DRY
The only time you repeat something is when you want to remember it. Life's too short to write ugly code, unless you're hacking on a tight deadline, which ideally, should be avoided.
If you're repeating yourself too much in your stylesheets, no pre-processor is going to save your ass.

5) Keep writing beautiful CSS
Clean up your CSS at the source. Write appropriate classes and group selectors well. Let go of unnecessary vendor prefixes for certain properties. It's ok to use IDs when they're needed for the sweet specificity they proffer (I'm tired of these ridiculous ID bashing posts).
Utilise the power of CSS selectors like nth-of-type, nth-child, siblings and attribute selectors. It's amazing how clean your markup remains with these. Make sure your selectors are not too brittle, though.

6) Get very tight with jQuery.
I learnt jQuery after getting a solid grip on CSS, which seemed to be the most natural thing to do. Lots more to be done there. Yes, I understood the fundamentals of Javascript via jQuery, whether you agree with it or not. It just happened.

7) Resist the urge to minify your CSS
Controversial, but it's not the worth the savings for small to moderate projects. Seriously. Let people view your code. You view their code. Code in the browser should be readable in 2013. Of course, use minified versions of plugins and frameworks. But let your code be readable on viewing source.

8) Be gently firm with clients when required
I try to be as accommodating with clients as I can, but there are times when you need to draw the line. Like when you're trying to close a project and there's a list of unreasonable, new changes. It's hard to define scope with projects. But it's time well spent.
I also try to make clients understand the value of carefully written, good code in the long run. And that the web is not Microsoft Word and print.

9) Spreading the word about old browsers
I do this, but need to be more aggressive this year. Please upgrade from FF 3.6. Don't use IE7 (or 8 or 9, ideally). Try Chrome as your mobile browser - it's gorgeous.
I'm happy to come over and install or upgrade your browser for you, if you're a lazy piece of shit.

10) Remember the spiritual essence of code
Writing good code is often about being open, trimming away what you don't need anymore, letting go of old, outdated habits, sharing with the community and going deep inside to find answers when you hit roadblocks. It's about focused awareness and being in that sweet zone, where things just happen.

Credits

Images by Karen Menezes

Related Tags

Blah Blah ALL TAGS