From: Brian Drummond <brian@shapes.demon.co.uk>
Subject: Re: Q: type ... is new String
Date: Tue, 5 Jun 2012 12:05:10 +0000 (UTC)
Date: 2012-06-05T12:05:10+00:00 [thread overview]
Message-ID: <jqkslm$brf$1@dont-email.me> (raw)
In-Reply-To: 82defba0-2d39-4418-b678-ebbefeb105d7@x21g2000vbc.googlegroups.com
On Mon, 04 Jun 2012 06:36:31 -0700, Maciej Sobczak wrote:
> On 4 Cze, 13:39, Brian Drummond <br...@shapes.demon.co.uk> wrote:
>
>> 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.
>
> Except that it would not work in the language that he used for
> presentation (which is VBScript, I guess).
"pseudocode" he called it, having started the article using C. And in
pseudocode, anything the author wants will work...
>> Or am I missing something in that article?
>
> Yes, this:
>
> "Let’s pretend that you’re building some kind of a web-based application
> [...]"
>
> The author describes a problem in a well-defined domain (web-based apps
> written in some dynamically-typed language similar in nature to
> VBScript) and presents a possible solution. Given the constraints, the
> solution he proposed is probably the best he could do.
Joel Spolsky did indeed define it as a web-based application, though the
nature of the language is not discussed. Since there are some tools like
AWS for building Web apps using Ada, I believe the _stated_ constraints
don't prohibit strong typing. (I can't rule out unstated constraints
along the lines you suggest)
Dynamic typing and scripting do not necessarily imply weak typing, though
they are usually used that way. There is even an Ada-based scripting
language as one counterexample.
> Like it or not, for many people switching to Ada is not a viable
> solution.
While I have to agree with that, I suspect that for many more, it might
be viable, but is automatically dismissed without consideration; this
article being just one example.
The article works AGAINST reliable software by dismissing not just Ada,
but strong typing in general. The fact that it does so by omission rather
than by discussion and disagreement helps foster ignorance; at least if
it said "the Ada approach is stupid because ... (see ref #) " at least it
would raise awareness and let the reader think, read further, and agree
or disagree as she saw fit.
Or the article could add "a strongly typed language would allow a better
solution using ... but this is all you get in C (VBScript, whatever),
so ..."
I do not know whether the author is to blame, or if he is genuinely
unaware of the power of a good type system. My point in this post is
simply that if people are unaware of a good thing, then there will be no
demand for it.
> Having said that, I agree that most of the security problems that plague
> the web-development ecosystem could be solved with a proper type system
> and static type-safety.
Or at least some type safety. Even in a well designed dynamic language,
type safety is possible. In the context of the example, let all the input
methods return UnsafeString (i.e. the base String class has no input
methods), the encode methods return String, then you simply (explicitly)
make the write methods reject UnsafeString.
It is of course possible that not all dynamic languages are well-designed.
- Brian
next prev parent reply other threads:[~2012-06-05 12:06 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
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 [this message]
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