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

Pattern.CASE_SENSITVE

0 views
Skip to first unread message

Roedy Green

unread,
Nov 14, 2011, 3:15:37 PM11/14/11
to
There is no such flag as Pattern.CASE_SENSITIVE. There is a
Pattern.CASE_INSENSITIVE, and Regex handles case-sensitive searches
just fine, so in theory you don't need one since it is the default.

I think this was a mistake. There should be a Pattern.CASE_SENSITIVE
even if many people would never use it.

_I_would use it in. In fact I keep futilely trying to use it.

In my first cut of my code I would leave it out. On my second cut I
Would think more deeply and decide carefully,
CASE_SENSITIVE or CASE_INSENSITIVE and insert which I wanted.
I can do this better since the precise content dust of the strings has
settled. I would then mark those with the term meaning not only was
it CASE_SENSITIVE, but thoughtfully chosen to DELIBERATELY case
sensitive not just lazily assigned that way by default. I can tell
which ones I have already done.

Also, If I want to review all my CASE_SENSTIVE patterns, I have a
handle to look for them in a editor a (or symbol for the Intellij
IDE).

Similar Java refused to assign a keyword for package default. (Gosling
and Joy have crucilogophobia as evidenced by the coprophagous
recycling of keywords when generics were introduced.). They went even
further and refused to give it a name. The scope who dare not speak
its name. The result is, it becomes awkward to talk about, especially
to newbies. It is almost like religious sects that refuse to pronounce
the name of God aloud or write it down. It is a bit like a Tarzan
refusing to assign his son a more specific name than "boy", or people
who name their dogs "Dog" or "the dog".

"default" is not a name. It is an adjective. It is a function and one
that has much broader meaning than you want to identify a friendly
openness within a package.

IntelliJ Inspector has greatly helped with problem. Now I don't
worry much about scope. Then the compiler tells me when I have been
too private or the Inspector too generous, given the existing
interconnections. Generally know I made very little public, unless I
intend for the general public to use it. It is so easy to open up
access later with IntelliJ if it later need it.

I have gradually developed a extreme mistake for public. Using it
warns you this code is on its way to spaghetti. It going to be a
nightmare to change everything if it all knows too much about each
others inner workings.
--
Roedy Green Canadian Mind Products
http://mindprod.com
I can't come to bed just yet. Somebody is wrong on the Internet.
0 new messages