Archives: July 2009

Users, Accounts, Identities and Roles

A nice overview of the concepts behind user/account/identity/role modeling in applications.

I liked this quote in particular:

The tradeoff of creating more abstraction layers provides, as always, flexibility at the cost of complexity. Often times we resort to inferior workarounds because they seem simpler, when in truth they are just dumbing down the problem. KISS is not a synonym for “half assed”.

POST with multiple values per key

Dumb. And bad.

PHP requires that you change your HTML to indicate that an input value in a form expects multiple values. That means, your HTML needs to know what your server-side architecture is coded in.

Dumb. And bad.

Example:

 <input name="foo" value="123" />
 <input name="foo" value="456" />

That code above won’t work in a POST to a .php script because one of the values for ‘foo’ will be dropped. Instead, you have to code your html like:

 
 <input name="foo[]" value="123" />
 <input name="foo[]" value="456" />

with that extra little [] bracket pair. That’s just Wrong. And bad. My HTML shouldn’t care what the server side language is. HTTP is HTTP. HTML is HTML. It’s agnostic. Unless your scripting language is broken. Like PHP is.