2018/12/16

Why Merging Software Products is Harder Than Expected

Recently a friend of mine told the story of in a small company that was acquired by a larger company with a competing product. The idea being "to take the best parts of both products" and make something better. Ten years later, that had not happened, and in fact technical issues plus tensions between the two product teams, pretty much ensured it never would.

At one of my previous companies, something similar unfolded. The company had two tiers of products for the same market. One was high-end and very expensive, the other was the lower-cost alternative. Both were very mature products and as you might expect, over time functionality converged a bit, as the high-end product extended into features suitable for smaller customers, while the low-end product expanded its offering. Each product had its own strengths and weaknesses.

Management noticed that and said, "hey, these two products do a lot of the same things, why not combine them and get the best of both worlds?" They filled a chart board with post-its showing the commonalities between the products. Each post-it contained words like "generates reports", and "computes portfolio balances". Never mind that each post-it encapsulated big piles of bespoke code that had only ever talked to post-its within the same product.

 This is a bit like some big manufacturer saying,"we build trains, and we build buses, and they both do similar things -- moving people and stuff around. The great thing about a bus is that it can go anywhere there is a street. Trains can only go where the tracks have been laid, but they have a much greater capacity, better energy efficiency, and can be customized out of modular components. What if we take the best of a bus and the best of a train, and put them together? We change out the wheels and we have a tra-bus that can go anywhere! And the bus windows are much nicer, they're bigger and people can open them. Let's put those on."

And so it goes, until you have an incredibly ugly train-like thing built on a bus frame, that isn't street legal, that can't use existing modules (railcars) and now it needs more engines and better brakes, and so on.

As incredibly bad as this idea is in (vehicular) hardware, it's even worse in software; with these bu-train monstrosities, the problems of connecting the disparate parts are physical and easy to visualize.
In software, its too easy to lose sight of how parts fit together, and the possibilities are unbounded (blocking API, async API, restful API, redirected I/O, mapped memory, named pipes, sockets, protocols built on sockets, databases, data files, etc). Also, the parts can be written in entirely different languages that have trouble talking to each other. It doesn't even have to be different languages to be hard. Combining C++ written for Windows with C++ written for any other operating system can be insanely difficult. The challenges of integrating software products are enormous, and easy to grossly underestimate if you just break the product down into a bunch of functional boxes scribbled on post-its and say "hey, most of these boxes do the same thing!" If you see management doing something like that, its either time to speak up, or time to update your LinkedIn profile.

Inverting the emulation stack as a thought exercise

The very first processor I worked on as a software professional was the Motorola 6800, an 8-bit processor that could access 64K of RAM with a clock rate of 1-Mhz. The machines I worked on had less memory, and everything was done in assembly (of course).

Today I'm working on a Windows machine with a 64-bit, 4 core processor clocking 2.8 Ghz, and accessing... well, its Moore's Law in action.

Would it be possible to write a AMD64 emulator on the 6800? I don't think it can be done within the RAM of the processor. Given the complexity of a modern core, more code may be needed to emulate the instruction set than will fit in 64K. Restricting the code to a subset (off-boarding floating point, for example) might help it squeak by, and we would not implement many internal features such as instruction reordering or prefetch.

So.. if it takes a couple hundred 6800 instructions to emulate one x64 instruction (on average) and the 6800 runs at 2 MHz, and emulation doesn't require any I/O to a file system, then the emulated x64 would be executing about 5K x64 instructions a second, or "only" a 400K to 1 slowdown.

2018/10/15

Science vs Economics

An important aspect of good computer science is understanding the root causes for bad behavior in a system. Without a deep understanding, hacking around the problem often leads to bigger problems down the road. The original problem was not addressed, and the workaround can easily introduce unintended side effects or new errors.

 Similar rigor is true for hard sciences like biology, chemistry, and physics. Einstein's famous theorems could be seen as an evaluation of the root causes for physical phenomena that didn't agree with classical physics.

This doesn't happen with economics. Case in point: economists point to the start of the Great Recession to 2008, when the acceleration in mortgage failures could no longer be ignored. However, the root causes for those failures can be traced much further back, like the repeal of Glass-Stiegal in the 1990s, Greenspun's lackadaisical and obfuscatory management of the Fed, the lack of regulation of the mortgage industry that followed, corruption across the board in the finance industruy, including regulators, the de-fanging of the STC and so on.

