Re: TRM - Morbidity has set in, or not?

From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Fri, 19 May 2006 18:21:55 GMT
Message-ID: <71obg.9881$A26.245080_at_ursa-nb00s0.nbnet.nb.ca>


Marshall wrote:

> Bob Badour wrote:
>

>>You will often hear people speak of "impedance mismatch". Many people
>>think the way to address that problem is to lower the data language to
>>the level of existing programming languages.

>
> This is one of the biggest annoyances in my professional life.
>
> Example:
>
> me: ... and we can get rid of this attribute, because we already
> have uniqueness from these attributes over here.
> them: oh, but our framework requires an integer primary key.
>
> Or whatever. "Our framework requires" some crap. Well, your
> framework sucks then. Why don't you ditch it and write some
> good code instead?

Marshall,

Don't hold back -- tell us what you really think! ;)

> Or they've layered the dbms under so much crap until it's
> like a babe in a burqa, and they can't even tell any more
> when they call this method or that method that it's doing
> network access, so they write code like
>
> fetch list of primary keys
> for each key {
> fetch that row
> update one attribute
> }
>
> ... and end up doing 10,000 jdbc calls when they could have
> done it in one.
>
> Not that I am bitter.

Use that as a competitive advantage. At the start of a Version 2 project, I inherited a piece of code from another developer. It used SQL for record-at-a-time access in deeply, deeply nested loops. As soon as I looked at it, I said to myself: "That might work with the test database with a couple dozen rows, but that will never fly in the real world."

The first thing I did was replace it with a single query using some joins and a (gasp) correlated subquery with (oh no!) the existential quantifier. Every backend used on the project managed to figure out how to evaluate it in O(N) compared to the O(N^3+) of the original.

Less than a week into it, my manager pulled me aside to ask while I did the new features for Version 2 if I could look into a performance problem they had with Version 1 in the field. He nearly fell out of his chair when I told him I had already seen the problem and fixed it. Received on Fri May 19 2006 - 20:21:55 CEST

Original text of this message