blueparty said:
When pressed by deadlines, choose the solution that is easiest to
implement even if it is not optimal. CS people would, most likely,
advise against such solution.
Later, when you have more time, consult CS people and replace the solution.
Your application will probably have couple of revisions during its lifetime.
A great theoretical approach that rarely, if ever, works in workaday
programming. I have been promised many times the opportunity to refactor
software, then been forbidden to do so based on variants of, "If it ain't
broke, don't fix it."
I have learned that I must do it right the first time, because management
rarely permits, and then not willingly, the opportunity to improve it.
I have also learned that it's no slower, and usually faster, to create an
optimal solution up front.
Agile shops are sort of an exception to this, but I have not had the privilege
of working in those environments.
In my career, when I have refactored I've had to do it surreptitiously, and
put up with getting in trouble for it. The only exception was a team that was
ignored by management for six months, and therefore was able to redesign the
architecture on its own. The result was a 200-fold (not 200%, 200-fold)
increase in productivity for adding features to the product, and a change from
unreliable results to completely reliable results.
Incidentally, this is in line with the theory of software project management,
as described in several books I've read on the subject. The strangest thing
about this to me is that both the theory of software development and of
software project management supports behaviors that managers I've worked with
will not usually trust. Theories like keep an effective team together even
during periods of inactivity, or the tenets of agile programming. Despite the
anti-academic prejudice expressed at times in this thread, the theories are
actually more pragmatically useful than many of the practices of less
theoretically-inclined practitioners.