Import concerns revisited

Derek Parnell derek at psych.ward
Wed Jul 12 05:32:25 PDT 2006


On Wed, 12 Jul 2006 19:25:57 +1000, Walter Bright  
<newshound at digitalmars.com> wrote:

> Lars Ivar Igesund wrote:
>> Walter Bright wrote:
>>
>>> Lars Ivar Igesund wrote:
>>>> Well, who did ever say that was a good idea, everything public by
>>>> default? ;)
>>> I did <g>.
>>  Right :) I don't agree.
>
> Let me explain why I think default public is a good idea.
>
> It reduces clutter in sample, example, and quick programs. Access  
> security is an advanced feature, one that's invaluable for a complex  
> project, but is just in the way for smaller ones.
>
> I don't mind at all when crafting a carefully designed, reusable module  
> that 'private' needs to be explicit. It helps document the intention,  
> and lends the impression that the designer did put some thought into the  
> code.
>
> But when writing illustrative sample code, I feel that having to add in  
> 'public's is distracting from the point (unless, of course, the point is  
> about how access control works!). I see this a lot in sample C++ code,  
> and it is distracting, to me anyway.
>
> And it's just plain irritating when writing smaller programs where  
> access control is quite irrelevant.

Oh for Bob's sake ... you mean the primary purpose of D is to write sample  
programs and examples? How did I miss that!!?? I thought it was to be a  
real language to write commercial applications with rather than an  
educational tool/toy. Sorry I misunderstood.


-- 
Derek Parnell
Melbourne, Australia



More information about the Digitalmars-d mailing list