Small Moments in Software Philosophy
I've been using my tiny slice of computer time to write software lately, and haven't spared any cycles for writing articles. In lieu of that, here's a series of lost notes to accompany some of my recent twitter outburts.
Abstractions should be as high-level as possible, and no higher. #
Einstein of course said,
"Make everything as simple as possible, but no simpler."
... and that's a kind of programming mantra, as so often in our race to simplify we end up over-simplifying. (The famous 'Worse Is Better' philosophy could be phrased as an argument that sometimes you should actually sacrifice correctness for the sake of the simplicity -- i.e. 'Einstein was wrong.')
In a similar vein, I think there there is such a thing as 'too abstract'. And it is a terrible thing.
Pre-emptive Abstraction is at least as bad as Premature Optimization #
- If your class name contains the word "Abstract" -- you're doing it wrong.
- If ClassName.Contains("FactoryFactory") -- you're doing it wrong.
- If Your ClassName Ends With "BaseBase" -- you're doing it wrong.
- If ClassName.Contains("Factory") && ClassName.Contains("Provider") -- you're doing it wrong.
Economists re-evaluate bird in hand as 1.9 times bird in bush.
#
A more appropriate tweet might've been:
'Economists write down bird in bush to 0.45 times bird in hand.'
Or:
'Government provides 8 trillion birds-in-hand to replace 16 trillion birds lost in bush.'
Someone (I think that cockroach poet Archy) once called humanity something like "a strange species of bipeds who cannot run fast enough to collect the money which they owe themselves."
i am *not* homophobic. Infact, some of my best friends have iPhones.
#
And I'm still waiting to see them make the millions of dollars from iPhone apps that they promised themselves last year.
If a job's not worth doing, it's not worth doing properly
#
The original statement: "If a job's worth doing, it's worth doing properly" has the corollary that any job that is not worth doing properly is therefore not worth doing at all.
This is patently absurb and a kind of shining example of why perfectionism doesn't pay.
The slightly twisted variation:
If a job's not worth doing, it's not worth doing properly
...may seem defeatist and sloppy -- but i think it's the very soul of true productivity.
That's what no one seems to appreciate about being rich: the first 100 bazillion is the hardest.
#
After that, you can just sit back and live off the interest of the interest.
And your next code editor is... a browser.
#
I still think it's true -- and once i get a bunch of other things out of my todo pile -- i'm going to make it happen. Maybe.
Meanwhile I'm working on TimeSnapper v.Next, and tinkering on something tentatively called MetaNote -- about which you'll be hearing more.
'Goran' on Wed, 08 Apr 2009 10:22:31 GMT, sez: Web ide is actually in the works at mozilla labs (https://bespin.mozilla.com/).
What's the best way to contribute to MetaNote?
'Mike Woodhouse' on Wed, 08 Apr 2009 10:40:28 GMT, sez: "it's not worth doing properly"
The degree to which we should not do it properly should be proportionate to the degree to which is wasn't worth doing. No more and no less not properly. It's a sort of special case of the first point. Probably.
'Mike Woodhouse' on Wed, 08 Apr 2009 10:41:55 GMT, sez: And there should be something about how you always notice the typo in a comment the instant it's unrecallably on the page and not a moment sonner.
'Mike Woodhouse' on Wed, 08 Apr 2009 10:42:17 GMT, sez: Damit.
'Goran' on Wed, 08 Apr 2009 10:49:17 GMT, sez: Hate to tell you but there's a type in your url link as well...
'Goran' on Wed, 08 Apr 2009 10:49:51 GMT, sez: ...typo...
'lb' on Wed, 08 Apr 2009 11:04:00 GMT, sez: @Mike, @Goran
I *was* going to go back and correct typos on Mike's behalf (I do that sort of thing at times) -- but Goran's typo was too funny, so now i have to leave it all there ;-)
'DamianM' on Wed, 08 Apr 2009 12:08:48 GMT, sez: Pre-Emptive abstraction...gawd don't I know about this one.
Looking at a codebase at the moment with IFacadeManagers scattered around the place.
What they really need is an IFacadeManagerFactory if they want to be REALLY protected from change.
'Mike Woodhouse' on Thu, 09 Apr 2009 12:06:42 GMT, sez: D'oh! (as my intranet 404 page would say). My flying fingers flew into another brick wall.
Pause for careful checking. Looks good, go for a sumti
'Judah Himango' on Thu, 09 Apr 2009 16:19:37 GMT, sez: I'm on board with "your next code editor is a browser". If you start a project for this, dear secret geek, let us know, I'd love to contribute some spare time help to the project.
'Ev' on Mon, 13 Apr 2009 21:22:14 GMT, sez: "patently absurb" is my answer to any perfectionist meatbag
PS. love your stuff :)
'Steven Nagy' on Tue, 14 Apr 2009 10:32:42 GMT, sez: Hi Mr Bambrick,
I stumbled upon your article; I only got as far as the third line (as usual) and was unable to read on, so distressed was I. For you see, you have identified a reality within which I currently dwell and your words stuck home with an inconceivable clarity.
I've been searching for abstractions in my current application acquaintance but was failing miserably. In such situations I normally blame my own inadequacies and inabilities; surely all good applications have abstractions! However I was pleasantly surprised when I discovered that those abstractions had simply been abstracted from view by an abstraction factory (actually it was IAbstractionFactory - the actual abstraction factory was itself abstracted). Naturally all this was wrapped in an Inversion of Abstraction container and you could only access it via the Model-View-Abstraction pattern.
I discovered it accidentally when I tried to inject my abstractions instead of using the abstraction-adapter. That was my folly! Anyway long story short, the abstraction-repository provided all the abstractions I needed to persist my Abstraction-ViewModel somewhere (I'm not sure where, which was how I knew it was correct!).
Anyway, I think this tweet has reached 140 chars so I better sign off.
- ISnagyProvider
'Paul Kohler' on Fri, 05 Jun 2009 00:38:17 GMT, sez: You mean that my new "AbstractInt32FactoryProviderStrategy" class is over the top?!
Another quote:
"Make all your classes small - but not too small, or it will look like you are not working hard enough."
[by... me... just then.]
Love your work Leon.
PK :-)
'Facebook Developers' on Tue, 16 Jun 2009 05:46:37 GMT, sez: ohhh man its freaking awesome. Thanks man
'Albert' on Tue, 07 Jul 2009 17:01:17 GMT, sez: This is really interesting. I hope things work out well. :)
<a href="http://www.mooladays.com">Ways to Make Money Online</a>
|