Posts
JavaScript and the end of progressive enhancement
Progressive enhancement is the Right WayTM to do things in web development. It works like this:
Write the HTML for your content, 100% semantically (i.e. only the necessary tags to explain the meaning of the content).
Style the HTML using CSS. You may need to add hooks to your HTML in the form of classes and ids for the CSS to target.
Add JavaScript enhancements to the interface, but only enhancements.
Posts
27
Well, I’m 27 now. I thought I’d write a little update to my New Year’s 2011 post, to assess where I am and where I’m going. As before, if you’re interested then read on, but don’t expect any life-changing revelations or anything :)
Resolutions or whatever The following are the headings from my 2011 post, with my thoughts/progress on each point.
Finish SICP On my way with SICP. It’s a hard slog but enjoyable too.
Posts
Closures explained with JavaScript
Last year I wrote A brief introduction to closures which was meant to help people understand exactly what a closure is and how it works. I’m going to attempt that again, but from a different angle. I think with these kinds of concept, you just need to read as many alternative explanations as you can in order to get a well rounded view.
First-class functions As I explained in Why JavaScript is AWESOME, one of the most powerful parts of JavaScript is its first-class functions.
Posts
Magic in software development
First off, so we’re on the same page, we need to be talking in the same terms. So, what is magic? I’d define it as anything below your current level of abstraction that you don’t understand.
I first started thinking about this topic because of this angst I felt about all this magic I was relying on. There’s so many things that I rely on every day and I have no idea how they work.
Posts
Seven steps towards becoming a professional developer
When you first start learning to program, the best thing you can do is just write code, and lots of it. Coding is a muscle, and it needs to be exercised.
That’s just a start though. If you enjoy it, and it’s something you want to do professionally, then there are some essential practices that you need to learn, and make part of your routine.
This list is split into two parts.
Posts
jQuery vs DOM return false
What does return false do inside a JavaScript event handler? What does it do in a jQuery event handler? Are they the same thing?
The short answer is “no”. return false in a native JavaScript event handler prevents the default behaviour of the event. It’s the equivalent of event.preventDefault(). This is the same for DOM level 0 event handlers like this:
element.onclick = function () { }; and DOM level 2 event handlers like this:
Posts
jQuery.tmpl() presentation
Back in January I did a presentation at the Bristol Ruby User Group on jQuery.tmpl() - jQuery’s templating engine.
The presentation was filmed and is available on the BRUG website. The slides are also available.
I wrote the slideshow engine using jQuery.tmpl() - if you’re interested in viewing some real-world jQuery templating, have a look at the source on Github. I tried to use as many of the concepts introduced in the presentation as possible, so it’s a useful showcase of what can be achieved using jQuery templates.
Posts
id_barcode - a barcode maker for Adobe InDesign
id_barcode is multiple things. It’s an example of writing structured, modular code for an InDesign plugin. It’s a demonstration of test-driven development for producing InDesign plugins. It also makes barcodes.
InDesign barcode maker First off, this is a barcode maker for InDesign. It’s fairly simple - just put in your ISBN, and choose the font for the ISBN and for the numbers under the bars. Here it is:
and this is what the barcode looks like:
Posts
A short word on nomenclature
These symbols have accepted names (in the context of programming):
[ ] These are opening and closing brackets. They are square, so are sometimes called square brackets. { } These are opening and closing braces. You could call them curly braces, but there’s no need. ( ) Theses are parentheses. One is a parenthesis. If those are a bit of a mouth- or keyboardful, call it paren and parens. Don’t call these brackets or I’ll destroy your keyboard.