What kind of problems is c++ best at solving?

J

Jeff Schwab

nb said:
What kind of problems is c++ best at solving?

Complicated ones. The more broadly defined the problem, the more
advantage you get from using C++.

In D&E, Stroustrup says C++ never was intended to be "best" at any
particular task. However, it should be at least second-best at almost
anything. For string manipulation, you might want a particular
scripting language, e.g. Perl. For frequent calculations involving
large arrays of numbers, Fortran may be your first choice. However, if
you have to tackle a problem that involves both string manipulation and
vector mathematics, I don't know of a more appropriate language than C++.

-Jeff
 
W

Wouter Lievens

Jeff Schwab said:
Complicated ones. The more broadly defined the problem, the more
advantage you get from using C++.

In D&E, Stroustrup says C++ never was intended to be "best" at any
particular task. However, it should be at least second-best at almost
anything. For string manipulation, you might want a particular
scripting language, e.g. Perl.

Are you considering expressiveness or performance?
I don't know why C++ would score less in string manipulation performance
than Perl would...
For frequent calculations involving
large arrays of numbers, Fortran may be your first choice. However, if
you have to tackle a problem that involves both string manipulation and
vector mathematics, I don't know of a more appropriate language than C++.

-Jeff

Microsoft Visual Basic tends to be better!




(I hope it is realised that I am kidding)
 
J

Jeff Schwab

Wouter said:
Are you considering expressiveness or performance?

Expressiveness, assuming performance to be roughly equal.
I don't know why C++ would score less in string manipulation performance
than Perl would...

Then you don't really know Perl. :) Seriously, as the quality of C++
regex libraries improves, they certainly have the potential to become
faster than Perl. For the time being, though, I'm not sure. It would
be difficult to right code optimized for pattern-searching the way Perl is.
Microsoft Visual Basic tends to be better!




(I hope it is realised that I am kidding)

You almost gave me a heart-attack. I was about to go on a rant the
likes of which have not been seen in many a year.

-Jeff
 
R

Ray Gardener

I believe Stroustrup said that C++ was more suited
(than C, anyway) for systems programming, or
for programming "in the large".

fwiw, I have certainly found that to be the case
in my own experience transitioning from C to C++.

Ray
 

Ask a Question

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.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top