Rules

img_2964

Taking my first steps in the world of programming, I’ve been intrigued to see that many of the overarching rules for ‘best practice’ and the more philosophical protocols for program design/code structure, are nearly the same as in screenwriting.

  1. Keep it simple.
  2. Show, don’t tell.
  3. Don’t repeat yourself.
  4. Only do one thing at a time.
  5. Write for your audience.

These aren’t rules in the traditional sense. They aren’t dictums passed down from on high that every programmer/screenwriter must adhere to. Occasionally you simply can’t keep it simple. You may well have to tell, rather than show. And sometimes, because it’s necessary (or because it’s something of an artistic flourish), you may have to repeat yourself.

Rather, these are popular rules, finely honed over the 120 years that people have written for the screen, and the 200+ years that programs have been written for machines.

It’s not just rules that translate between programming and cinema, though. There are quite a number of connections between the art of creating computer programs and the prevailing analytic approaches to film; but that’s for another time.

DOMs away

75% of the way through an Essentials course in JS, and I can’t wrap my head around the DOM. I get the concept, but the logistics of actually manipulating it are eluding me.

Yes, I realise there are simple syntax solutions to most problems. Variables, functions, arrays, etc, have well and truly sunken in, but the DOM is a wall in which I can’t seem to find a doorway.

Bah.