Re: Overflowing a Long
- From: "Robert Morley" <rmorley@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 6 Mar 2007 15:21:35 -0500
It really couldn't be simpler! That's the point.
Open [filename] For [usage] As [handle]
Maybe you had to "grow up" on a command line to appreciate the clarity
there?
Nice theory, but I *did* grow up on a command-line. My first exposure to
computers was in '77, and it was a TRS-80 as I remember it.
For me, a MUCH more elegant solution would be somewhat similar to ADO's
handling of recordsets:
With MyFile
.OpenMode = ReadWrite
.Sharing = LockReadWrite
.Open "filename"
End With
....and dispense with what I consider to be the utterly archaic notion of
file handles (or at least it's archaic in the sense of a properly developed
4GL; for something like lower-level API calls, obviously you'd still need
them).
I see it as *far* superior to any sort of object-based method, for both
ease of use and comprehension. Any student programmer can grasp the
fundamentals of this syntax in the first week of courses.
We obviously see it differently, then. It seems that you see beauty where I
see The Hunchback of Notre Dame. And I've seen no end of student
programmers who've looked at the syntax and run fleeing. Perhaps, as you
say, it's because most of them ARE younger than you or I, but they don't see
it as intuitive in any way.
the Print #, Get # and similar statements aren't exactly tidy in some ofThey're pretty danged straight-forward, too.
their permutations either.
Are you also a C programmer, by any chance? I've had any number of C
programmers try to convince me that it's not cryptic either. I'll grant
that in and of themselves, the commands are easy enough, though I would've
preferred something like "MyFile.Output MyString" to "Print #MyFile,
MyString", but I find the distinction between things like Input #/Line Input
#/Get # and Print #/Write #/Put # to be a little esoteric. And I won't even
get into the less-commonly used commands like Width #. I suppose it's a
convenient enough command, but I'm of the opinion that the programmer should
be doing that portion of the work, not the file system.
Only for accomplished snobs. For beginners, that means they need to spend
*weeks*, at least, getting up to speed before they can even begin to
accomplish anything useful.
Here again, I couldn't disagree with you more. My "With MyFile" example is
what I think *most* programmers would consider intuitive unless they think
strictly in terms of 3GLs or even machine language.
Not to mention, file i/o is the *last* place you want to introduce
unnecessary overhead. So objects are inherently inefficient, in addition
to being opaque. Toss newbs into the mix, and you have just prescribed a
royal mess.
Objects are not inherently inefficient (well, okay, maybe if you're working
in VB.NET), and to say that they're opaque is oxymoronic to me. To me, and
I *think* most people who learned programming in the last few decades,
objects by their nature are more intuitive than 3GL/command-line style
commands. And speed-wise, if the object is well-designed and built into the
basic structure of the language, there should be no noticeable difference
between the two. At the lowest level, it gets compiled into a function call
with parameters either way. There might be a lookup table or something of
that nature involved for an object's methods, but the indirection there
wouldn't even take a nanosecond on any computer built within the last decade
or so.
In short, I would guess that you probably started programming even earlier
than I did, and thus you're more deeply entrenched in the programming style
of command lines and third-generation languages. While I learned on those
and 65xx assembly language and the like, my "natural" thought processes lean
more towards OOP. By the same token, however, I can see where my background
comes into play, as I have significant difficulty with some of the VB.NET
structures and programming styles. After all, who ever heard of calling
methods or looking at properties of primitive data types? :)
Rob
.
- Follow-Ups:
- Re: Overflowing a Long
- From: Karl E. Peterson
- Re: Overflowing a Long
- References:
- Re: Overflowing a Long
- From: Michael C
- Re: Overflowing a Long
- From: Mike Williams
- Re: Overflowing a Long
- From: Michael C
- Re: Overflowing a Long
- From: Mike Williams
- Re: Overflowing a Long
- From: Michael C
- Re: Overflowing a Long
- From: Karl E. Peterson
- Re: Overflowing a Long
- From: Michael C
- Re: Overflowing a Long
- From: Bob O`Bob
- Re: Overflowing a Long
- From: Robert Morley
- Re: Overflowing a Long
- From: Karl E. Peterson
- Re: Overflowing a Long
- From: Robert Morley
- Re: Overflowing a Long
- From: Karl E. Peterson
- Re: Overflowing a Long
- Prev by Date: Re: There seems to be a bug in Vista's file sharing that causes the ADO Database open command to hang if the database is open on the host computer.
- Next by Date: Re: how to get back to the MIDFORM menu
- Previous by thread: Re: Overflowing a Long
- Next by thread: Re: Overflowing a Long
- Index(es):
Relevant Pages
|