Re: Mixing OO and DB
Date: Thu, 6 Mar 2008 08:35:34 -0800 (PST)
Message-ID: <b94cadd7-4c09-43da-b04a-4fba1c527c24_at_s8g2000prg.googlegroups.com>
Robert Martin wrote:
> On 2008-03-05 01:16:34 -0600, topmind <topmind_at_technologist.com> said:
>
> >
> >
> > Robert Martin wrote:
> >>
> >> I think that this:
> >>
> >> // Calculate Pay
> >> Money pay = hours * rate;
> >> int overtime = max(0, hours-40);
> >> pay += overtime * overtimeRate;
> >> if (flags && 0x02 == 1)
> >> pay *= 1.02; // bump for union dues.
> >>
> >> is a lot hard to read than this:
> >>
> >> Money pay = calculatePay();
> >>
> >
> > No, because like a good newspaper you have the general idea after
> > reading the headline what's in the details. If you want to skip to the
> > next article you can.
>
> I don't even want to *see* the details here. I only want to see them
> lower down.
Why should I care what YOU want? I want can-can girls and free donuts.
> What I want to see is the *essence* of the current
> function, not all it's little fiddelty-bits.
>
> A newspaper article does not make you skip over the details, it hides
> them in a lower part of the article. Each paragraph stays at a
> consistent level of abstraction. As you read downwards the paragraphs
> descend in abstraction level.
> >>> The second often requires a lot of parameter maintenance
> >>
> >> No it doesn't because the second is inside an object where all the
> >> variables are fields. That's one of the benefits of having objects.
> >
> > That has nothing to do with "objects".
>
> So what? It's still true that all OO languages make this kind of thing
> simple. And it completely invalidates your point. You do not need lots
> of parameter maintenance if you are using objects.
>
> >> So you simply don't believe in partitioning code at all. You'd rather
> >> have one big monolith. Come now.
> >
> > No. I like a compromise.
>
> There's no compromise in a function that's 50 lines long and indented 4
> or 5 levels. A function like that *is* a monolith.
And yours is method dandruff.
>
> >> Dictated by a sense of discipline and professionalism. If we claim to
> >> be professionals, we need to show it by being _neat_.
>
> > Now you are going too far: it's a goddam PERSONAL PREFERENCE. Get off
> > your high horse!
>
> I suppose some doctors personally prefer to not wash their hands before
> surgery. Their preferences are overridden by their professionalism,
> and by the needs of their patients.
>
> Look, son, professional coding is not about personal preference. It is
> about your company, and your audience. Hobbyists write code based on
> their personal preferences. Professionals write code that many others
> can read and maintain.
How do you know how OTHERS read???? You are not them.
Don't shove your pseudoscience down my throat.
>
> --
> Robert C. Martin (Uncle Bob)��| email: unclebob_at_objectmentor.com
> Object Mentor Inc.� � � � � ��| blog:��www.butunclebob.com
-T- Received on Thu Mar 06 2008 - 17:35:34 CET