Afficher un message
Vieux 29/06/2008, 18h00   #11
Erik Wikström
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Designing lower level classes.

On 2008-06-29 17:45, Stefan Ram wrote:
> Gunter Schelfhout <no.mail@please.com.invalid> writes:
>>Ok, since I am still in the design phase, it's probably better to keep
>>things separated as much as I can.

>
> It is not even required to keep it separated right from the
> start.
>
> You also can have some »dirty« code parts in the first version
> where data processing and UI interface code is mixed and
> refactor it later to get the separation. Not everyone is so
> perfect that he can write it all separated from the start.
>
> Between sessions of coding to extend the set of features,
> there always should be sessions to improve the quality of the
> code without adding new features. Nobody can write everything
> in the best possible way the first time. But one will
> eventually not be able to maintain the code anymore if one
> never refactors it to improve separation of responsibilities.


I disagree, for the same reason. Nobody is perfect and once things work
it is all to easy to not refactor the code just to get a better design.
Write code with good separation from the beginning and then refactor the
interfaces between modules if needed. Also, this way you will keep the
"dirty" pieces of code well contained from other modules and you can
focus on one module at a time.

While I do agree that you should stop developing every once in a while
and take some time to clean up the code it might not always be possible
(while it is short-sighted many companies do not care about refactoring
until they absolutely have to). I believe in trying to get as good
design as possible from the beginning, since it (usually) keeps down the
decay-rate of the code. Of course, if you have good processes then it is
less of a problem.

--
Erik Wikström
  Réponse avec citation
 
Page generated in 0,05811 seconds with 9 queries