Object Oriented Programming with D Language. Private access specifier.
Max Samukha
samukha at voliacable.com.removethis
Thu Aug 21 08:47:39 PDT 2008
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".
More information about the Digitalmars-d
mailing list