Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Class.forName().newInstance() vs new

1,253 views
Skip to first unread message

Abu Yahya

unread,
Jun 11, 2011, 1:13:59 PM6/11/11
to
I have a class that instantiates a private member based on a value in a
configuration file.

The value is used to determine the class name.

I initially decided to use code similar to the following:


// class name comes from property file
String dbMgrClassName = props.getProperty("db.manager");
Class<?> k = Class.forName(dbMgrClassName);
db = (DB) k.newInstance();
db.init(props);

However, a colleague pointed out that using "new" is faster than using
"Class.forName().newInstance()". So, I changed the code to the following:

String dbMgrClassName = props.getProperty("db.manager");
if (dbMgrClassName.equals("DB2"))
db = new DB2();
else if (dbMgrClassName.equals("Oracle"))
db = new Oracle();
else if (dbMgrClassName.equals("SQLServer"))
db = new SQLServer();
else { // handle unrecognized
Class<?> k = Class.forName(dbMgrClassName);
db = (DB) k.newInstance();
}
db.init(props);

My question is: Does using if-else statements like the above really
improve performance? What is the best approach to instantiate classes
whose type you don't know at compile time?

David Lamb

unread,
Jun 11, 2011, 1:46:42 PM6/11/11
to
On 11/06/2011 1:13 PM, Abu Yahya wrote:
> My question is: Does using if-else statements like the above really
> improve performance? What is the best approach to instantiate classes
> whose type you don't know at compile time?

That code is unlikely to be in some critical inner loop, so any
efficiency gains would be marginal. Your original solution requires no
change if the possible classes change and is simpler to understand, each
of which on its own wins out over marginal gains in efficiency.

Robert Klemme

unread,
Jun 11, 2011, 1:49:08 PM6/11/11
to

I would stick with the forName() approach. If performance is critical
then I would define an interface for the factory method and configure
the name of a class which much implement this interface. Then you need
forName() only once (for instantiating the factory instance) and can use
new in factory methods (or do even more fancy things like caching etc.).

Doing if else cascades is certainly the worst thing - not so much
because of the performance but because of the deficiency that you need
to touch the code every time you want to add a new class. With the
other two approaches you do not have to do that.

Kind regards

robert

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

Patricia Shanahan

unread,
Jun 11, 2011, 2:01:10 PM6/11/11
to

Is performance really a critical issue here? Instantiating a database
manager is usually done quite infrequently, normally once per run, and
is often followed by opening a database, a relatively heavyweight operation.

I could see a case for the second version if you wanted to control the
options for the implementing class. Given the decision to preserve the
old code to handle unrecognized class names it does not even have that
advantage. In order to properly test the second version you will need an
additional class, not "DB2", "Oracle", or "SQLServer", so that the
fall-through code gets exercised.

The first version is simpler and easier to test, so it wins unless it
makes a significant difference in overall program performance.

Patricia

Patricia Shanahan

unread,
Jun 11, 2011, 2:04:57 PM6/11/11
to
On 6/11/2011 10:49 AM, Robert Klemme wrote:
> On 11.06.2011 19:13, Abu Yahya wrote:
...

>> else { // handle unrecognized
>> Class<?> k = Class.forName(dbMgrClassName);
>> db = (DB) k.newInstance();
>> }
...

> Doing if else cascades is certainly the worst thing - not so much
> because of the performance but because of the deficiency that you need
> to touch the code every time you want to add a new class. With the other
> two approaches you do not have to do that.
...

As coded, the forName code was left in as a fall-through handler, so it
new classes can be handled without touching the code. Of course, that
also means it has all the complications of both the if-else approach and
the forName approach.

Patricia

Abu Yahya

unread,
Jun 11, 2011, 2:22:34 PM6/11/11
to
On 6/11/2011 11:34 PM, Patricia Shanahan wrote:
> On 6/11/2011 10:49 AM, Robert Klemme wrote:
>> On 11.06.2011 19:13, Abu Yahya wrote:
> ...
>>> else { // handle unrecognized
>>> Class<?> k = Class.forName(dbMgrClassName);
>>> db = (DB) k.newInstance();
>>> }
> ...
>> Doing if else cascades is certainly the worst thing - not so much
>> because of the performance but because of the deficiency that you need
>> to touch the code every time you want to add a new class. With the other
>> two approaches you do not have to do that.
> ...
>
> As coded, the forName code was left in as a fall-through handler, so it
> new classes can be handled without touching the code.

That's right.

> Of course, that
> also means it has all the complications of both the if-else approach and
> the forName approach.

The intent was to get the best of both worlds, but I agree it's made it
less easy to understand.

Abu Yahya

unread,
Jun 11, 2011, 2:23:45 PM6/11/11
to

Thanks for your reply, Robert.

Could you give an example of how the factory method might look like?

Thanks in advance!

John B. Matthews

unread,
Jun 11, 2011, 3:43:27 PM6/11/11
to
In article <it0brg$s3t$2...@speranza.aioe.org>,
Abu Yahya <abu_...@invalid.com> wrote:

> Could you give an example of how the factory method might look like?

There's some good examples here:

<http://en.wikipedia.org/wiki/Factory_method_pattern>

And in the linked article, "Item 1: Consider static factory methods
instead of constructors."

<http://drdobbs.com/java/208403883?pgno=1>

--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

John B. Matthews

unread,
Jun 11, 2011, 3:50:07 PM6/11/11
to
In article <nospam-BA6E1B....@news.aioe.org>,
"John B. Matthews" <nos...@nospam.invalid> wrote:

> There's some

There are some

Robert Klemme

unread,
Jun 12, 2011, 8:05:58 AM6/12/11
to

Thanks for hinting at this detail, Patricia! Performance of this piece
of code can vary dramatically with configured class / handler name.
That adds a level of complication which might make tracking issues
harder ("It was so fast in our lab, now on production it's awfully slow.").

Also I find the inconsistency about what needs to be configured
irritating: the string can either be a logical name of a handler *or* a
class name - and you cannot even distinguish them easily (handler names
presented so far are also valid class names). IMHO for this it would be
better to have two different properties with clear defined precedence
for logical handler name property. That would also make it explicit
that there are two mechanisms involved. Even though, I still prefer one
of the two uniform approaches (class name, factory class name).

Kind regards

robert

