By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,905 Members | 879 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,905 IT Pros & Developers. It's quick & easy.

C++: inherent conflict

P: n/a
Hi,

Question: Why is there an inherent conflict between uncompromising
efficiency and portability in C++?
Regards
WD

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.504 / Virus Database: 302 - Release Date: 24/07/2003
Jul 19 '05 #1
Share this Question
Share on Google+
12 Replies


P: n/a
Web Developer wrote:
Hi,

Question: Why is there an inherent conflict between uncompromising
efficiency and portability in C++?


Homework?

I'm not aware of such a conflict. And the importance of efficiency is
very overstated most of the time. Good design is much more important and
offers more advantages. What good is a fast program if it's buggy, late,
and impossible to maintain? On the other hand, a well-designed program
can be optimized more easily (assuming there's a need - well-designed
software should be very efficient from the start), and can be ported to
faster hardware if needed. Good design gives (nearly) the best of all
worlds. *That* should be your focus, not efficiency.

-Kevin

Jul 19 '05 #2

P: n/a

"Web Developer" <no****@hotmail.com> wrote in message
news:3f********@news.iprimus.com.au...
Hi,

Question: Why is there an inherent conflict between uncompromising
efficiency and portability in C++?
Regards
WD


Whenever you take an uncompromising position you are asking for conflict,
that's life isn't it?

All languages have a conflict between efficiency and portablility, because
programs must run in different environments. They can be made efficient for
one particular environment but only at the cost of being less efficient or
unportable on a different environment.

john
Jul 19 '05 #3

P: n/a
On Thu, 31 Jul 2003 16:23:49 +0930, "Web Developer"
<no****@hotmail.com> wrote:
Hi,

Question: Why is there an inherent conflict between uncompromising
efficiency and portability in C++?


There isn't. It is easy to write code that is both portable and
efficient in C++.

Tom
Jul 19 '05 #4

P: n/a
Hi,

Question: Why is there an inherent conflict between uncompromising
efficiency and portability in C++?


There isn't. It is easy to write code that is both portable and
efficient in C++.

Tom


Unless it's a trick question, which i doubt very much, then your seriously
mistaken.

What do you understand by the term portable? maybe thats your confusion.
WD

Jul 19 '05 #5

P: n/a


Web Developer wrote:

Hi,

Question: Why is there an inherent conflict between uncompromising
efficiency and portability in C++?

That's a nice sweeping statement. What does it mean? Please back it up
with real examples.


Brian Rodenborn
Jul 19 '05 #6

P: n/a
Web Developer wrote:

Hi,

Question: Why is there an inherent conflict between uncompromising
efficiency and portability in C++?

That's a nice sweeping statement. What does it mean? Please back it up
with real examples.


Don't know what it means thats why I asked it.
WD

Jul 19 '05 #7

P: n/a
"Web Developer" <no****@hotmail.com> wrote...
Web Developer wrote:

Hi,

Question: Why is there an inherent conflict between uncompromising
efficiency and portability in C++?

That's a nice sweeping statement. What does it mean? Please back it up
with real examples.


Don't know what it means thats why I asked it.


You're contradicting yourself. You asked "why <something>", thus
implying that you already accepted the existence of <something>,
and are now looking for reasons. Now you're backing out of your
own statement by saying that you don't understand what <something>
means. It's like if I asked "why can crayfish fly?" It is not
possible to answer because it is built on a wrong preposition (that
crayfish can fly). The same with your question. First you show
us what is the "inherent conflict", prove to us it exists, then we
can speculate for the reasons for it to exist. Capisce?
Jul 19 '05 #8

P: n/a
"Victor Bazarov" <v.********@attAbi.com> wrote in message news:<vi************@corp.supernews.com>...
"Web Developer" <no****@hotmail.com> wrote...
>Question: Why is there an inherent conflict between uncompromising
>efficiency and portability in C++?

There isn't. It is easy to write code that is both portable and
efficient in C++.


Unless it's a trick question,


There is no question in Tom's two sentences. Unless yours was
a trick question...


It seems fairly obvious that the original question was a homework
assignment in which case there's always the possibility that the
instructor gave a "trick question", i.e., one with a deliberately
false premise.

More likely, though, the instructor actually believes there is
such an inherent confict between efficiency and portability.

The instructor is probably thinking of cross-platform libraries
vs. platform-specific APIs, but this is (1) outside the scope
of standard C++, (2) not an issue for all applications, (3) not
necessarily true even in this more limited context (i.e.,
"high level" != "inefficient"), and (4) probably bad advice for
most programmers (i.e., premature optimization).

