Hi Phlip,
There are those who think planning designs causes bugs, and lowers
maintainability.
I would disagree with that general statement. I am generally opposed
to teams or individuals that design way too much in advance, whithout
a clear idea of where the project is going to go.
If done well, a forethinking design can be a good plan for growth.
When done poorly, the implemented design may not actually match the
problem and have to be reworked or worked around later.
I think it all comes down to your (you, team, company) ability to
design up front. You may be good at working out much of the design
in advance or taking it in more reasonable steps and refactoring
along the way. Its best to know your abilities and limits and
work productively.
So, how much time do you spend debugging? And how well have modules written
like this been re-used and maintained over time?
In the sense of debugging after the fact (as in post release) next to
none. Its been years since I've had a problem. Now, that doesn't mean
my code is absolutely perfect, or even all mine. I've inherited many
projects and written many of my own. Over time, the frailties of those
code bases have been improved to be more reliable.
I have adopted many ideas that go into developing an idea. Its well
thought out in advance, months if possible. Those designs don't usually
differ much from my initial ten minute impression of the project. It
does give me time to plan all the work and fill in the holes as to what
will be needed in terms of code, skills, and so on. I wil not write
any code that has not been tested by myself to its abilities. So, if
I write 100 lines today (I prefer the term concepts, FPs, or stories)
they must all be tested and approved. If they can fail, and most code
can, I absolutely must be able to debug the problem at a distance.
That is, the customer calls in to customer support with a vague description,
and I must be able to diagnose and fix the problem very quickly. I
generally do this by using extensive logs lying around. You must be
able to be able to trace back what has happened and where the failure
was. My first teachers insisted on writing code that worked within
three tries. In today's terms, that means when I start coding, I
have about three times for the entire [compile, run, validate, verify]
process to work. Most of my stuff is based on the usual C++ GUI
code on Windows these days. I also do a fair amount of embedded
work. It doesn't need to be this reliable, I just find it much better
to work this way. In a sense, I've been using most of what you'd
call agile, XP, and a few dozen models, for years.
As for reuse, I prefer to reuse as much as possible. A message
composer is likely to be used in several places -- an embedded project,
in a critical path (say a service), or in an application (GUI).
Look at my past posts and see what I've asked for help with. Its
mostly finding the proper way to accomplish a task which then becomes
(a class, template, or model) for doing that task well in the future.
If there was a problem later, I can point to all the code where the
mistake was made, what it might affect, and how to go about correcting
the problem.
I'd like to say more, but I have to get to work. I can't
summarize my 28 years of aquiring good techniques based on
the writings, teachings, and so on of other peoples work in
just a few lines of a post. We all need to understand there
are many ways to perform our daily tasks and seek to improve
them.
Take care,
David