Re: Did I write a good (efficient) program?





"Michael Mattias" <mmattias@xxxxxxxxxxxxxx> wrote in message
news:B2tIj.20982$xq2.2197@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
"Howard Brazee" <howard@xxxxxxxxxx> wrote in message
news:qbi4v3lh2qh46k37lsl1v3pg0f4jppaod8@xxxxxxxxxx
On Tue, 01 Apr 2008 12:44:49 GMT, "Michael Mattias"
<mmattias@xxxxxxxxxxxxxx> wrote:

1. Does it work?
2. Is it *relatively* efficient?
3. Is it maintainable?

You need a "yes" answer to all three questions to have well-written code.

Of course, the industry has changed considerably - which has changed
how we grade these.

I don't about "industry" but I have always weighed 'maintainability' very,
very heavily: When was the last time you saw a program which NEVER was
upgraded/enhanced/changed?

I have dozens of them :-)

They're called "components"...

Each of them represents encapsulated basic functionality that simply doesn't
change. They are building blocks, just like atoms or bricks; you don't
modify the structure of the atoms to make a different molecule; you just
combine different atoms differently (or add some new ones).

Components that access or maintain data are most likely to be "volatile".
That's why I use an n-tier approach to system architecture. Components in
the DB access layer are virtually "cannon fodder" and can be replaced or
extended very quickly. (In fact, I am currently evaluating tools that will
automatically generate these components whenever I change the DB
design...There are some staggering tools available...)

It was this that led me to consider interfaces very carefully. Most of the
time, if you change an interface (maybe add another parameter or parameter
value) it has a serious effect and requires regression testing. If you can
avoid changing the interface you can avoid much of this grief. As Object
Classes can be forced to generate automatic methods for accessing and
setting their internal properties, this means I can change parameters
without changing interfaces. This allows me the option to "activate"
existing functionality that was built in by "up front" design (part of a
GENERAL rather than SPECIFIC solution, or to add new behaviours by
overiding or extending existing methods in a new subclass. (This allows
"evolutionary" design rather than "up front" design.) I can use either or
both design approaches, and I never need regression testing.

(It would be VERY difficult to implement such an approach, WITHOUT using
Object technology...)

Only the control elements that invoke the new or modified functionality need
to be tested.

Pete.
--
"I used to write COBOL...now I can do anything."


.



Relevant Pages

  • [PATCH] Documentation cleanup: trivial misspelling, punctuation, and grammar corrections.
    ... Different DMA engines may support different number of domains. ... +- API for paravirt ops for abstracting functionality for VMM folks. ... Read/Write attribute file that controls memory scrubbing. ... + Further information can be found in the interfaces section below for ...
    (Linux-Kernel)
  • Re: Part 2; COM issues
    ... with the functionality of the object, you would have no visibility into ... > client code..and actually I do not believe that the infrastructure ... infrastructure were encapsulated in its own subsystem, ... interfaces. ...
    (comp.object)
  • Re: Changes to PM layer break userspace
    ... Which is why the functionality is still there. ... The breakage is that devices that are happy to suspend with enabled ... interfaces are equivalent in terms of support guarantee. ... it's clearly not a bug. ...
    (Linux-Kernel)
  • Re: reiser4 plugins
    ... >> Maintainability is like optimization. ... > back-end if free to implement whatever number of these interfaces. ... VFS layer so that files of arbitrary types could be created. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: How about a opinion from the pros?
    ... I like top-down design to plan the whole project without getting into lots of details. ... The key here is make the module interfaceas simple as possible which providing the necessary functionality. ... In either case, the interfaces to the functions are well defined, so that if something isn't working right, it is much easier to find the function that is not working properly. ... I don't develop GUIs, but I have read recommendations to make the GUI interface as thin as possible, with each selection basically calling an underlying logic function. ...
    (comp.programming)