My advice to the original poster is this. If you want to please
your instructor, review your notes (or someone else's if you
haven't been attending class -- shame one you!), and parrot
whatever half-truths your instructor has passed off on you.

On the other hand, if you want to actually learn, then don't
just ask for a quick answer. Try to answer it yourself. Look for
gaps in your understanding (e.g., "what does portability mean?")
then read and/or search the internet to find answers. Ask probing
questions of yourself. Read the FAQs for relevant newsgroups.
(Note the plural. Just because you're programming in C++ doesn't
make every question a C++ question.) If you do all that and still
can't figure something out, post a specific question to an
appropriate newsgroup.
Jul 19 '05 #9

P: n/a


Web Developer wrote:
Web Developer wrote:

Hi,

Question: Why is there an inherent conflict between uncompromising
efficiency and portability in C++?

That's a nice sweeping statement. What does it mean? Please back it up
with real examples.


Don't know what it means thats why I asked it.

That is NOT what you asked. You asked why is there an inherent conflict,
not whether there is an inherent conflict. From the other post about not
getting "hello world" to work, I think you should concentrate on
learning the language first rather than philosophical questions. You
have a lot of work ahead of you.


Brian Rodenborn
Jul 19 '05 #10

P: n/a
> > > Web Developer wrote:
>
> Hi,
>
> Question: Why is there an inherent conflict between uncompromising
> efficiency and portability in C++?
That's a nice sweeping statement. What does it mean? Please back it up
with real examples.


Don't know what it means thats why I asked it.


You're contradicting yourself. You asked "why <something>", thus
implying that you already accepted the existence of <something>,
and are now looking for reasons. Now you're backing out of your
own statement by saying that you don't understand what <something>
means. It's like if I asked "why can crayfish fly?" It is not
possible to answer because it is built on a wrong preposition (that
crayfish can fly). The same with your question. First you show
us what is the "inherent conflict", prove to us it exists, then we
can speculate for the reasons for it to exist. Capisce?


Capisce.

The question was extracted from a book which will remain nameless for the
time being. I don't believe it was intended to be a trick question. Anyway,
I didn't get the concept so I posted it here.

I believe there is an inherent conflict between efficiency and portability
in C++. The primary goal of C++ is to create efficient executable programs.
In order to achieve this, C++ programs must be compiled into machine
language (platform dependant), which is not portable to different
architectures. My answer is similair to the first response I got from my
original post. The rest seem to have misunderstood the nature and meaning of
the question and have gone off on a tangent.
WD


Jul 19 '05 #11

P: n/a
"Web Developer" <no****@hotmail.com> wrote in message
news:3f********@news.iprimus.com.au...
> Web Developer wrote:
> >
> > Hi,
> >
> > Question: Why is there an inherent conflict between uncompromising
> > efficiency and portability in C++?
>
>
> That's a nice sweeping statement. What does it mean? Please back it up
> with real examples.

Don't know what it means thats why I asked it.


You're contradicting yourself. You asked "why <something>", thus
implying that you already accepted the existence of <something>,
and are now looking for reasons. Now you're backing out of your
own statement by saying that you don't understand what <something>
means. It's like if I asked "why can crayfish fly?" It is not
possible to answer because it is built on a wrong preposition (that
crayfish can fly). The same with your question. First you show
us what is the "inherent conflict", prove to us it exists, then we
can speculate for the reasons for it to exist. Capisce?


Capisce.

The question was extracted from a book which will remain nameless for the
time being. I don't believe it was intended to be a trick question. Anyway,
I didn't get the concept so I posted it here.

I believe there is an inherent conflict between efficiency and portability
in C++. The primary goal of C++ is to create efficient executable programs.
In order to achieve this, C++ programs must be compiled into machine
language (platform dependant), which is not portable to different
architectures. My answer is similair to the first response I got from my
original post. The rest seem to have misunderstood the nature and meaning of
the question and have gone off on a tangent.


You don't know what it(whatever it is) means, but you believe it
should be something in your imagination? It's just pointless.
You'd better tell what's in your mind clearly instead of asking
for other's opinion on a statement from a mysterious book.

--
ES Kim
Jul 19 '05 #12

P: n/a
> >Capisce.

The question was extracted from a book which will remain nameless for the
time being. I don't believe it was intended to be a trick question. Anyway,I didn't get the concept so I posted it here.

I believe there is an inherent conflict between efficiency and portabilityin C++. The primary goal of C++ is to create efficient executable programs.In order to achieve this, C++ programs must be compiled into machine
language (platform dependant), which is not portable to different
architectures. My answer is similair to the first response I got from my
original post. The rest seem to have misunderstood the nature and meaning ofthe question and have gone off on a tangent.


This isn't what portability means in language terms. C++ is
source-code portable. You can take the same (efficient) source code,
and compile it on and for different machines, from mainframes to
washing machines.

Tom


You are right. This means there is something seriously wrong with this
question (from which I extracted from a c++ book).
WD
Jul 19 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.