Robert Klemme

unread,
Jun 12, 2011, 8:14:10 AM6/12/11
to
On 06/11/2011 09:43 PM, John B. Matthews wrote:
> In article<it0brg$s3t$2...@speranza.aioe.org>,
> Abu Yahya<abu_...@invalid.com> wrote:
>
>> Could you give an example of how the factory method might look like?
>
> There's some good examples here:
>
> <http://en.wikipedia.org/wiki/Factory_method_pattern>
>
> And in the linked article, "Item 1: Consider static factory methods
> instead of constructors."
>
> <http://drdobbs.com/java/208403883?pgno=1>

If Class.forName() is the bottleneck then a static factory method does
not help in this particular case. You would have to configure the
method name or a class name anyway and use reflection to get at the
instance or method.

Abu, to answer your question (pseudo code):

interface com.your.company.db.DbManager {
// methods
}

interface com.your.company.db.DbManagerFactory {
DbManager create(/* args if needed */) throws WhateverException
}

class com.your.company.db.ora.OraDbManager implements DbManager {
// ...
}

class com.your.company.db.ora.OracleDbManagerFactory implements
DbManagerFactory {
public DbManager create() {
return new OraDbManager();
}
}


Kind regards

robert

Patricia Shanahan

unread,
Jun 12, 2011, 10:10:07 AM6/12/11
to
On 6/12/2011 5:05 AM, Robert Klemme wrote:
...

> Thanks for hinting at this detail, Patricia! Performance of this piece
> of code can vary dramatically with configured class / handler name. That
> adds a level of complication which might make tracking issues harder
> ("It was so fast in our lab, now on production it's awfully slow.").
...

Is there really any program that instantiates so many database managers
that the difference between newInstance and constructor, and the
pipeline reloads related to conditional branches, become measurable?

I was concerned about the testing issues. Suppose some future changes
introduce a bug in the fall through path. In order to catch that bug,
there would have to be at least one test that instantiates a database
manager other than the ones that are being handled specifically.

Patricia

Martin Gregorie

unread,
Jun 12, 2011, 10:37:39 AM6/12/11
to
On Sun, 12 Jun 2011 07:10:07 -0700, Patricia Shanahan wrote:

> Is there really any program that instantiates so many database managers
> that the difference between newInstance and constructor, and the
> pipeline reloads related to conditional branches, become measurable?
>

Is there actually that much difference? It strikes me that both 'new' and
Class.forName() are doing essentially the same, namely searching the
class path for the required class, loading it into the JVM and
instantiating an object from it. I also wonder if 'new' might not be
implemented as a wrapper for Class.forName(). It certainly could be done
that way: both return a class object if they are successful and throw an
exception if the class can't be found.


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |

Robert Klemme

unread,
Jun 12, 2011, 12:10:13 PM6/12/11
to
On 06/12/2011 04:10 PM, Patricia Shanahan wrote:
> On 6/12/2011 5:05 AM, Robert Klemme wrote:
> ...
>> Thanks for hinting at this detail, Patricia! Performance of this piece
>> of code can vary dramatically with configured class / handler name. That
>> adds a level of complication which might make tracking issues harder
>> ("It was so fast in our lab, now on production it's awfully slow.").
> ...
>
> Is there really any program that instantiates so many database managers
> that the difference between newInstance and constructor, and the
> pipeline reloads related to conditional branches, become measurable?

Only OP knows. That's why I also suggested to go with Class.forName()
and only pick a different solution if there really was a performance issue.

> I was concerned about the testing issues. Suppose some future changes
> introduce a bug in the fall through path. In order to catch that bug,
> there would have to be at least one test that instantiates a database
> manager other than the ones that are being handled specifically.

Another bad effect from complexity in the implementation...

Cheers

robert

Robert Klemme

unread,
Jun 12, 2011, 12:17:39 PM6/12/11
to
On 06/12/2011 04:37 PM, Martin Gregorie wrote:
> On Sun, 12 Jun 2011 07:10:07 -0700, Patricia Shanahan wrote:
>
>> Is there really any program that instantiates so many database managers
>> that the difference between newInstance and constructor, and the
>> pipeline reloads related to conditional branches, become measurable?
>>
> Is there actually that much difference? It strikes me that both 'new' and
> Class.forName() are doing essentially the same, namely searching the
> class path for the required class, loading it into the JVM and
> instantiating an object from it.

Actually, the code will execute a Class.forName() under the hoods for
the version with direct instantiation. There is still a fundamental
difference though: the solution explicitly using Class.forName() will
provide the name at runtime while the version with the explicit
constructor call will have it compiled into the code. Consequently when
providing the name at runtime reflection has to be used (which is
usually a tad slower).

The conceptual difference between providing a type at compile time and
run time is reflected by the necessity to use reflection (in the dynamic
case) which defers particular type checks to runtime - which is usually
significantly slower when done frequently because it has to be done for
_every_ call.

> I also wonder if 'new' might not be
> implemented as a wrapper for Class.forName(). It certainly could be done
> that way: both return a class object if they are successful and throw an
> exception if the class can't be found.

Class.forName() only yields a class (if successful) while new SomeClass
yields an instance - so new is more like a wrapper around
Class.forName().newInstance(). But as I said, there is a fundamental
conceptual difference between the two.

Kind regards

robert

Joshua Cranmer

unread,
Jun 12, 2011, 3:25:10 PM6/12/11
to
On 06/12/2011 12:17 PM, Robert Klemme wrote:
> The conceptual difference between providing a type at compile time and
> run time is reflected by the necessity to use reflection (in the dynamic
> case) which defers particular type checks to runtime - which is usually
> significantly slower when done frequently because it has to be done for
> _every_ call.

One particular difference is that, as new uses a class already in the
constant pool, the lookup only needs to be done at most once per file,
since it is otherwise indexed by an integer into a cache. Class.forName
will have a slightly more expensive lookup, since it needs to index a
hashtable by a String.

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth

Roedy Green

unread,
Jun 13, 2011, 9:16:01 AM6/13/11
to
On Sat, 11 Jun 2011 22:43:59 +0530, Abu Yahya <abu_...@invalid.com>
wrote, quoted or indirectly quoted someone who said :

>I have a class that instantiates a private member based on a value in a
>configuration file.

When you use new, it must be followed by hard coded the name of the
class.