The failure to dig into root causes is one of the things that constrains the utility of economics (pun intended). Another is its dependence on the notion of people as rational actors, but at least this problem is being addressed to some degree by the field of behavioral economics. But perhaps this is optimistic.

Illustrating this blindness to root causes is an interview of Neel Kashkari, where he says he bought a house in California in 2005, and "didn't see it coming." I found this stunning. I was shopping for a home in California in 2005, and everything was screaming "this is insanity!" Ads on the radio for insane loan offers, home prices outstripping every other economic indicator,  a dentist I met who was doing interest-only loans and laddering up into ever-more expensive zipcodes, and who thought he was a genius. It. Was. Nuts. The writing was on the wall, in wall-tall letters.

The best part, the truly best part is that guys like Kashkari take credit for turning things around, but did they really do anything to improve the odds of against future financial disasters? Like, some perp walks for the greedheads who almost destroyed the world's economy? Or a serious restructuring of the financial industry to counter the centralization of wealth and power? Ironic scornful laughter ensues.

2017/01/10

Breaking Out

Maybe I should write a Chrome plugin that deliberately makes the browsing experience so painful, you'll want to do just about anything else.

Advanced feature: Whitelist certain sites and certain hours (would still like to get work done). But this should be difficult to do, with prompts that keep asking "do you really want to do this?" and "Are you sure this isn't a site that's a mind-numbing time suck that's trying to hoover all your private data?"

2016/12/24

Car talk

Scene: a couple is conversing at an outdoor table for a restaurant. A large SUV starts up a couple feet away. Conversation continues for a while. The SUV doesn't move, its engine still running.

The couple have to raise their voices, then begin to complain about the SUV and its driver. It should be illegal to just sit there and let the engine idle, especially near people trying to eat. They speculate about what the driver could be doing that's so important.

CUT to the SUV interior. Looking forward over the driver's shoulder. The dining couple is framed in the windshield. The driver is watching a youtube video on his phone about how to back back his SUV out of a parking space.

The video is in the middle of a checklist of what to do: check side mirrors and rear view mirror for obstructions. Check left and righ for oncoming traffic. Put car in reverse. If you have a manual transmission, see this other video.

Driver can't keep up with instructions, especially confused by the manual transmission bit. Rewinds the video, gets a commercial for the SUV.

CUT to the diners. I could ask him to move. No don't do that, people who drive cars like that always carry guns. We could move to another table. Maybe he'll leave soon.

CUT to SUV. Commercial has ended, the checklist has begun again. Start the engine. Driver complies, and gets a horrible grinding noise, since the engine is already running. Driver winces, couple winces, mutter not-nice things.

CUT do diners. He's got to leave soon. You think so, I mean its like he doesn't know how to drive or something.

CUT to SUV: driver rapidly spins head around as he gets through the "check mirrors" part of the video, at the manual transmission part, he pauses the video and thinks for a moment. He presses a couple buttons and says "Okay google, how do I tell if I have manual transmission?"

Eventually the SUV lurches away.

============================

Robot cars an end to vehicular crimes?

Bank robber with a gun and a bundle of loot jumps into his robot car, yells go go go! "Where to?" Anywhere. North! Go north!" The car activates its turn signal and smoothly, slowly pulls into traffic.

"Faster!"

"We have reached the speed limit, sir!" says the car, in an annoyingly perky voice. Sirens grow in the background.

"Turn left up here!"

"I can't do that,  left turns are not permitted at this intersection."

"Then go faster!"

"We have reached the maximum speed limit. A faster speed will require emergency authorization."

"This is an emergency, go faster!"

"Yes sir. Increasing speed. I have also notified the authorities that we have an emergency, and am sending them our location and projected route."

2014/05/23

The Run

This year's JP Morgan Corporate Challenge was the best yet. Note to self, travel with the George Positioning System every chance you get. He knows where it's at, indeed where everything is at in the Bay Area. He worked as a tour guide.

