Tuesday 29 July 2008

My Suggestion for a Privacy Statement

Most privacy statements for web-sites include something about the use of cookies. Recently I was peripherally involved in the re-drafting of one such section.

No, not that kind of cookie

Here's my "draft", which could be used as a honeypot to see if anyone ever reads these things:

We do not use cookies to determine the identity of individual users, unless you log in, in which case we track you using all available means, including, but not limited to: satellite, your mobile phone, secret service operatives, cookies, ice cream, fudge, radio-receivers implanted in your molars, and miniature remote-control insects. Depending on what we catch you doing we may use this information for blackmail or our own amusement at in-house video-nights. However, rest assured that we do not permanently store any of the gathered information.

Naturally, this is not the version that we are going forward with.

Thursday 24 July 2008

Some excellent OO programming tips (and discussion)

Some classy advice from munificent on a proggit thread:
  • Do not copy and paste. Move code around, but don't duplicate it. Disabling Ctrl-C on IDEs would improve the world's programming better than anything I can think of.
  • Decouple decouple decouple. Of all of the things you can do to improve code, reducing coupling will, by far, have the greatest impact at making your life better.
  • Don't store what you can calculate. The fewer member variables, the better. Avoid storing any redundant data unless you want to fix synchronization bugs forever.
  • Make classes immutable when possible. It's easiest to use something you can't break.
  • Don't get too excited about inheritance. If you aren't using polymorphism, you probably don't need to use inheritance.
  • Use all of the features of your language. Delegates (function pointers), static (i.e. non-member) functions, etc. are just as useful with OOP as within straight procedural.
  • If you have a hard time naming a class, it's poorly defined. That being said, don't let lack of a name stop you, you can always find and replace later. Likewise, rename classes if their purpose changes over time.
  • Never call anything "FooManager". Objects are supposed to manage themselves. Get rid of the manager and put the code in Foo.
  • Don't be afraid to make little classes. Making a class just to bundle a couple of function args is perfectly fine. A few months later you'll find you've all sorts of other usefulness to it.
  • Refactor constantly. Coding without refactoring is gardening without weeding and pruning. You can't just keep packing new plants into your yard.
There is some good further discussion and qualifications in the sub-comments.

Alan Kay's Reading List

Alan "Smalltalk" Kay gives a list of books for people interested in the ideas and philosophies that influenced Squeak. It looks like a good list for anyone interested in software invention.

I have read a smattering of the books and some other works by authors on the list, and they were generally outstanding. I will try to sample the remainder (over time).

Wednesday 23 July 2008

A witty remark

The other day I was standing in my bedroom, and went to take a step, only to find that I could not. My son, Jake, aged 4 1/2, was lying full length and prone on the floor with arms extended and both hands securely clamped around my left ankle. Andi looked on. This had happened before.

Jake ordered me to drag him along the floor: "Walk!", came the command from below.

"I refuse to walk anywhere while there's a manacle attached to my leg", I replied.

"That's not a manacle; that's a boy-acle!", said my beloved.

Tuesday 22 July 2008

Laws of Logins

Privacy issues aside, when it comes to logins, I want convenience.

When using a web-page that provides a service, I want it to:
  1. Allow me to try or taste the service without entering a username and password (or I won't it use it).
  2. Never supply username and password if the service is once only (or I won't use it).
  3. Allow me to login and use a nice administrative interface if it is a site that allows me to create content. For this, I not only accept having to supply login details; I want to be able to login.
Of course having to remember multiple logins for multiple sites (point 3) is a PITA. Can OpenID help with this?