*grump* [entries|reading|network|archive]
simont

[ userinfo | dreamwidth userinfo ]
[ archive | journal archive ]

Thu 2007-09-06 17:42
*grump*
LinkReply
[identity profile] tackline.livejournal.comThu 2007-09-06 18:34

Well, not really. Let's take it one thing at a time:

This means that the program is divided rigidly into classes, even the parts that are entirely procedural in function;

If all the methods are static, the class is essentially just a namespace.

that there is a strict convention of one class to a source file

Java only enforces the limit of one class or interface that is both public and outer per source file. However, one outer class per file does make things easier.

even when this means separating fragments of code which are doing a semantically related job and would benefit from being near each other;

One would hope that in Java classes would be coherent. I found finding code in C++ a real pain. I switched to one class per source file pair/tripple before I touched Java.

in general, that classes and templates and namespaces and long multi-word names are used in a manner that suggests the author specifically wanted to avoid writing

do_foo(arg1, arg2);

if he could possibly instead write

FooDoingClass<inexplicableTemplateParameter>::getInstance()->
doFoo(RandomNamespace::arg, RandomOtherNamespace::arg2);

The Java coding convention says to only use a single word in package names. The template parameterisation there wouldn't make any sense in Java. "getInstance()" is a clear indication of non-OO code. Nothing to stop importing from a namespace in Java, although of course it can make it clearer to qualify.

only, for added annoyance, without the line break in the middle.

If only compilers rejected (hand written) source code with more than 80 characters in a line (or tabs).

Link Reply to this | Parent
navigation
[ go | Previous Entry | Next Entry ]
[ add | to Memories ]