[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: Organizing HA program rules/logic/code



In the software world, where we deal with this sort of thing all the time,
one thing at least that has become pretty universally accepted is that
object oriented languages are optimal for managing complexity. A large
system is a large system, and it'll remain complex, so it's just a matter of
what helps manage that complexity the best.

That's why we incorporated an object oriented macro language. It's just far
and away the best way to deal with these issues, by creating reusable and
extensible chunks of code. In particular, it lets us create 'object
frameworks' where the major logic to do something is implemented by us, and
it only requires extension to apply that logic to a particular set of
circumstances. This sort of framework concept is used VERY widely in the
software world.

Of course, the gotcha is that it's often beyond the non-technical to really
fully grok in a lot of cases. For someone who cannot handle a programming
language, I don't think that it will ever be possible to truely manage the
complexity of a large body of logic. Visual tools are great, but when the
system gets larger, and the 'view port' into that system remains the same
size, it's like trying to build a car looking through a small hole that only
shows a small part of it at once.

Anyway, I guess my answer is that there's no real answer, particualrly no
answer that fits all. A strict object oriented language, in the hands of
someone who has the software skills to wield it, is clearly capable of doing
the trick, since that is how the huge applications we all use are written.
CQC is of that sort. It's around 700,000 lines of code now, and without
object orientation that would be joke for me to even try to do. The
complexity would overwhelm me.

I guess a visual tool, if sufficiently well done, on a sufficiently large
and high res screen, could work. But I just find that they are more of a
hinderance because they so limit your view. But whatever the tool,
techniques are just as important, and creating a system of reusable chunks
of code, each one well understandable in and of itself, and being very
self-protecting of itself, is the best way to deal with complexity. And
assembling those chunks into larger chunks that do the same, just writ
larger. It's the proven means by which enormous chunks of logic are built in
the software world.

-------------------------------------
Dean Roddey
Chairman/CTO, Charmed Quark Systems
www.charmedquark.com

<MFHult@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:aub7a1tp7un3cutgfh2872e7euua34k0vk@xxxxxxxxxx
>A major reason why home automation systems that approach useful levels
> of complexity fail to thrive is that with increasing complexity of
> rules (IF/THEN?ELSE or other logic), the system becomes too complex
> for all but -- or even -- the original programmer to understand.
> (Remember spaghetti code ?)
>
> And as a HA system grows beyond a few lights and gizmos and begins to
> involve usefully complex rules and logic, the likelihood that
> programming errors will be embedded increases towards certainty.
>




comp.home.automation Main Index | comp.home.automation Thread Index | comp.home.automation Home | Archives Home