When you use newInstance, you can create the Class object with
Class.forName so all you need is a string containing the class name.
This is more general, but more convoluted than using new.

When you use Class.forName, GENJAR or the like has no idea that the
class need be included in the jar. All it sees is the string, not the
class name. The class name does not exist until run time. This can be
a good or bad thing.
--
Roedy Green Canadian Mind Products
http://mindprod.com
One of the great annoyances in programming derives from the irregularity
of English spelling especially when you have international teams.
I want to find a method or variable, but I don't know precisely
how its is spelled or worded. English is only approximately phonetic.
Letters are randomly doubled. The dictionary often lists variant spellings.
British, Canadian and American spellings differ.I would like to see an
experiment where variable names were spelled in a simplified English, where
there were no double letters.I also think you could add a number of rules
about composing variable names so that a variable name for something would
be highly predictable. You would also need automated enforcement of the
rules as well as possible.

Ian Shef

unread,
Jun 14, 2011, 4:07:47 PM6/14/11
to
Abu Yahya <abu_...@invalid.com> wrote in news:it07on$ilc$1
@speranza.aioe.org:

Maybe yes, maybe no. If you don't have a benchmark that shows it to be an
issue, don't worry about it. Initializing the databas manager is probably
going to be a lot more preformance-consuming than anything else that you
are doing here.

> What is the best approach to instantiate classes
> whose type you don't know at compile time?

Well, actually you _do_ know the type for db, you just didn't show us
directly; apparently it is DB. What you don't know at compile time is the
implementation.
I prefer to use java.util.ServiceLoader myself. It means that you have to
have "a provider-configuration file in the resource directory META-
INF/services" instead of a property or a value in a separate configuration
file. This could be a good thing or a bad thing, depending upon your
application.

lewbloch

unread,
Jun 15, 2011, 9:49:32 AM6/15/11
to
On Jun 11, 12:50 pm, "John B. Matthews" <nos...@nospam.invalid> wrote:
> In article <nospam-BA6E1B.15432711062...@news.aioe.org>,

>  "John B. Matthews" <nos...@nospam.invalid> wrote:
>
> > There's some
>
> There are some
>
> --
> John B. Matthews
> trashgod at gmail dot com
> <http://sites.google.com/site/drjohnbmatthews>

"There's some [plural] ..." is quite common in idiomatic American.

--
Lew

lewbloch

unread,
Jun 15, 2011, 9:58:56 AM6/15/11
to
On Jun 12, 7:37 am, Martin Gregorie <mar...@address-in-sig.invalid>
wrote:

'new' is not a wrapper for 'Class.forName()' because while 'forName()'
does return a class object, 'new' does not unless the class
instantiated actually is 'Class'. Since the constructors for 'Class'
are not exposed, that's unlikely.

'newInstance()' is different from 'new' also. It's invoked
reflectively, i.e., via runtime mechanisms, not via a compiled
constructor invocation as via 'new', and throws different exceptions
from the corresponding constructor. It's also semantically limited to
no-arg constructors.

'newInstance()' appears in a reflective context which is perforce
going to be slower than compiled-in decisions. Such a context will
properly appear only when performance is not the overarching concern,
nor readability.

--
Lew

Nigel Wade

unread,
Jun 16, 2011, 5:16:55 AM6/16/11
to
On 15/06/11 14:58, lewbloch wrote:
>
> 'newInstance()' is different from 'new' also. It's invoked
> reflectively, i.e., via runtime mechanisms, not via a compiled
> constructor invocation as via 'new', and throws different exceptions
> from the corresponding constructor. It's also semantically limited to
> no-arg constructors.
>

There is an alternative to the "simple" Class.newInstance() which allows
constructors with arguments to be used. The
Class.getConstructor(Class...) or Class.getDeclaredConstructor(Class...)
method can be used to obtain other constructors for the class. The
newInstance(Object) method of the returned Constructor can then be used
to get an instance of the class (where obj is actually an Object[]
containing the constructor arguments).

--
Nigel Wade

Michael Wojcik

unread,
Jun 16, 2011, 11:21:22 AM6/16/11
to
lewbloch wrote:
> On Jun 11, 12:50 pm, "John B. Matthews" <nos...@nospam.invalid> wrote:
>> In article <nospam-BA6E1B.15432711062...@news.aioe.org>,
>> "John B. Matthews" <nos...@nospam.invalid> wrote:
>>
>>> There's some
>> There are some
>
> "There's some [plural] ..." is quite common in idiomatic American.

True, which is an argument for avoiding it (or correcting it, as John
did in his edit).

