Object Oriented Programming with D Language. Private access specifier.

Jesse Phillips jessekphillips at gmail.com
Thu Aug 21 18:23:13 PDT 2008


On Thu, 21 Aug 2008 18:47:39 +0300, Max Samukha wrote:

> On Thu, 21 Aug 2008 14:08:04 +0000 (UTC), Jesse Phillips
> <jessekphillips at gmail.com> wrote:
> 
> 
>>An unnecessarily complex/bad design forced by Java? Easy Hello World.
>>
>>public static void main(String[] args) {
>>     System.out.println("Hello World");
>>}
>>
>>
>>My main class is within an object, which is required to be static.
>> That is just horrible. In general the class that includes main is a bad
>> place
>>to put anything, it is usually a run method or something that does a
>>bunch of work. The problem is that it is forcing a procedural
>>function(s) into the OOP world.
> 
> This has nothing to do with design but rather syntax.
> 
> Please, don't put forward this very argument. I may argue that D's
> modules are essentially limited final classes with only static members.
> Or static classes. Or singleton objects. Even D spec says "Modules
> superficially resemble classes".

Ok you got me, but you have to admit that if you designed something 
procedurally in Java you would be accused of poor design even if done 
correctly.



More information about the Digitalmars-d mailing list