L
Lynn McGuire
I'm glad I'm not writing those articles just for myself...
Congrats on an interesting topic to this forum.
Lynn
I'm glad I'm not writing those articles just for myself...
gwowen said:Really? What does .at() do?
Are you suggesting C++ doesn't allow OOP?
Which optimisation? Early binding is done where possible,
late binding is done where necessary. Where's the
optimisation.
Really? What does .at() do?
Nobody said:Really? What does .at() do?
Checks vector indices. Vectors aren't arrays (and the default
indexing operation, operator[], doesn't do bounds-checking).
Michael Doubez said:Are you talking about "name binding" vs "early bound method call" or
"compile time" vs "run time" ?
I wonder how many times C++ is chosen for its performances;
do you have numbers ?
Design decision in C++ are usually decided in favor of
run-time efficiency.
Since this optimization is /always/ done, by pure /choice of
the language/, it can be called premature.
In 2003, I asked Alan Kay, who coined the term
»object-oriented programming«, what this means.
He kindly answered:
»OOP to me means only messaging, local retention and
protection and hiding of state-process, and extreme
late-binding of all things. It can be done in Smalltalk
and in LISP. There are possibly other systems in which
this is possible, but I'm not aware of them.«
http://www.purl.org/stefan_ram/pub/doc_kay_oop_en
Joshua Maurice said:Do you have a source or citation of some kind for this quote, where it
was first said? I'm just kind of curious curious for no particular
reason at all.
For example, Java has decided to check array indices
at runtime, C++ not to.
Really? What does .at() do?
Checks vector indices. Vectors aren't arrays (and the default
indexing operation, operator[], doesn't do bounds-checking).
Err, exactly what makes it *default*?
For example, Java has decided to check array indices
at runtime, C++ not to.
Really? What does .at() do?
Checks vector indices. Vectors aren't arrays (and the default
indexing operation, operator[], doesn't do bounds-checking).Err, exactly what makes it *default*?
It's the "natural" indexing operation. The one that has dedicated syntax
rather than being a normal method. The one you'll end up using if you
convert C code to C++ with minimal re-writing.
Stefan said:Design decision in C++ are usually decided in favor of
run-time efficiency.
For example, Java has decided to check array indices
at runtime, C++ not to.
»Learning C++ is equivalent to studying to be a NASA
test pilot. Its incredibly fast and effective, but takes
years to master the arcania and things tend to blowup in
your face if you're not very careful.«
»I would rather compare it to learning how to drive a
racecar: yes, it can be fast. Most people tend to drive
it off track right away. Some people die in it.«
OOP: bind as /late/ as possible
C++: bind as /early/ as possible (generic programming)
Since this optimization is /always/ done, by pure /choice of
the language/, it can be called premature.
Nobody said:Premature optimisation means performing "optimisations" before you have
sufficient knowledge to determine what is actually optimal.
Stefan said:My source is
Message-ID: <[email protected]>
From: (e-mail address removed) (Shinji Ikari)
Newsgroups:
comp.theory.cell- automata,comp.lang.java.advocacy,comp.lang.scheme,comp.lang.misc
Subject: Re: Cellular automata benchmarks: Java vs C++ vs Java vs C++
Date: 22 Jul 2003 22:33:27 -0700
Nobody said:It's the "natural" indexing operation. The one that has dedicated syntax
rather than being a normal method. The one you'll end up using if you
convert C code to C++ with minimal re-writing.
It's the "natural" indexing operation. The one that has dedicated syntax
rather than being a normal method.
The one you'll end up using if you convert C code to C++ with minimal re-writing.
No, it doesn't LOOK like an array index. Nevertheless, it *is* an
array index. And offering a checked and unchecked indexing
I'm fairly confident that it is a method of a class. I wouldn't be
surprised to find out that C++ was Turing Complete.
As operator overloading amounts to nothing more than syntax sugar,
Nobody said:Also, arrays don't have .at(), so if you want to write code which works
with either vectors or arrays, subscript notation is the only option.
Checks vector indices. Vectors aren't arrays (and the default
indexing operation, operator[], doesn't do bounds-checking).
Err, exactly what makes it *default*?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.