Does this sort of code look familiar?
CSVReader r = new CSVReader( new BufferedReader( new
FileReader(
DISTRICT_TAX_FILE ), 8092 ),
',', '\"', "#", true, true, true, false );
You can add comments like this to make it more readable:
CSVReader r = new CSVReader( new BufferedReader( new
FileReader(
DISTRICT_TAX_FILE ), 8092 ),
',', '\"', "#", true /* hide comments */, true /*
trimQuoted */, true /* trimUnquoted */, false /* no multiline */ );
Buth there is nothing that says the commens are in sych with the
definition. Any signature changes will likely make the comments
invalid.
What you could your write you call something like this:
CSVReader r = new CSVReader( new BufferedReader( new
FileReader(
DISTRICT_TAX_FILE ), 8092 ),
',', '\"', "#", hideComments, trimQuoted
,trimUnquoted , noMultiline );
Imagine those as sort of miniature enums, on class per parameter.
Very few programmers would create enum classes for each of their
parameters just to get type checking. Further the bits and bytes guys
would roll their eyes at passing an enum constant when a primitive
boolean would do the job so much faster easier.
What if instead, inside the JVM all worked as before- passing
booleans. It in just that you could give names to true and false that
were valid only for that parameter.
E.
void doSomething( boolean( good, bad) evalulation, boolean ( male ,
female ) gender) { ... }
then you could write
doSomething ( bad , female );
but you could not say
do Something ( male, good );
You might extend this for lightweight enums that act the same as 0. 1
2 etc.
e.g.
doSomething ( int (kind, fun, sexy) what )
doSomething (sexy);
For very little weight it gives much of what you need Ada for.
--
Roedy Green Canadian Mind Products
http://mindprod.com
Capitalism has spurred the competition that makes CPUs faster and
faster each year, but the focus on money makes software manufacturers
do some peculiar things like deliberately leaving bugs and deficiencies
in the software so they can soak the customers for upgrades later.
Whether software is easy to use, or never loses data, when the company
has a near monopoly, is almost irrelevant to profits, and therefore
ignored. The manufacturer focuses on cheap gimicks like dancing paper
clips to dazzle naive first-time buyers. The needs of existing
experienced users are almost irrelevant. I see software rental as the
best remedy.