[geos-devel] re:GEOS

Artem Pavlenko artem at pavlenko.uklinux.net
Sat Mar 12 10:05:39 EST 2005


Hi Mark

>
>I'm not that familiar with Java, so I'm curious to know of the
>Java-isms you see.
>  
>
It is "Prefer initialization to assignment in constructors":-).

>And, yes, the changes that occurred in CVS are an improvement.  Let me
>guess what you suggest should happen:
>
>
>LineIntersector::LineIntersector()
> : precisionModel(0),
>   result(0),
>   pa(intPt[0]), pb(intPt[1]),
>{
>	// alias the intersection points for ease of reference
>	//pa=intPt[0];
>	//pb=intPt[1];
>}
>  
>
It is better, but I didn't see intPt being initialized :-(. And I'm very 
uneasy about pa and pb being a non-const reference.

>That is, as Meyers suggests in _Effective C++_, 
>
Those are very good books if a little outdated.  Try "C++ In-Depth 
series" and "C++ Templates".

>"Prefer initialization
>to assignment in constructors."  He also counsels against using C's
>NEW macro. (For that matter, he strongly urges use of consts over
>macros in C++.)
>
>  
>
Yes!

>I'm concerned about the members pa and pb since they appear to be for
>syntactic sugar.  Are they really necessary?  And what's up with the
>data members in the protected section?  Doesn't that break
>encapsulation?
>  
>
Yes!

>Also, it's generally good practice to have one class per header
>instead of consolidating them into the same lexical space.  Doing so
>will likely trigger unnecessary extra recompiling.  "geosAlgorithm.h"
>has 26 class declarations -- changing the interface for one will cause
>recompilation for ALL external classes dependent on ANY of the classes
>found in that header file.
>
>  
>
Yes! Yes! Yes!


Cheers!
Artem





More information about the geos-devel mailing list