Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > is C++ worth it ?

Reply
Thread Tools

is C++ worth it ?

 
 
Lynn McGuire
Guest
Posts: n/a
 
      07-27-2012
Is C++ worth it ?
http://lemire.me/blog/archives/2012/...s-cc-worth-it/

"But we are also moving away from low-level programming
and, yet, our software is still getting faster. I believe
that a major understated trend in the last decade or so
has been the increase in performance of the higher level
languages."

I disagree.

Lynn
 
Reply With Quote
 
 
 
 
Cholo Lennon
Guest
Posts: n/a
 
      07-27-2012
On 27/07/2012 12:37, Lynn McGuire wrote:
> Is C++ worth it ?
> http://lemire.me/blog/archives/2012/...s-cc-worth-it/
>
> "But we are also moving away from low-level programming
> and, yet, our software is still getting faster. I believe
> that a major understated trend in the last decade or so
> has been the increase in performance of the higher level
> languages."
>
> I disagree.
>


I agree with one of the comments:

"Please stop posting misleading microbenchmarks like these. Your
methodology is not rigid and your benchmark is 3 lines of code. The
whole loop might be replaced with a nop if the array doesn’t escape."

Also the author doesn't have a good answer to it.

Internet is full of this type of biased / non scientific tests

Best regards

--
Cholo Lennon
Bs.As.
ARG
 
Reply With Quote
 
 
 
 
Chris Gordon-Smith
Guest
Posts: n/a
 
      07-27-2012
Lynn McGuire <(E-Mail Removed)>:
> Is C++ worth it ?
> http://lemire.me/blog/archives/2012/...s-cc-worth-it/
>
> "But we are also moving away from low-level programming


I don't think of C++ as low level. I think of it as a language that
supports programming in terms of the concepts of the problem domain.
Oh, and yes, you can program in bits and bytes when needed.

Chris Gordon-Smith
www.simsoup.info
 
Reply With Quote
 
Jorgen Grahn
Guest
Posts: n/a
 
      07-27-2012
On Fri, 2012-07-27, Lynn McGuire wrote:
> Is C++ worth it ?
> http://lemire.me/blog/archives/2012/...s-cc-worth-it/
>
> "But we are also moving away from low-level programming
> and, yet, our software is still getting faster. I believe
> that a major understated trend in the last decade or so
> has been the increase in performance of the higher level
> languages."
>
> I disagree.


It's a weird read, mostly because his implicit assumption is that Java
is a "higher level" language and C++ is not. What's so high about
Java -- garbage collection?

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
 
Reply With Quote
 
Juha Nieminen
Guest
Posts: n/a
 
      07-28-2012
Jorgen Grahn <(E-Mail Removed)> wrote:
> It's a weird read, mostly because his implicit assumption is that Java
> is a "higher level" language and C++ is not. What's so high about
> Java -- garbage collection?


There's a close almost 1-to-1 correspondence between C++ statements and
their equivalent assembler opcodes (with only a few exceptions, an
ironic example being, precisely, exceptions, which are not direct asm
constructs but are much higher concepts).

The correspondence between Java statements and asm opcodes is significantly
less straightforward. For example, one could hastily think that references
in Java are just asm memory addresses (like the references/pointers in C++),
but in fact they aren't. Java references are much more abstract than that.
(As an example of how abstract Java references are, they allow for automatic
behind-the-scenes memory compaction without the program even noticing. The
same is just impossible in C++ because references/pointers are literal
memory addresses, and memory compaction is basically impossible without
breaking the program.)

Also, the runtime environment where Java programs are run is (or at least
can be made to be) more akin go a virtualized environment than running the
program "raw". For example, if you made your own "Java compiler" that tried
to break some assertions made by the language specifications, the RTE can
catch it and refuse to run your program. (For example, if you tried to
make references that access illegal memory, or perform some other non-Java
weirdness such as pointer arithmetic, the RTE can catch such attempts and
stop the program before it wreaks havoc.)

As both hardware and compiler technology has advanced during the decades,
these security measures, including also such things as garbage collection,
cause less and less overhead to the actual execution times of the programs.

In C++ this would be much more difficult to implement and impose because
of the semantics of the language.
 
Reply With Quote
 
Juha Nieminen
Guest
Posts: n/a
 
      07-28-2012
Cholo Lennon <(E-Mail Removed)> wrote:
> I agree with one of the comments:
>
> "Please stop posting misleading microbenchmarks like these. Your
> methodology is not rigid and your benchmark is 3 lines of code. The
> whole loop might be replaced with a nop if the array doesn???t escape."


I also agree. Comparing two languages with a two-line "benchmark" is
completely *******s. It says absolutely nothing about anything.

When comparing languages for actual projects, there are many more important
questions than "which one can optimize a tight loop better?", such as:

- Does the language allow me to implement this project?
- How easily does it allow me to do that?
- How much effort is needed to implement the project, including writing the
actual implementation, and debugging it?
- What libraries and ready-made utilities does the language offer? How easy
are they to use?
- How safe is the language? How likely is it for a hidden bug to be uncaught
in testing, get to a release version, and then causing severe harm to the
user's system?
- If the application requires efficiency, how efficient is the code generated
with the programming language?

All those question are highly subjective, and there's no way to objectively
and unambiguously "measure" them.
 
Reply With Quote
 
Jorgen Grahn
Guest
Posts: n/a
 
      07-28-2012
On Sat, 2012-07-28, Juha Nieminen wrote:
> Jorgen Grahn <(E-Mail Removed)> wrote:
>> It's a weird read, mostly because his implicit assumption is that Java
>> is a "higher level" language and C++ is not. What's so high about
>> Java -- garbage collection?

>
> There's a close almost 1-to-1 correspondence between C++ statements and
> their equivalent assembler opcodes


That definition of higher-level didn't come to mind. But yes, I
suppose that's what the author was thinking of.

I was thinking more of the mapping between code and my design, problem
domain and terminology -- the smaller the gap is there, the better.

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
 
Reply With Quote
 
Gerald Breuer
Guest
Posts: n/a
 
      07-28-2012
C++ has a lot of unnecessary complexity, but it is both:
low-level as well as high-level.
 
Reply With Quote
 
Seungbeom Kim
Guest
Posts: n/a
 
      07-28-2012
On 2012-07-28 04:36, Juha Nieminen wrote:
>
> There's a close almost 1-to-1 correspondence between C++ statements and
> their equivalent assembler opcodes (with only a few exceptions, an
> ironic example being, precisely, exceptions, which are not direct asm
> constructs but are much higher concepts).


That surprises me when I recall that, even without exceptions, a benign-
looking plus operator or even an absence of a statement can emit dozens
of instructions, due to operator overloading and constructors/destructors.

--
Seungbeom Kim
 
Reply With Quote
 
Juha Nieminen
Guest
Posts: n/a
 
      07-29-2012
Gerald Breuer <(E-Mail Removed)> wrote:
> C++ has a lot of unnecessary complexity


Care to give some examples?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Worth buying modem router? =?Utf-8?B?QmFkQW5nbGVy?= Wireless Networking 2 07-05-2005 02:33 PM
How much is Bill worth right now? Me_and_you ASP .Net 18 02-12-2005 03:21 AM
Market worth? Nickolas Microsoft Certification 2 12-10-2004 12:06 AM
Is it worth it? Russ McKenna ASP .Net 5 12-06-2003 06:47 PM
MCSE Cert. Is it still worth it? Dominique Feteau Microsoft Certification 3 11-05-2003 08:43 PM



Advertisments