Profilo di BenNo Brain, No PainFotoBlogElenchiAltro ![]() | Guida |
|
19 gennaio Why you learn from failure, not successI was in a meeting a couple of days ago where we were dicsussing best practices for some corporate initiatives, and one approach that came up a couple of times was, "find out what Google does and do that." Makes sense, right? Google is so wildly successful on so many levels it's staggering--stock price is sky high, revenue and profits are outstanding, employee satisifaction is high, and their basic product (text search) is still notably superior to their competitors. Of course, me being me, I think blindly doing what Google does is probably the worst thing you can do. Not because of the standard, fluffy "copying can only bring us to their level, we need to exceed them" response, but for far more pragmatic reasons--here's the underlying thought:
Certainly Google is doing some things right to stay ahead of the competition. Personally, I think the main reasons behind their success are 1) a fundamentally superior ranking algorithm and 2) a workable advertising revenue model. But take something like their free food perk--is that contributing to their success? Or is it just a drain on profits? As long as the company is successful, you can't tell. Contrast that with some of my favorite internet meltdowns: Pets.com demonstrated how shipping costs will kill you when you're selling a relatively heavy, low cost product. Jasmin.com may be my all-time favorite, though; trying to sell a product (perfume) where the sole attribute (scent) can't be communicated over the internet. Yeah, that one didn't last long :-p I think this is really demonstrated when you get a company in transition, like Wal-Mart. For years they were the ones who were doing everything right and should be emulated. Now that sales growth has slowed, you can see them struggling to try to figure out what needs to be changed to get growth back on track. Personally, I see this as a sign that they don't really understand what was contributing to their success, and what was doing the opposite. So what's it all mean at the end of the day? View your failed projects as huge learning resources. Figure out the root cause(s) of the failure, and redesign your processes to eliminate the root cause in the first place. Ben 17 gennaio Keyboarding NirvanaJust got a couple of new keyboards for home, to replace an already-broken-and-not-very-good-in-the-first-place KeyTronic I bought a couple of months ago. I still astounded that someone is still making keyboards with actual, honest-to-God mechanical keyswitches instead of the ultra-cheap rubber switches. I can't say enough good things about this keyboard, the feel is fantastic--as good as any keyboard I can remember, and that includes the original PC keyboards (with the function keys at the far left) and the Northgate Omnikey keyboards from the late '89 or thereabouts.
The price isn't too bad, either, right around $70. Highly recommended.
Ben 11 gennaio A bit more on abstractionSo, this morning I started building the "Design Guidelines" document for the project I'm on. I'm sure it's no big surprise to people who are familiar with me that the underlining tone of the entire document is "keep things simple, consise, and easily readable." Not too long ago I ran into the "As simple as possible, but no simpler" quote attributed to Albert Einstein, which I like a lot and wanted to reference as the first line in the design guidelines document.
The one thing that bugged me about that quote, though, is that I have an underlying feeling that it's really not an Einstein quote--not that I don't think it's something he'd say, but rather because it's such a memorable quote, why does it seem to only have become popular in the last few years? I mean, it's a timeless quote so why wasn't I hearing it 20-30 years ago?
So, I did a Google search for the quote and lo and behold, I see a DevHawk blog entry on the first page of the search results. While the blog entry didn't get me any closer to determining if the quote was indeeed spoke by Einstein, it did have an interesting dicussion about complexity and abstraction. The thing that really got the gears turning in my head, was they started discussing assembly language in the post.
Here's the thing: I continually strive to drive the amount of abstraction done in code the the bare mininum. But, at the same time, I prefer using C# over C/C++ and assembler. Also, I fully recognize that C# is an abstraction of C/C++, just as C/C++ was an abstraction of assembler.
Ack! Am I contradicting myself? Why am I not pushing the team to use assembler, instead of C#? I mean, any other time someone introduces an abstraction into the design, I'll push back pretty hard in order to have them prove to me that the abstraction is worthwhile.
So I thought about this apparent paradox for a few minutes, whereupon I realized that it all come back to my passion for minimizing lines of code:
I don't think many would argue that you can do more with less code with C# as compared to C/C++, and likewise with assembler. But, as my recent example demonstrated, abstraction doesn't necessarily lead to a reduction of code.
I know most people consider lines of code to be a really crappy metric. Certainly I don't think it's perfect. But as time goes on my respect for it as a simple indicator of how much effort goes into developing software grows.
By the way, I never did determine if Einstein actually said that. ;)
Ben 09 gennaio R.I.P. OS/2I just noticed that basic support for OS/2 from IBM ended on Dec. 31, 2006. This brings back memories, since I was an OS/2 fan from the beginning--I remember asking the sales guy at Radio Shack if the computer I was about to buy (my first, a Tandy TX-1000) would support OS/2. The salesman lied and said it would :-p
Being a seriously broke college student at the time, I couldn't afford the first OS/2 versions when came out, but I had a real job by the time OS/2 2.0 appeared and I used that exclusively for a year or so before I gave up on it. At the time I liked it a lot, the Workplace Shell was a bit clunky, but overall I found it more pleasent to use than Windows 3.0/3.1.
A friend of mine bought the Borland C++ compiler for OS/2 when it came out, and I wrote a few very simple Presentation Manager programs. I do remember being pretty distraught that Borland's OWL framework for OS/2 was different than OWL for Windows--I mean, wasn't the whole purpose of an abstract windowing toolkit to allow you to run the same program on multiple windowing systems? Also, the default window coordinate system had the origin at the lower left hand corner of the window, instead of Window's origin of the upper left hand corner, which drove me nuts!
Ah, more good memories: getting a handle to an "anchor block". It was one of the first things you did in an OS/2 PM program, but it seemed you never actually did anything with it; whenever I interviewed someone who had worked at IBM, I'd always ask them what it was for. Mostly, they just gave me a strange look and told me they had never heard of it. What was it for? The greater development community may never know.
I always wondered why Windows took off while OS/2 faltered. At that time, I was certain it was because IBM was charging $3,000 for the OS/2 SDK (well, at least in the version 1.0/1.1 days)--I desparately wanted to develop OS/2 programs, but there was no possible way I could afford the SDK. On the flip, I remember creating some very, very basic progams for Windows 2.0 just using the Microsoft C compiler and the resource compiler--I couldn't afford the WYSIWYG tools, but I could create a dialog template in a text editor and run it through RC!
In the end I gave up on OS/2 when it became apparent that very few native OS/2 programs were going to come out, and it wasn't clear how OS/2 would be able to run 32-bit Windows programs. I often wonder how things might have gone differently, had IBM basically given away a C compiler and the OS/2 SDK for free and said, "here you go guys, start writing OS/2 PM programs!!!"
Oh well. In the end I think Microsoft did an exceptional job transitioning from DOS to Windows XP, even though it took a bit.
Ben 04 gennaio Thoughts on abstractionTime to get back on the software development soapbox :-p
If you haven't noticed yet, most of my opinions on how software should be developed go against the mainstream. This has proven to be a rough road for me, mainly because I'm not a very persuasive speaker so people tend to listen to me, ask me to "prove it", and then as I struggle to prove it, assume that I'm clueless. Honestly, a lot of the blogging I do is in order to build up the strength of my arguments so when I propose to someone that they should start axing the horizontal layers in their software, instead of saying "wow, you're dumb" they'll say, "I see your point, I hadn't looked at it that way before."
To me, that would be a massive win. A smaller (but still substatial) win for me would be if, after reading some of this stuff, it motivates you enough to step back and re-evaluate your software process in an empirical way, instead of the common "well this project sucked but it must be because we didn't do it exactly how the book told us to do it!"
Anyway, back to business.
I continually ask myself what is the root cause of why many OO-based projects don't go as well as anticipated. Certainly, it's not a simple answer, otherwise it would have been solved long ago and building software would be like making a peanut butter and jelly sandwich--you just crank out successful projects one after another, never even worrying that something may go wrong. Over the last couple of weeks I think I've hit on one of the core problems, though.
Many, if not all, of OO concepts are based on abstraction, e.g. "I have a 'car' object and a 'truck' object, so I'm going to create a 'vehicle' superclass that I can derive my car and truck from." I recognize abstraction as a hugely powerful tool but here's the critical mistake I think most people make: they underestimate the amount of complexity the each abstraction adds.
Of course, I'm sure someone's shaking their head and saying, "no, abstraction reduces complexity!". Certainly, that's how C++ was originally sold, as an easier way to model complex systems. Actually, that brings me to a little aside which I can't resist bringing up: I'm not sure how many people realize this, but C++ was invented in the early '80s to ease the implementation telephone switching systems. Well, a year or two back I had the opportunity to interview someone who actually built switching software at Lucent (spinoff of Bell Labs, where C++ originated) so the following conversation was inevitable:
For the record, I think the performance of C++ is excellent; it's just poor software design that has given C++ a bad performance rap, compared to C.
Back to abstraction and complexity: I think the reason abstraction adds complexity is because it spreads functionality across several classes, instead of having it all in one place. The problem with spreading functionality around is that now the developer has to understand where each bit of functionality is implemented, plus (and this is the huge part) how all the objects have to interact in order to implement high-level functionality.
Perhaps an example will illustrate this:
That's a pretty simple example, with interfaces and classes used to split responsibility: the ConsoleRenderer class is only responsible for displaying data on the console, the StringData class is an abstraction of data that can be rendered, but does not implement any rendering, and the RenderingAgent class is responsible for tying the two previous classes to display data. Each class is concise and easy to understand.
Whoops, but wait! There's a bug in that example, did you notice it already? If not, perhaps you'll see the bug in the next example:
Which example did you find the bug in first?
I find a pretty intriguing analogy comparing complexity brought on by abstraction with the engineering concept of degrees of freedom. When you add a degree of freedom to a system, the number of potential states the system can be in goes up by the square. For example, imagine a bar you can move to 10 different positions in the horizontal dimension. If you now allow the bar to also move to 10 different positions in the vertical dimension, the system will have 100 unique states, not 20.
I think the same holds true with abstraction in software--every time you add an abstraction class to abstract something, you square the overall complexity of the software.
Again, and I stress: I'm not against using abstraction, and I think it's a wonderfully powerful software tool. But. you need to be cognizant of its effect on the complexity of the software solution you're trying to create.
Ben 02 gennaio Happy New Year!I hope everyone has a safe and prosperous 2007!
The Sebring got reassembled on the Saturday just before Christmas, total time I spent on the car was about 12 hours of disassembly and 8 hours of reassembly. I wouldn't make a speedy mechanic :( Then again, it's been 12 years or so since I last did a timing belt so I'm a bit rusty. On the plus side, I spent under $300 on a job I'm sure would have cost $1000 at the local shop. So, it was like I was paying myself $35 an hour.
Overall I only ran into a couple of snags, probably the biggest being that when the manual says to torque the water pump mounting bolts to 17 ft/lbs, they mean only the mounting bolts--I stripped the threads back water pump housing. I was going to just drill it out and use a nut behind the housing, but I lucked out--only some of the threads were ruined, and I was able to get everything back together by just substituting a longer bolt for the original.
I also discovered that getting the cam timing correct is an O(n^2) process; doing a single cam motor isn't too hard, but it gets quite a bit worse with 2 cams on a "V" style engine. At first I had the forward cam timed with the crankshaft correctly, but the rear cam was off by a tooth. Then I had the front and rear cams correct, but I was off by a tooth on the crankshaft! Arrgh! I can't imagine doing a 4-cam car, that would take me a day in itself!
Let's see, other things I discovered: Tightening the crankshaft pulley bolt is a real pain on an automatic transmission car. On a manual, you just put the car in gear (engine not running, of course) and tighten down the bolt. With an automatic, there's no way (that I know of, at least) to lock the engine against the wheels, so you need something to hold the crank in place while you tighen the bolt. I fabricated a pulley holder out of 3/4" wood and some bolts, but I ended up breaking it--I hope the pulley bolt is tight enough! :-o
Here's another gripe--torque specs are always printed for "clean, dry threads." So what should I torque the spark plugs to if they're "10 year old threads with never-seize on them?" I should have taken the spark plug maker's advice and went 2/3rds of a turn after the washer made contact with the head... Instead I went to specified 18 ft/lbs, which was about 4/3rds of turn past contact. Nothing stripped, though.
Oh yeah, and I don't think you can beat Permatex Hylomar as a gasket dressing. I've been using it for 3 years now, and have never had any leak problems. Plus, it doesn't "set" like the silicone products do, so it's easy to take everything apart.
Ben |
|
|