POV-Ray : Newsgroups : povray.general : Warn About Naming Conflicts? : Re: Warn About Naming Conflicts? Server Time
31 Jul 2024 22:20:34 EDT (-0400)
  Re: Warn About Naming Conflicts?  
From: nemesis
Date: 7 Dec 2006 08:10:01
Message: <web.457812493c56775f2ff13290@news.povray.org>
Florian Brucker <tor### [at] torfboldcom> wrote:
> There *are* situations when using a macro is not the best solution. I
> regularly have include files which depend on a *lot* (i.e. 50+)
> parameters - you don't want to pass all these everytime you call a
> macro.

good point.  It is indeed much cleaner than calling a 50+ parameters macro.

OTOH, is there real need for a single file with 50+ parameters?  Must the
user actually set all of those any time they call the include?

If they are needed, then it's not much better than a 50+ parameter macro
call, except parameters are named.

If most are not needed to be set at any one time, i guess your include file
is lacking functional cohesion, that is, it could probably be better
decoupled into several highly cohesive smaller include files with far less
parameters each and which are logically connected by subject.  If such, you
could consider instead just a single include file with several separate
macros with their own parameters.

Anyway, given what Warp just slipped, it doesn't matter much anyway.  But
i'd still go for macros, since the interface can remain the same once we
get a truly good macro implementation for the 4.0 rewrite...


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.