A Perspective on D from game industry

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 18 00:12:11 PDT 2014


On Wednesday, 18 June 2014 at 07:00:44 UTC, c0de517e wrote:
>> It is absolutely necessary to move to higher levels of 
>> abstraction in order to handle the increasing complexity of 
>> modern programs.
>
> And this is 100% right, but people should be educated about 
> "premature abstraction". Have you seen the horrors of 
> "generalization"?
>

I call them architecture astronautes. To avoid that pitfall, I 
have a adopted the following method :
  - Do whatever you need to to get to the next step toward you 
goal.
  - Make a pause and observe. Is there some repeated patterns ? Is 
there some part of the code that is growing in complexity ? Do 
part of the code rely on fragile hacks ? Is part of the code 
doing useless work ? etc...
  - If yes, refactor accordingly, either by adding new level of 
abstraction, but better, by changing the interface of some 
abstraction to better fit its actual usage (and not the you were 
thinking you'd get at first).

This allowed me to avoid creating useless abstraction, and push 
me to refine existing ones.

> Especially C++ neophytes get so excited by pointless 
> generalization, then some grow out of it (studying other 
> languages also helps) but some never do.
>

I used to be like that :D


More information about the Digitalmars-d mailing list