Sane API design (AKA C's #ifdef hell)

geometrydashes geometrydashes11 at gmail.com
Wed Apr 22 15:04:56 UTC 2026


On Thursday, 16 April 2026 at 21:13:30 UTC, matheus wrote:
> On Thursday, 16 April 2026 at 18:52:23 UTC, H. S. Teoh wrote:
>> ...
>
> Interesting, another solution would be Separate Files + Build 
> System, but in this case we are moving the problem from source 
> to building/compiling time.
>
> I recently asked a question about a similar problem to this one 
> in Learn Forum, didn't get much traction.
>
> I think it's hard to define elegant way to do this.
>
> Matheus.

The D community debate between Matheus and H. S. Teoh highlights 
a fundamental tension between source code organization and 
compilation efficiency. While splitting large modules into 
smaller, separate files improves code readability, it effectively 
"moves the problem" to the build system, increasing the 
complexity of dependency tracking and potentially slowing down 
compile times. Ultimately, the discussion suggests that there is 
no perfectly elegant solution, leaving developers to choose 
between the maintenance burden of massive files or the overhead 
of managing a complex build infrastructure with tools like DUB or 
Reggae.
https://geometrydashes.com/


More information about the Digitalmars-d mailing list