Though it's not quite as grating as, say, the use of "would" to
indicate the subjunctive mood. ("If I would have knowed there's some
cupcakes, I would have totally ate them all.")

I've pretty much given up on nominative/objective case of pronouns as
a shibboleth ("between you and I") - I suspect more people in the US
now ignore traditional pronoun case than attempt to apply it - but
attentive writers do still try to watch agreement in number, I think.

--
Michael Wojcik
Micro Focus
Rhetoric & Writing, Michigan State University

lewbloch

unread,
Jun 17, 2011, 9:45:53 AM6/17/11
to

Your comments are appropriate for formal writing. Usenet is
conversational, ergo one should accept idiomatic expressions.
Otherwise we'd insist that no one use "doubt" to mean a mere question
without suspicion.

I do aver that one should spell nouns, particularly proper nouns,
correctly in technical speech, which this is for all its informality,
and it only makes sense to spell the first-person singular nominative
pronoun in English correctly as it's short enough to remember.

There's some folks even more pedantic than I, apparently. Welcome to
the club, Michael.

--
Lew

Michael Wojcik

unread,
Jun 17, 2011, 12:29:35 PM6/17/11
to
lewbloch wrote:
>
> There's some folks even more pedantic than I, apparently. Welcome to
> the club, Michael.

Alas, I am that most unsatisfied of creatures, a pedantic
descriptivist. I am annoyed by awkward constructions but lack the
consolation of labeling them as wrong.

But then I do employ casual constructions and idiomatic expressions in
my writing (and speech) - often even in formal writing, when
appropriate for reasons of style. I was merely agreeing with John's
impulse to correct the agreement in number in his first post.

Lewis Bloch

unread,
Jun 17, 2011, 2:07:15 PM6/17/11
to
On Jun 17, 9:29 am, Michael Wojcik <mwoj...@newsguy.com> wrote:
> lewbloch wrote:
>
> > There's some folks even more pedantic than I, apparently.  Welcome to
> > the club, Michael.
>
> Alas, I am that most unsatisfied of creatures, a pedantic
> descriptivist. I am annoyed by awkward constructions but lack the
> consolation of labeling them as wrong.
>
> But then I do employ casual constructions and idiomatic expressions in
> my writing (and speech) - often even in formal writing, when
> appropriate for reasons of style. I was merely agreeing with John's
> impulse to correct the agreement in number in his first post.
>

I mostly agree with both of you, and I particularly admire your
erudition and your richly concise expository style. Your points are
well-reasoned and your conclusions ineluctable.

--
Lew
Now go away or I shall taunt you a second time-a, silly English
knnnnnnn-ighit!
- paraphrased from /Monty Python and the Holy Grail/


John B. Matthews

unread,
Jun 18, 2011, 2:01:11 AM6/18/11
to
In article
<1fe8b57a-4f43-4685...@y7g2000prk.googlegroups.com>,
Lewis Bloch <lewis...@google.com> wrote:

> On Jun 17, 9:29 am, Michael Wojcik <mwoj...@newsguy.com> wrote:
> > lewbloch wrote:
> >
> > > There's some folks even more pedantic than I, apparently.
> > >  Welcome to the club, Michael.
> >
> > Alas, I am that most unsatisfied of creatures, a pedantic
> > descriptivist. I am annoyed by awkward constructions but lack the
> > consolation of labeling them as wrong.

The term descriptivist is new to me; thank you.

<http://en.wikipedia.org/wiki/Linguistic_description>



> > But then I do employ casual constructions and idiomatic expressions
> > in my writing (and speech) - often even in formal writing, when
> > appropriate for reasons of style. I was merely agreeing with John's
> > impulse to correct the agreement in number in his first post.

Subjectively, the impulse arose from realizing that "There's some
[plural] ..." had slipped into my writing. It sounded right, but read
wrong. The prescriptively correct contraction "There're some [plural]
..." sounds awkward with my (customary) rhotic "r", but it sounds
perfectly normal when spoken with Shelby Foote's mellifluous,
non-rhotic, Mississippi accent.

> I mostly agree with both of you, and I particularly admire your
> erudition and your richly concise expository style. Your points are
> well-reasoned and your conclusions ineluctable.

Well said.

Arved Sandstrom

unread,
Jun 18, 2011, 9:19:06 AM6/18/11
to
On 11-06-17 01:29 PM, Michael Wojcik wrote:
> lewbloch wrote:
>>
>> There's some folks even more pedantic than I, apparently. Welcome to
>> the club, Michael.
>
> Alas, I am that most unsatisfied of creatures, a pedantic
> descriptivist. I am annoyed by awkward constructions but lack the
> consolation of labeling them as wrong.
>
> But then I do employ casual constructions and idiomatic expressions in
> my writing (and speech) - often even in formal writing, when
> appropriate for reasons of style. I was merely agreeing with John's
> impulse to correct the agreement in number in his first post.

I've been trying for years to hit the right balance in blog articles,
design documents, RFP responses, presentations, tutorials, teaching
handouts, Usenet posts and Web forum questions, and also my own writing
for pleasure (this latter itself being of many different types). All I
know for sure is that I dislike (in varying degrees) the following:

1) _excessive_ use of elaborate or unusual words: I don't believe, like
many seem to do, that every use (utilisation) of big words is an
affectation (puttin' on airs) or replaceable with a smaller, easier
word. Many of these big words actually have subtle, enhanced meanings
that their simple proposed substitutes don't. But the prerequisites for
using big words include understanding the exact meanings, knowing that
the simple word is not a close-enough substitute, and remembering to
write for the audience.

There are few things worse than an unrelenting barrage of complex,
Latin-based verbiage.

2) incorrect spelling, _particularly_ when it's obvious that it's not a
typo. Examples: "she poured over her material", "that was a breech of
security", and "the shed wreaked of gasoline". I blame lack of reading
for this problem; it's not possible to make these mistakes (or for that
matter, to be a bad speller, period) if you read voraciously.

3) writing without a plan: a disorganized and tenuous grasp of facts and
conclusions in one's head translates to an equivalent mess on paper. The
act of writing does not improve the material.

4) using language as a nefarious tool: this technique often makes use of
my first point. It also employs skillful tense and pronoun and adjective
selections to divert and diffuse responsibility, or to disguise a lack
of real content.

There is no shortage of software consultancies that do exactly this, and
it gets really horrendous when the clients are government departments.
I'll produce one common example - a notional consultancy is called upon
to produce a software design document. You and I, being software
developers, would like to think that technical people are the audience
for such a document, and that technical people pronounce on the
acceptability of the finished version. Such is rarely the case - the
authoring consultancy produces beautiful but vapid high-level bumwipe
that is presented to the PMs and higher, and approved by higher client
management. Little matter that it's a useless design document devoid of
concrete information that would help implementors.

Even better, when the project fails, weasel-English can now be used to
blame the _implementors_. The typical design doc I've seen parrots the
*business* requirements (few clients know what technical requirements
are) and pads out the design with some pretty but fairly useless UML.
But all the PMs and client managers understood and liked this design doc
- still do - and they _approved_ it, so clearly the coders must be at
fault. It's the _coders_ that don't get the design doc. Right?

In fact there's nothing there to get, but the bosses don't want to hear
that.

I had the pleasure some months back of being commissioned to do 20 days
worth of work writing up a detailed design document in such an
environment. Normally for this client I do maintenance rescue coding,
but in this case the problem was complex and actually required a
developer - not a BA - to do the design. At the end of the 20 days I had
not only a clear and concise *real* detailed design document - one that
another developer could use - but also a working POC of the
solution...which hadn't even been expected by the client. It hadn't been
expected mainly because the other software consultancies are loaded with
PMs, BAs and mediocre coders, so the clients aren't used to adequate
performance.

The best measure of this detailed design document that I produced is
that, in marked contrast to the usual design docs that floated around
that office, the higher up the food chain you went with it, the less
people were able to understand it. Any other coder, excellent grasp of
what I wrote. An architect, not so good, because a lot of architects are
not good coders (in my experience). PMs and mid-level managers, serious
struggling. High-level managers and directors, hang it up - you read the
executive summary I prepared.

