From: Brian Drummond <brian@shapes.demon.co.uk>
Subject: Re: Q: type ... is new String
Date: Mon, 4 Jun 2012 11:39:56 +0000 (UTC)
Date: 2012-06-04T11:39:56+00:00 [thread overview]
Message-ID: <jqi6qb$oms$1@dont-email.me> (raw)
In-Reply-To: jq5i58$qe8$1@speranza.aioe.org
On Wed, 30 May 2012 16:33:45 +0000, tmoran wrote:
> Any comments on the effectiveness of using multiple types for different
> categories of strings, rather than "String" all the time?
A comment from a different angle...
Some time ago, http://www.joelonsoftware.com/ was recommended to me as a
good "inside voice" on (specifically C and C++) programming practice. And
I started to enjoy these articles and agree with some of his points...
Until I read
http://www.joelonsoftware.com/articles/Wrong.html
specifically this quote from a section oddly titled "The Real Solution"...
"All strings that come from the user must be stored in variables (or
database columns) with a name starting with the prefix "us" (for Unsafe
String). All strings that have been HTML encoded or which came from a
known-safe location must be stored in variables with a name starting with
the prefix "s" (for Safe string)."
Now it seems to me that he would be better off saying
"type UnsafeString is new String;"
and bypassing the rest of that (rather long) article entirely. And let
the compiler catch the problems instead of uglifying the entire codebase
so that he can tell programmers (I kid you not, it's a direct quote from
the article!) "I know, it’s a little bit hard to see the wrong code at
first, but do this for three weeks, and your eyes will adapt ..."
Three weeks? Jeez. And you know that's just the tip of the iceberg.
What's wrong with just letting the compiler find the wrong code?
Now, we can debate the relative merits of "is new String" versus "is new
Array <> of Character" but how do we get the message out there that
recognized industry experts (and I'm not quoting "expert" because I
believe he is, in his field) are recommending "Real Solutions" that
impose weeks of painful and unnecessary work on unsuspecting programmers
for ... what purpose? what gain?
Or am I missing something in that article?
- Brian
next prev parent reply other threads:[~2012-06-04 11:39 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-30 16:33 Q: type ... is new String tmoran
2012-05-30 17:04 ` Dmitry A. Kazakov
2012-05-31 7:37 ` Maciej Sobczak
2012-06-04 5:58 ` Yannick Duchêne (Hibou57)
2012-06-04 6:30 ` J-P. Rosen
2012-06-04 7:48 ` Yannick Duchêne (Hibou57)
2012-06-04 8:03 ` Dmitry A. Kazakov
2012-06-04 8:14 ` Yannick Duchêne (Hibou57)
2012-06-04 9:09 ` Dmitry A. Kazakov
2012-06-04 10:35 ` J-P. Rosen
2012-06-04 5:43 ` Yannick Duchêne (Hibou57)
2012-06-04 11:39 ` Brian Drummond [this message]
2012-06-04 13:36 ` Maciej Sobczak
2012-06-04 14:58 ` Georg Bauhaus
2012-06-04 15:14 ` Dmitry A. Kazakov
2012-06-04 16:06 ` Georg Bauhaus
2012-06-04 17:05 ` Dmitry A. Kazakov
2012-06-04 20:28 ` Yannick Duchêne (Hibou57)
2012-06-04 20:56 ` Georg Bauhaus
2012-06-05 7:32 ` Dmitry A. Kazakov
2012-06-05 8:40 ` Georg Bauhaus
2012-06-05 9:06 ` Dmitry A. Kazakov
2012-06-05 12:20 ` Georg Bauhaus
2012-06-05 13:14 ` Dmitry A. Kazakov
2012-06-06 4:09 ` Shark8
2012-06-06 8:52 ` Georg Bauhaus
2012-06-06 23:56 ` Randy Brukardt
2012-06-07 11:15 ` Georg Bauhaus
2012-06-06 23:51 ` Randy Brukardt
2012-06-04 20:33 ` Yannick Duchêne (Hibou57)
2012-06-04 21:27 ` Georg Bauhaus
[not found] ` <m9kqs7hgii13e220b1phm46n43d92tu1pj@invalid.netcom.com>
2012-06-05 6:15 ` Georg Bauhaus
2012-06-05 6:36 ` Yannick Duchêne (Hibou57)
2012-06-06 4:14 ` Shark8
2012-06-07 0:01 ` Randy Brukardt
2012-06-07 0:20 ` Adam Beneschan
2012-06-05 12:05 ` Brian Drummond
2012-06-05 14:43 ` Yannick Duchêne (Hibou57)
2012-06-04 15:54 ` Shark8
2012-06-04 22:01 ` Jeffrey Carter
2012-06-05 12:10 ` Brian Drummond
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox