Re: Objects
From: Chris \( Val \) (chrisval_at_bigpond.com.au)
Date: 11/11/03
- Next message: Chris \( Val \): "Re: Objects"
- Previous message: Martijn Lievaart: "Re: vector<int> fillVector(int arguments ...)"
- In reply to: jeffc: "Re: Objects"
- Next in thread: jeffc: "Re: Objects"
- Reply: jeffc: "Re: Objects"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 11 Nov 2003 22:02:48 +1100
"jeffc" <nobody@nowhere.com> wrote in message news:3fafbc26_1@news1.prserv.net...
|
| "Chris ( Val )" <chrisval@bigpond.com.au> wrote in message
| news:bohpaq$1f3gin$1@ID-110726.news.uni-berlin.de...
| >
| >
| > --------------------------------------------------------
| > - which is called an object
| > --------------------------------------------------------
| > This is the one I think you have the most difficulty
| > accepting - if I may say. I think you are getting too
| > technical, in that you're proposing that a technical
| > answer is required here, rather than a generalisation.
|
| I see your point, but remember - the OP was asking us to get technical.
|
| > I think what really matters here, is the way we discuss and
| > communicate what an object actually represents, and that is
| > the kind of laymans terms I think the author was using.
|
| That's fine, but that's not really the point.
What you have to remember, is that there *is no one book*
that will teach you 'C++' - you use (in theory), one book
as a stepping stone to the next - the next one being more
technically accurate, and of course more tersely written
than the previous one you studied through.
Do you honestly expect the one book to answer(technically),
every single aspect of the language ? - I doubt it. Such a
book would be five bricks thick <g>.
Not only that, do you think that a newbie could really
understand a technically accurate, but terse to read book ?
No way...This thread is proof of that in itself.
A newbie *requires* a little generalisation, to form an
image of the concept in his or her mind - that won't
happen too easily with a technical read.
| I have no problem with an author being a little loose with
| the language, if understanding would be lost by being too
| technical. But in this case someone came here and specifically
| asked about the precise meaning of an author being loose with
| the language. It's time to fish or cut bait. The OP wants
| some empathy, and he gets it from me. I stand by what I said -
| the author's statement is misleading at best and dead wrong at
| worst. There is no other way the OP is going to get a meaningful
| answer to his question if you answer it any other way.
I think your assumption of the authors statement
(if correctly quoted), is indeed to harsh - writing
technical books is not easy.
FWIW, I had a very quick look through my copy of
the C++ Standard, and here is what I found - take
particular note of the way an object can be created,
as in 3.1...
1.8 The C + + object model
--------------------------
The constructs in a C ++ program create, destroy,
refer to, access, and manipulate objects. An object
is a region of storage. [Note: A function is not an
object, regardless of whether or not it occupies
storage in the way that objects do. ]
An object is created by a definition (3.1), by a
new-expression (5.3.4) or by the implementation
(12.2) when needed. The properties of an object
are determined when the object is created.
Now, let's see what 3.1 says...
3.1 Declarations and definitions
--------------------------------
[Example: all but one of the following are definitions:
int a; // defines a
extern const int c = 1; // defines c
int f(int x) { return x+a; } // defines f and defines x
struct S { int a; int b; }; // defines S, S::a, and S::b
struct X { // defines X
int x; // defines nonstatic data member x
static int y; // declares static data member y
X(): x(0) { } // defines a constructor of X
};
int X::y = 1; // defines X::y
enum { up, down }; // defines up and down
namespace N { int d; } // definesN and N::d
namespace N1 = N; // defines N1
X anX; // defines anX
You will note here, that the structure(class) 'X',
is a definition. Therefore, if an object is created
via one of the above three methods(a definition being
one of them), what do you call 'X' ?
Is this correct, or is this misleading ?
Also note, the standard document has many generous
sprinklings of the word object throughout its pages,
that do not necessarily mean one that has been
instantiated into memory - even though I accept that
to be the case.
Cheers.
Chris Val
- Next message: Chris \( Val \): "Re: Objects"
- Previous message: Martijn Lievaart: "Re: vector<int> fillVector(int arguments ...)"
- In reply to: jeffc: "Re: Objects"
- Next in thread: jeffc: "Re: Objects"
- Reply: jeffc: "Re: Objects"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|