The point being, I've found that obfuscatory English is used as a weapon
to disguise incompetence and inefficiencies, or worse. I've seen some
pretty horrible wastage of taxpayer money precisely because muddy and
weaselly English let all the players wriggle out of accountability, and
often enough even get rewarded for their previous disaster.

So that's why I like clear English.

AHS

Robert Klemme

unread,
Jun 18, 2011, 2:16:03 PM6/18/11
to
On 18.06.2011 15:19, Arved Sandstrom wrote:

> So that's why I like clear English.

I'm a bit embarrassed to not write more than "I couldn't agree more".
Thank you, Arved!

blmblm.m...@gmail.com

unread,
Jun 20, 2011, 3:18:39 PM6/20/11
to
In article <e43ff9cb-73a9-4d24...@s41g2000prb.googlegroups.com>,

lewbloch <lewb...@gmail.com> wrote:
> On Jun 16, 8:21 am, Michael Wojcik <mwoj...@newsguy.com> wrote:
> > lewbloch wrote:
> > > On Jun 11, 12:50 pm, "John B. Matthews" <nos...@nospam.invalid> wrote:
> > >> In article <nospam-BA6E1B.15432711062...@news.aioe.org>,
> > >> "John B. Matthews" <nos...@nospam.invalid> wrote:
> >
> > >>> There's some
> > >> There are some
> >
> > > "There's some [plural] ..." is quite common in idiomatic American.
> >
> > True, which is an argument for avoiding it (or correcting it, as John
> > did in his edit).
> >
> > Though it's not quite as grating as, say, the use of "would" to
> > indicate the subjunctive mood. ("If I would have knowed there's some
> > cupcakes, I would have totally ate them all.")

Sing it.

> > I've pretty much given up on nominative/objective case of pronouns as
> > a shibboleth ("between you and I") - I suspect more people in the US
> > now ignore traditional pronoun case than attempt to apply it -

Me and you agree about that. (I hope I won't regret posting a sentence
I can hardly type without wincing.)

> > but
> > attentive writers do still try to watch agreement in number, I think.
> >
>
> Your comments are appropriate for formal writing. Usenet is
> conversational, ergo one should accept idiomatic expressions.
> Otherwise we'd insist that no one use "doubt" to mean a mere question
> without suspicion.

Oh, but some people do (insist .... ) -- there's been a recent thread
in comp.lang.c in which a few speakers of the non-Indian Englishes
have tried to object to use of "doubt" to mean "question". I doubt
they'll succeed, but -- <shrug>.

> I do aver that one should spell nouns, particularly proper nouns,
> correctly in technical speech, which this is for all its informality,
> and it only makes sense to spell the first-person singular nominative
> pronoun in English correctly as it's short enough to remember.
>
> There's some folks even more pedantic than I, apparently.

*Oh* yes, though some of us aren't quite as vocal about our pedantry.

> Welcome to the club, Michael.

--
B. L. Massingill
ObDisclaimer: I don't speak for my employers; they return the favor.

blmblm.m...@gmail.com

unread,
Jun 20, 2011, 3:19:56 PM6/20/11
to
In article <fB1Lp.9356$PA5...@newsfe01.iad>,
Arved Sandstrom <asandstr...@eastlink.ca> wrote:

[ snip ]

> I've been trying for years to hit the right balance in blog articles,
> design documents, RFP responses, presentations, tutorials, teaching
> handouts, Usenet posts and Web forum questions, and also my own writing
> for pleasure (this latter itself being of many different types). All I
> know for sure is that I dislike (in varying degrees) the following:

[ snip lots of interesting digression ]

> 2) incorrect spelling, _particularly_ when it's obvious that it's not a
> typo. Examples: "she poured over her material", "that was a breech of
> security", and "the shed wreaked of gasoline".

*Oh* yes. EIther mistakes of this kind have become more common in
recent years -- *even in prose that one would think had been reviewed
by someone with copyediting experience* -- or I'm noticing them more.

> I blame lack of reading
> for this problem; it's not possible to make these mistakes (or for that
> matter, to be a bad speller, period) if you read voraciously.

You think? I sometimes wonder if some people's brains are wired to
care about spelling, and others' aren't. I'm in the former group,
and indeed find that unless I know how a word is spelled it's somehow
not real to me. I don't have that problem with words whose spelling
I know but whose pronunciation I'm unsure of. I wonder, though,
whether there are people for whom exactly the reverse is true.

I also wonder whether reading voraciously even helps, given that more
and more one can't rely on published prose to be correct.

Sigh.

[ snip ]

> The best measure of this detailed design document that I produced is
> that, in marked contrast to the usual design docs that floated around
> that office, the higher up the food chain you went with it, the less
> people were able to understand it.

"Less" or "fewer"? (You probably do mean "less", but the widespread
practice of using the former to mean the latter means that one can't
really be sure, maybe.)

[ snip ]

Martin Gregorie

unread,
Jun 20, 2011, 4:46:33 PM6/20/11
to
On Mon, 20 Jun 2011 19:19:56 +0000, blm...@myrealbox.com wrote:

> In article <fB1Lp.9356$PA5...@newsfe01.iad>, Arved Sandstrom
> <asandstr...@eastlink.ca> wrote:
>
>> I blame lack of reading
>> for this problem; it's not possible to make these mistakes (or for that
>> matter, to be a bad speller, period) if you read voraciously.
>
> You think? I sometimes wonder if some people's brains are wired to care
> about spelling, and others' aren't.
>

I'm with Arved here: quite a lot of mistakes would appear to indicate the
author is an almost illiterate person who listens more than he reads, e.g
writing 'your' instead of 'you're'. A lot of the more (to me) irritating
habits are probably the result of not realising that spoken idiom differs
from written, e.g. using 'of' in place of 'with' - this seems to be a
North American habit.

Martin Gregorie

unread,
Jun 20, 2011, 4:52:55 PM6/20/11
to
On Mon, 20 Jun 2011 19:18:39 +0000, blm...@myrealbox.com wrote:

> Oh, but some people do (insist .... ) -- there's been a recent thread in
> comp.lang.c in which a few speakers of the non-Indian Englishes have
> tried to object to use of "doubt" to mean "question". I doubt they'll
> succeed, but -- <shrug>.
>