It was the coldest race I've ever attended. Fog was low over the Golden Gate Bridge, and a chill wind whipped across Chrissy Field. Runners were huddled on the leeward side of the few structures on the field, like sheep hiding behind hedges.

We shuddered and hopped around and made jokes about the people handing out the free iced coffee and free iced fruit drinks. Yeah, right. Someone passing out hot apple cider would have needed a riot squad for protection.

Finally, we were told that the race was about to start. We lined up and faceless amplified voices boomed out warmup instructions. Then there were speeches and more speeches, and some reporter also talked, but I don't watch TV, so I didn't recognize her voice. It would have been nice if they'd changed the order and did the speeches first, then the warmup, because we were cooling down but at least massed together, penguin-runners on the ice floe.

Then we were off! Okay, the front of the pack was off. A minute or so later my part of the flock began to shuffle forward in the way harried commuters shuffle into crowded trains, elbows in, careful steps, trying not to bump each other. Eight thousand feet trying to find room to run.

I ran for a while and didn't see anyone I recognized until I saw Danette just ahead. "Ah," I said, "If I can keep pace with her, that will get me through the race with a reasonable time."

So I ran and ran, and I wondered about the people on their cell phones while they were running this race. What's with that? "Hello? Oh hi... Nothing much, just running a race. Sure I'll pick up some takeout on the way home. Watchu uptwo?"

Then I paused in my wondering and noticed that I couldn't see Danette anywhere. I was pretty sure I hadn't passed her.

Oh well, the die is cast, we must struggle valiantly on. It's been a while now, and I began to wonder how much further we had to go. And then I saw Robin up ahead. I figured, "Aha, I'll keep pace with her and get a not-so-pathetic time." But again, while bemusedly wondering about the carbon consumption involved in getting all these people in one place at one time to run around in a big -- well, it's not a circle really, more like a beat-up triangle -- I lost track of Robin and I was very sure I'd not passed her.

This was getting embarrassing. Almost as embarrassing as my stupid idea of hiring my son to be a trainer in preparing for this race. The idea was that he'd run with me as training. Well, he has his own training regimen, it's called "oversleeping". By staying in bed as long as possible, plus three to five minutes, he has to get to school in a hurry. Normally this would mean walking, but since he uses "oversleeping" as his training regimen, he has to run the entire way. With his backpack.

So now he's a much better runner than his old man, and he has the patience of youth, which is to say "none". Our training sessions amount to: we start out running. He gains a Gignormous Lead. I meet him at the turnaround point, feet sore and winded and he's totally relaxed and razzing me.

That's when I notice Shant. Surely I can keep pace with Shant, I figure. So I run and run, and then I realize that I can't see Shant anymore either. Dang, maybe I should consider taking up his training regimen. What was that bar he mentioned the other day?

So I run and run, and I can see the finish line coming up, but it's looking awful quiet; people usually hang around at the end of the race but today I guess the extra cold and extra damp darkness is driving people home early, or so I hope. And just as I'm about to cross the finish line I notice that there's quite a racket behind me. I'm not alone!

I turn around and there a bunch of men are carrying the bright blue porta-potties away on these huge dollies coming up behind me. I'm thinking wow, that must take a lot of skill, to run this course with those porta-potties on dollies. What if it tipped over?

So I finished the race, barely beating out the guys with the blue porta-potties. Later I found out that something that cheered me up after what had been an otherwise rather depressing performance:

I beat Ignatius' time.

2012/08/06

IM conversation 01

...irrelevant stuff up here
That is mildly annoying, eh?!
35 PM Me
"Mildly" is an interesting way of putting it.
4:36 PM Him
Okay, hair pullingly, tooth gnashingly annoying.
4:37 PM Me
just-short-of-screaming-tantrum-in-someone's-cubicle annoying.
4:39 PM Him
Ah... I've only experienced one tantrum, but I was the object of the tantrum and not the tantror. (Would that make me the tantree?)  It was at another company and others around were astounded that this happened.  The tantror was known for this.
4:40 PM Me
I think the word is "tantrumator". Yeah, those people are pretty unpleasant to deal with, which is why I usually try to stop short of that.
The victim or target is the "tantraumatized"
4:41 PM Him
Ahha!  I like your term a lot!!!!