Scope modules DIP rough messy draft.

Neia Neutuladh neia at ikeran.org
Sat Oct 27 04:54:30 UTC 2018


On Sat, 27 Oct 2018 04:13:40 +0000, 12345swordy wrote:
> On Saturday, 27 October 2018 at 02:07:56 UTC, luckoverthere wrote:
>> Why do "one time scripts" need this feature?
> To avoid writing multiple files.

Why do one-time scripts need extra tools to help maintainability? A one-
time script is not maintained by definition.

Is it that great a hardship to include multiple files when it's getting 
hard to maintain your project as a single file?

> It does not necessarily involve friend functions. If your c++ code rely
> on the class is a unit of encapsulation as part of your design, then
> switching to d breaks that design as the module itself is the unit of
> encapsulation. You have to refactor your code by putting each class in
> its own file.

If you wish to port a project from C++ to D, you should expect to have to 
refactor it after if you want a maintainable codebase. That's not 
surprising in the slightest.

>> If it is a simple small program, then why require private at all?
> That the design that the programmer decides on.

So the motivation for choosing this sort of design is...because you chose 
this sort of design? Like, you decided on a constraint that your entire 
program had to fit in one file, and you find it difficult to maintain your 
program as one file because the unit of encapsulation doesn't match your 
design, but you made a decision, and by Aten you're sticking with it.


More information about the Digitalmars-d mailing list