Indian English is still heavily influenced by Victorian English,
especially their conversational forms. Along with railways and the postal
system, Victorian english is one of the main legacies of the Raj.

Gene Wirchenko

unread,
Jun 20, 2011, 5:01:45 PM6/20/11
to
On Sat, 18 Jun 2011 10:19:06 -0300, Arved Sandstrom
<asandstr...@eastlink.ca> wrote:

[snip]

>I've been trying for years to hit the right balance in blog articles,


>design documents, RFP responses, presentations, tutorials, teaching
>handouts, Usenet posts and Web forum questions, and also my own writing
>for pleasure (this latter itself being of many different types). All I

[nice stuff snipped]

>I had the pleasure some months back of being commissioned to do 20 days
>worth of work writing up a detailed design document in such an
>environment. Normally for this client I do maintenance rescue coding,
>but in this case the problem was complex and actually required a
>developer - not a BA - to do the design. At the end of the 20 days I had
>not only a clear and concise *real* detailed design document - one that
>another developer could use - but also a working POC of the

^^^
What is this, please?

>solution...which hadn't even been expected by the client. It hadn't been
>expected mainly because the other software consultancies are loaded with
>PMs, BAs and mediocre coders, so the clients aren't used to adequate
>performance.

[more nice stuff snipped]

>So that's why I like clear English.

I am rather fond of it myself.

Sincerely,

Gene Wirchenko

Arved Sandstrom

unread,
Jun 20, 2011, 5:53:30 PM6/20/11
to
On 11-06-20 06:01 PM, Gene Wirchenko wrote:
> On Sat, 18 Jun 2011 10:19:06 -0300, Arved Sandstrom
> <asandstr...@eastlink.ca> wrote:
>
> [snip]
>
>> I've been trying for years to hit the right balance in blog articles,
>> design documents, RFP responses, presentations, tutorials, teaching
>> handouts, Usenet posts and Web forum questions, and also my own writing
>> for pleasure (this latter itself being of many different types). All I
>
> [nice stuff snipped]
>
>> I had the pleasure some months back of being commissioned to do 20 days
>> worth of work writing up a detailed design document in such an
>> environment. Normally for this client I do maintenance rescue coding,
>> but in this case the problem was complex and actually required a
>> developer - not a BA - to do the design. At the end of the 20 days I had
>> not only a clear and concise *real* detailed design document - one that
>> another developer could use - but also a working POC of the
> ^^^
> What is this, please?

Ah, sorry, "proof of concept". POC = Proof Of Concept; POT = Proof Of
Technology.

[ SNIP ]

AHS

Arved Sandstrom

unread,
Jun 20, 2011, 5:55:12 PM6/20/11
to
On 11-06-20 04:19 PM, blm...@myrealbox.com wrote:
> In article <fB1Lp.9356$PA5...@newsfe01.iad>,
> Arved Sandstrom <asandstr...@eastlink.ca> wrote:
[ SNIP ]

>> The best measure of this detailed design document that I produced is
>> that, in marked contrast to the usual design docs that floated around
>> that office, the higher up the food chain you went with it, the less
>> people were able to understand it.
>
> "Less" or "fewer"? (You probably do mean "less", but the widespread
> practice of using the former to mean the latter means that one can't
> really be sure, maybe.)
>
> [ snip ]

I did mean less, but by definition you also would have had fewer people
able to understand it. :-)

AHS

blmblm.m...@gmail.com

unread,
Jun 21, 2011, 4:42:16 PM6/21/11
to
In article <itobj8$j1m$1...@localhost.localdomain>,

Say what .... Can you give an example of that ('of' instead of
'with')?

Gene Wirchenko

unread,
Jun 21, 2011, 5:22:19 PM6/21/11
to
On 21 Jun 2011 20:42:16 GMT, blm...@myrealbox.com
<blmblm.m...@gmail.com> wrote:

>In article <itobj8$j1m$1...@localhost.localdomain>,
>Martin Gregorie <mar...@address-in-sig.invalid> wrote:

[snip]

>> I'm with Arved here: quite a lot of mistakes would appear to indicate the
>> author is an almost illiterate person who listens more than he reads, e.g
>> writing 'your' instead of 'you're'. A lot of the more (to me) irritating
>> habits are probably the result of not realising that spoken idiom differs
>> from written, e.g. using 'of' in place of 'with' - this seems to be a
>> North American habit.
>
>Say what .... Can you give an example of that ('of' instead of
>'with')?

Perhaps, it is that you should of [sic] realised that he meant
using "of" instead of "have"?

Sincerely,

Gene Wirchenko

Tom Anderson

unread,
Jun 21, 2011, 6:29:57 PM6/21/11
to
On Mon, 20 Jun 2011, Arved Sandstrom wrote:

> On 11-06-20 04:19 PM, blm...@myrealbox.com wrote:
>> In article <fB1Lp.9356$PA5...@newsfe01.iad>,
>> Arved Sandstrom <asandstr...@eastlink.ca> wrote:
> [ SNIP ]
>
>>> The best measure of this detailed design document that I produced is
>>> that, in marked contrast to the usual design docs that floated around
>>> that office, the higher up the food chain you went with it, the less
>>> people were able to understand it.
>>
>> "Less" or "fewer"? (You probably do mean "less", but the widespread
>> practice of using the former to mean the latter means that one can't
>> really be sure, maybe.)
>

> I did mean less, but by definition you also would have had fewer people
> able to understand it. :-)

This less/fewer thing is largely dubious:

http://english.stackexchange.com/questions/495/less-vs-fewer/505#505

I don't think it's defensible to say that Arved's sentence was incorrect.
Lots of people might not write it that way, but lots would, and everyone
understands it.

tom

--
No man ever steps in the same river twice, for it's not the same river
and he's not the same man. -- Heraclitus

Arved Sandstrom

