Re: It Hurts When I Do This
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Fri, 18 Apr 2008 09:27:27 -0700
GaryScott <garylscott@xxxxxxxxxxxxx> wrote:
http://softwareblogs.intel.com/2008/03/31/doctor-it-hurts-when-i-do-this/
I don't think I've seen that article before, but I think it is well done
(as I'd expect from Steve). I also quite agree with its points.
But we NEED a syntax that means "the entire array". Code should be
self documenting.
We do have a syntax that means the entire array - the array name. True,
the syntax doesn't directly tell you that it is an array, but it does
tell you that it is the entire of whatever the thing so named is
declared to be.
While I'm a big fan of writing clear and largely self-documenting code,
I disagree that it helps to use a special notation to indicate that
something is an array. Why pick on arrayness in particular? Down that
path lies special notations for all attributes. Might as well go back to
implicit typing, and disallow overriding the implicit type; then you can
look at the variable name and know the type.
Let's throw in conventions for all the other attributes as well. We need
a syntax that tells you that something is the whole of a derived type.
So as not to pick only on the "newfangled" f90 features, don't we need a
syntax to tell you that something is all of a complex variable? Etc.
Heck, let's throw out all declarations and encode everything in the
syntax of referencing a variable. Seems to me like it is the same
principle.
I think it a mistake to throw all this kind of thing in the language.
They aren't adding extra functionality - just notational convention. I
don't see the point in picking on arrays in partucular.
To the extent that one is just looking for a notational convention, we
already have something suitable in the language. You've noted it; the
variable name. Yes, it is up to the programmer has to select appropriate
names. But then it would also be up to the programmer to use any such
new language syntax... unless you incompatibly made it mandatory,
invalidating all existing code that uses whole arrays.
--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.
- Follow-Ups:
- Re: It Hurts When I Do This
- From: GaryScott
- Re: It Hurts When I Do This
- References:
- It Hurts When I Do This
- From: GaryScott
- It Hurts When I Do This
- Prev by Date: Re: generic interface real function vs real
- Next by Date: Re: It Hurts When I Do This
- Previous by thread: It Hurts When I Do This
- Next by thread: Re: It Hurts When I Do This
- Index(es):
Relevant Pages
|