unread,
Jun 21, 2011, 7:39:27 PM6/21/11
to
On 11-06-21 07:29 PM, Tom Anderson wrote:
> On Mon, 20 Jun 2011, Arved Sandstrom wrote:
>
>> On 11-06-20 04:19 PM, blm...@myrealbox.com wrote:
>>> In article <fB1Lp.9356$PA5...@newsfe01.iad>,
>>> Arved Sandstrom <asandstr...@eastlink.ca> wrote:
>> [ SNIP ]
>>
>>>> The best measure of this detailed design document that I produced is
>>>> that, in marked contrast to the usual design docs that floated around
>>>> that office, the higher up the food chain you went with it, the less
>>>> people were able to understand it.
>>>
>>> "Less" or "fewer"? (You probably do mean "less", but the widespread
>>> practice of using the former to mean the latter means that one can't
>>> really be sure, maybe.)
>>
>> I did mean less, but by definition you also would have had fewer
>> people able to understand it. :-)
>
> This less/fewer thing is largely dubious:
>
> http://english.stackexchange.com/questions/495/less-vs-fewer/505#505
>
> I don't think it's defensible to say that Arved's sentence was
> incorrect. Lots of people might not write it that way, but lots would,
> and everyone understands it.
>
> tom
>
In fact, in the original construction, if I had written

"the fewer people were able to understand it"

that would have been stilted and wrong. It's the "the" there that makes
all the difference. I could have written

"...went with it, fewer people were able to understand it."

and that would be OK (if still marginally US Constitution-sounding like).

"The less" in my construction actually operates as a single unit.
Although I'm not sure what part of a sentence it corresponds to.

AHS

Michael Wojcik

unread,
Jun 21, 2011, 7:53:53 PM6/21/11
to
Arved Sandstrom wrote:
>
> The point being, I've found that obfuscatory English is used as a weapon
> to disguise incompetence and inefficiencies, or worse. I've seen some
> pretty horrible wastage of taxpayer money precisely because muddy and
> weaselly English let all the players wriggle out of accountability, and
> often enough even get rewarded for their previous disaster.
>
> So that's why I like clear English.

This worry is ancient, of course, if we can substitute other languages
for English.

It's the overt root of the battle between the Periclean rhetors
(Plato, Socrates, Isocrates) and the Sophists: the Pericleans claimed
that ethics was inherent in rhetoric, and so using language to
persuade to an incorrect end was an unethical use of language (and not
just an unethical act in general), while the Sophists argued that it
was fine to formulate an argument in favor of an unethical end, if
your broader purpose was good.[1,2]

This argument over the coupling of rhetoric and ethics is older than
the ancient Greek rhetors - you can find versions of it in various
ancient cultures [3] - and it continues to this day [4].

But whether you think ethics inheres in rhetoric (like Plato) or not
(like Gorgias), you can dislike ill uses of rhetoric, of course.


[1] The classic example is the Sophist Gorgias' "Encomium of Helen", a
fairly short and entertaining essay about why Helen of Troy was a
pretty good kid after all, and not the villain traditional Athenian
lore made her out to be.

[2] The *covert* reason for the acrimony between the Pericleans and
the Sophists was that the latter were foreigners, come to Athens to
steal all the good rhetoric jobs. Periclean Athens did not have a
limit on H1-B visas.

[3] I think there's at least one example in the collection _Rhetoric
Before and Beyond the Greeks_, but it's too hot to go dig that out
right now.

[4] A well-known recent example is Katz's work on the rhetoric
employed in technical documents by Nazi scientists.[5]

[5] ObAntiGodwin: Note that there is no *comparison* to Nazis, etc,
here, so Godwin's Law does not apply.

John B. Matthews

unread,
Jun 21, 2011, 11:00:58 PM6/21/11
to
In article <QY9Mp.28015$F25....@newsfe04.iad>,
Arved Sandstrom <asandstr...@eastlink.ca> wrote:

> On 11-06-21 07:29 PM, Tom Anderson wrote:
> > On Mon, 20 Jun 2011, Arved Sandstrom wrote:
> >
> >> On 11-06-20 04:19 PM, blm...@myrealbox.com wrote:
> >>> In article <fB1Lp.9356$PA5...@newsfe01.iad>,
> >>> Arved Sandstrom <asandstr...@eastlink.ca> wrote:
> >> [ SNIP ]
> >>
> >>>> The best measure of this detailed design document that I
> >>>> produced is that, in marked contrast to the usual design docs
> >>>> that floated around that office, the higher up the food chain
> >>>> you went with it, the less people were able to understand it.
> >>>
> >>> "Less" or "fewer"? (You probably do mean "less", but the
> >>> widespread practice of using the former to mean the latter means
> >>> that one can't really be sure, maybe.)
> >>
> >> I did mean less, but by definition you also would have had fewer
> >> people able to understand it. :-)
> >
> > This less/fewer thing is largely dubious:
> >
> > http://english.stackexchange.com/questions/495/less-vs-fewer/505#505
> >
> > I don't think it's defensible to say that Arved's sentence was
> > incorrect. Lots of people might not write it that way, but lots
> > would, and everyone understands it.
> >

> In fact, in the original construction, if I had written
>
> "the fewer people were able to understand it"
>
> that would have been stilted and wrong. It's the "the" there that
> makes all the difference. I could have written
>
> "...went with it, fewer people were able to understand it."
>
> and that would be OK (if still marginally US Constitution-sounding
> like).
>
> "The less" in my construction actually operates as a single unit.
> Although I'm not sure what part of a sentence it corresponds to.

I read "less" as an adverb modifying "able", moved to enhance
parallelism: "The higher ... the less able ..."

Tom Anderson

unread,
Jun 22, 2011, 3:02:33 PM6/22/11
to

As in "... the degree to which people were able to understand it was
less". Yes, Arved was entirely right the first time.

Now, on reading your rephrasing, it sounds like you're implying that as
you move higher, the people get less able!

tom

--
No noon today. Noon tomorrow. There's always a noon tomorrow.

blmblm.m...@gmail.com

unread,
Jun 22, 2011, 4:03:12 PM6/22/11
to
In article <nospam-BE4336....@news.aioe.org>,

John B. Matthews <nos...@nospam.invalid> wrote:
> In article <QY9Mp.28015$F25....@newsfe04.iad>,
> Arved Sandstrom <asandstr...@eastlink.ca> wrote:
>
> > On 11-06-21 07:29 PM, Tom Anderson wrote:
> > > On Mon, 20 Jun 2011, Arved Sandstrom wrote:
> > >
> > >> On 11-06-20 04:19 PM, blm...@myrealbox.com wrote:
> > >>> In article <fB1Lp.9356$PA5...@newsfe01.iad>,
> > >>> Arved Sandstrom <asandstr...@eastlink.ca> wrote:
> > >> [ SNIP ]
> > >>
> > >>>> The best measure of this detailed design document that I
> > >>>> produced is that, in marked contrast to the usual design docs
> > >>>> that floated around that office, the higher up the food chain
> > >>>> you went with it, the less people were able to understand it.
> > >>>
> > >>> "Less" or "fewer"? (You probably do mean "less", but the
> > >>> widespread practice of using the former to mean the latter means
> > >>> that one can't really be sure, maybe.)
> > >>
> > >> I did mean less, but by definition you also would have had fewer
> > >> people able to understand it. :-)
> > >
> > > This less/fewer thing is largely dubious:
> > >
> > > http://english.stackexchange.com/questions/495/less-vs-fewer/505#505
> > >
> > > I don't think it's defensible to say that Arved's sentence was
> > > incorrect. Lots of people might not write it that way, but lots
> > > would, and everyone understands it.

Just for the record, I don't think I meant to claim that there
was anything wrong with Arved's sentence, even to those pedantic
prescriptivists who disapprove of using "less" where "fewer" would
work. I think there might be a subtle distinction between fewer
people who understand, and people in general understanding less,
but -- maybe not.

> > In fact, in the original construction, if I had written
> >
> > "the fewer people were able to understand it"
> >
> > that would have been stilted and wrong.

Agreed.

> > It's the "the" there that
> > makes all the difference. I could have written
> >
> > "...went with it, fewer people were able to understand it."
> >
> > and that would be OK (if still marginally US Constitution-sounding
> > like).

I don't think that really works -- "the higher up" seems to me to
want a parallel "the" before whatever follows the comma.

> > "The less" in my construction actually operates as a single unit.
> > Although I'm not sure what part of a sentence it corresponds to.
>
> I read "less" as an adverb modifying "able", moved to enhance
> parallelism: "The higher ... the less able ..."

I think you may be making the same point here I was getting at just
above ....

blmblm.m...@gmail.com

unread,
Jun 22, 2011, 4:01:40 PM6/22/11
to
In article <itrb2...@news2.newsguy.com>,

Michael Wojcik <mwo...@newsguy.com> wrote:
> Arved Sandstrom wrote:
> >
> > The point being, I've found that obfuscatory English is used as a weapon
> > to disguise incompetence and inefficiencies, or worse. I've seen some
> > pretty horrible wastage of taxpayer money precisely because muddy and
> > weaselly English let all the players wriggle out of accountability, and
> > often enough even get rewarded for their previous disaster.
> >
> > So that's why I like clear English.
>
> This worry is ancient, of course, if we can substitute other languages
> for English.
>
> It's the overt root of the battle between the Periclean rhetors
> (Plato, Socrates, Isocrates) and the Sophists: the Pericleans claimed
> that ethics was inherent in rhetoric, and so using language to
> persuade to an incorrect end was an unethical use of language (and not
> just an unethical act in general), while the Sophists argued that it
> was fine to formulate an argument in favor of an unethical end, if
> your broader purpose was good.[1,2]
>
> This argument over the coupling of rhetoric and ethics is older than
> the ancient Greek rhetors - you can find versions of it in various
> ancient cultures [3] - and it continues to this day [4].
>

Someone should perhaps mention, in this context, George Orwell's essay
"Politics and the English Language" [*]? one of my favorites, which
seems to make a similar connection between language and ethics.

[*] I'd say "GIYF", but maybe it would be worthwhile for me to save
people a bit of time .... Good heavens, there's a Wikipedia article!

http://en.wikipedia.org/wiki/Politics_and_the_English_Language

with links at the bottom to several versions of the original text.

[ snip ]

Michael Wojcik

unread,
Jun 23, 2011, 11:58:41 AM6/23/11
to

Combine that idea with Arved's. "the [quantifier] ... the [quantifier]
..." is one of a set of idiomatic phrasal constructions acting as a
pair of parallel adverbs, typically modifying an adjective following
the second quantifier.

The idiomatic phrase "the [quantifier]" can serve as an adverb on its
own, too, as in "none the less".

Michael Wojcik

unread,
Jun 23, 2011, 12:16:13 PM6/23/11
to
blm...@myrealbox.com wrote:
>
> Someone should perhaps mention, in this context, George Orwell's essay
> "Politics and the English Language" [*]? one of my favorites, which
> seems to make a similar connection between language and ethics.

Yes. A number of authors and poets at the time - coming out of the
Modernist avant-garde period, High Literary Modernism, and the world
wars - were both very interested in language and very concerned with
its political ramifications. Besides Orwell you have for example
Anthony Burgess and Aldous Huxley.

The idea that language had political effectivity was rather in the air
at the time, fed by psychoanalysis; structural linguistics
anthropological theories like the (somewhat misnamed) "Sapir-Whorf
Hypothesis"; discussions about art, propaganda, and culture among
international Marxists; the work of philosophers such as Heidegger;
and so on.

But Orwell's is a particularly good example in this area. It's
certainly a lot more readable than many of the contemporary
philosophical treatments. (I like Derrida just fine, but few people
would call _Spectres of Marx_, say, a light read.)

Michael Wojcik

unread,
Jun 23, 2011, 12:04:53 PM6/23/11
to
blm...@myrealbox.com wrote:
>
> Just for the record, I don't think I meant to claim that there
> was anything wrong with Arved's sentence, even to those pedantic
> prescriptivists who disapprove of using "less" where "fewer" would
> work. I think there might be a subtle distinction between fewer
> people who understand, and people in general understanding less,
> but -- maybe not.

There's definitely a distinction between those two concepts. It's just
not definitively captured by the use of "less" in that sentence, which
could be interpreted as either without straining normal meanings of
the words involved.

However, convention suggests that "the less" in that sentence is the
adverbial "the less", and not part of a noun phrase "the less people"
meaning not as many people.

This is one place where, for clarity, it would be useful to use
"fewer" *if* that was what the author wanted to convey. (In this case
it wasn't.) As Arved said elsethread, however, you'd have to do some
editing to arrive at a palatable construction using "fewer". One
option would be "the higher you went ... the fewer the people who were
able ...".

0 new messages