[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.c++

Use cases for C++

Achim Schneider

10/19/2008 6:05:00 PM

I recently (6 months ago, that is) started to learn C++ because it's
needed in a significant number of job ads, now find my way around but
utterly lack routine. Besides doing boring exercises like "implement
that and that data structure clean and efficient", I feel that what I
really need to do is some sort of full-fledged (however small) program,
not something abstract. I do know C quite in-depth, though.

However, I can't think of a thing to do where I wouldn't choose Haskell
or Scheme before even considering C++, which may very well be because
my greater expertise in the former ones makes me blind for C++'s
strengths.

So, here's my question: What kind of program/project is C++'s home
turf, where you just can't get around using it on a big scale (that
is, excluding library interfaces and small amounts of generated code)?


PS: No, I'm not trying to start a flame war. I really don't know.

--
(c) this sig last receiving data processing entity. Inspect headers
for copyright history. All rights reserved. Copying, hiring, renting,
performance and/or quoting of this signature prohibited.
20 Answers

Erik Wikström

10/19/2008 7:37:00 PM

0

On 2008-10-19 20:05, Achim Schneider wrote:
> I recently (6 months ago, that is) started to learn C++ because it's
> needed in a significant number of job ads, now find my way around but
> utterly lack routine. Besides doing boring exercises like "implement
> that and that data structure clean and efficient", I feel that what I
> really need to do is some sort of full-fledged (however small) program,
> not something abstract. I do know C quite in-depth, though.
>
> However, I can't think of a thing to do where I wouldn't choose Haskell
> or Scheme before even considering C++, which may very well be because
> my greater expertise in the former ones makes me blind for C++'s
> strengths.
>
> So, here's my question: What kind of program/project is C++'s home
> turf, where you just can't get around using it on a big scale (that
> is, excluding library interfaces and small amounts of generated code)?

C++ can be used for just about anything you can think of, but the place
where you more or less have to use C++ (or C, or perhaps Ada) is system
programming or when targeting more "exotic" platforms where the runtimes
needed by more flashy languages do not exist. Or embedded systems where
resources are scarce, or when performance is required (most games are
written in C or C++).

--
Erik Wikström

Paavo Helde

10/19/2008 9:33:00 PM

0

Achim Schneider <barsoap@web.de> kirjutas:

> I recently (6 months ago, that is) started to learn C++ because it's
> needed in a significant number of job ads, now find my way around but
> utterly lack routine. Besides doing boring exercises like "implement
> that and that data structure clean and efficient", I feel that what I
> really need to do is some sort of full-fledged (however small) program,
> not something abstract. I do know C quite in-depth, though.
>
> However, I can't think of a thing to do where I wouldn't choose Haskell
> or Scheme before even considering C++, which may very well be because
> my greater expertise in the former ones makes me blind for C++'s
> strengths.
>
> So, here's my question: What kind of program/project is C++'s home
> turf, where you just can't get around using it on a big scale (that
> is, excluding library interfaces and small amounts of generated code)?

I believe C++ is for large projects. One can build up clean abstraction
layers to make the huge codebase managable. I believe Ada can do the
same, but Ada seems to be more possesive about holding the developer in
some predetermined playground, while C++ allows for multiple paradigmas
(even such as spaghetti code actually not suitable for large projects at
all ;-) So C++ lets one to develop oneself inside the frames of the
language, while other languages are more rigid.

I'm not very familiar with functional languages; as far as I have
understood the relative absence of side effects should also make them
scalable for large projects. However, it seems they don't fit so well
with the current CPU technology and apparently also neither with the
mental structure of many people.

That's only my personal opinion, certainly prejudiced and so on, so
should not be taken too seriously!

Paavo


Matthias Buelow

10/19/2008 10:54:00 PM

0

Achim Schneider wrote:

> So, here's my question: What kind of program/project is C++'s home
> turf, where you just can't get around using it on a big scale (that
> is, excluding library interfaces and small amounts of generated code)?

The one you want to burn most money on. C++ must be the least productive
language I've ever had the displeasure to come across.
On a different note, it's more or less the only choice for portable GUI
applications, because of wxWidgets and Qt, as long as you don't want to
use Java, that is.
If you know Scheme or Haskell well, you will weep.

Juha Nieminen

10/20/2008 4:11:00 PM

0

Achim Schneider wrote:
> However, I can't think of a thing to do where I wouldn't choose Haskell
> or Scheme before even considering C++, which may very well be because
> my greater expertise in the former ones makes me blind for C++'s
> strengths.

One strentgh C++ has over many other languages is that it allows you
to write programs which handle enormous amounts of data, applying
complicated heavy algorithms to them, as efficiently as possible,
consuming as little memory as possible, while still maintaining a fair
level of abstraction and high-quality design in your code.

I may be a bit biased in this subject because I have worked for years
in projects where speed and memory usage were absolute imperatives
(basically the more memory-efficient the program, the larger inputs it
could handle in the same computer, and thus the better). While C++ is
not the perfect language in all possible regards, I have found it to be
excellent for these types of applications.

For some reason the vast majority of programmers don't seem to be the
least concerned about the memory usage of their programs. Sure, most
programs simply don't need to worry about memory usage because they
simply don't handle that much data, and current computers have plenty of
memory. However, when you have to handle humongous amounts of data, then
memory usage optimization steps in big time. And of course if your
program can run the algorithm in 5 minutes rather than 5 hours, all the
better.

The great thing about C++ is that you usually are able to implement
these optimizations while keeping a high level of abstraction and
reusability.

Juha Nieminen

10/20/2008 4:12:00 PM

0

Matthias Buelow wrote:
> C++ must be the least productive
> language I've ever had the displeasure to come across.

Then you clearly haven't tried C.

(And don't believe *anything* C hackers will tell you. They are
delusional.)

Matthias Buelow

10/20/2008 4:16:00 PM

0

Juha Nieminen wrote:

>> C++ must be the least productive
>> language I've ever had the displeasure to come across.
>
> Then you clearly haven't tried C.

I don't think you'd like my answer. :)

Jeff Schwab

10/20/2008 4:40:00 PM

0

Achim Schneider wrote:
> I recently (6 months ago, that is) started to learn C++ because it's
> needed in a significant number of job ads, now find my way around but
> utterly lack routine. Besides doing boring exercises like "implement
> that and that data structure clean and efficient", I feel that what I
> really need to do is some sort of full-fledged (however small) program,
> not something abstract. I do know C quite in-depth, though.
>
> However, I can't think of a thing to do where I wouldn't choose Haskell
> or Scheme before even considering C++, which may very well be because
> my greater expertise in the former ones makes me blind for C++'s
> strengths.
>
> So, here's my question: What kind of program/project is C++'s home
> turf, where you just can't get around using it on a big scale (that
> is, excluding library interfaces and small amounts of generated code)?
>
>
> PS: No, I'm not trying to start a flame war. I really don't know.

C++ scales better than most (all?) other languages, it allows control
over arbitrarily low-level details, it runs blazingly fast, and it
supports the sort of semantic checks that other languages just can't
(because they don't have such powerful static type systems). The "home
turf" is when you want a single project to include many different levels
of abstraction, from compile-time metaprogramming to run-time bit
tweaking, all in the same language.

You can probably write most smallish programs much faster in more
dynamic languages than you can in C++, especially if you need features
that are provided by the libraries that ship with those languages. For
example, you can throw together a little GUI-driven text-processing
application with Python or Java in a matter of minutes. However, once
you get into the habit of writing even your small programs in C++ (and
following certain technical guidelines), you quickly find yourself with
a library of re-usable code that makes development easier and easier
over time. Whenever I try some other language (I had a Ruby kick a
couple of years ago), it seems simple and fun, right up to the point
where it gets too slow, or the abstraction mechanisms begin to break
down... Then I go back to C++, and wonder why I didn't just start with
it in the first place.

Bo Persson

10/20/2008 4:45:00 PM

0

Achim Schneider wrote:
> I recently (6 months ago, that is) started to learn C++ because it's
> needed in a significant number of job ads, now find my way around
> but utterly lack routine. Besides doing boring exercises like
> "implement that and that data structure clean and efficient", I
> feel that what I really need to do is some sort of full-fledged
> (however small) program, not something abstract. I do know C quite
> in-depth, though.
>
> However, I can't think of a thing to do where I wouldn't choose
> Haskell or Scheme before even considering C++, which may very well
> be because my greater expertise in the former ones makes me blind
> for C++'s strengths.
>
> So, here's my question: What kind of program/project is C++'s home
> turf, where you just can't get around using it on a big scale (that
> is, excluding library interfaces and small amounts of generated
> code)?
>
>
> PS: No, I'm not trying to start a flame war. I really don't know.

Have you checked out this list of major C++ applications?

http://www.research.att.com/~bs/applica...


Things like telecom, CAD, games, operating systems, compilers,
databases, web servers, and Java VMs :-)



Bo Persson


Carlo Milanesi

10/20/2008 8:53:00 PM

0

Matthias Buelow has written:
> Achim Schneider wrote:
>
>> So, here's my question: What kind of program/project is C++'s home
>> turf, where you just can't get around using it on a big scale (that
>> is, excluding library interfaces and small amounts of generated code)?

C++ is best suited for large system programming projects.
By "large", I mean that requires at least four developers working for at
least four years.
You can try to develop a device driver or a bytecode interpreter.

> The one you want to burn most money on. C++ must be the least productive
> language I've ever had the displeasure to come across.

Of course you never came across system programming languages.

> On a different note, it's more or less the only choice for portable GUI
> applications, because of wxWidgets and Qt, as long as you don't want to
> use Java, that is.

I think that C++ is not the best language to build portable GUI
application, and needless to say it is not the only one.
GUI application code is not standardized, hasn't tight speed and memory
requirements, and requires quick builds, so C++ doesn't shine for that
purpose.
It is a good language to implement a GUI toolkit (as wxWidgets or Qt),
though.

> If you know Scheme or Haskell well, you will weep.

There are many people who know Scheme or Haskell and don't weep when
using C++.

--
Carlo Milanesi
http://digilander.libero.i...

Alan Ferris

1/19/2013 11:22:00 AM

0

On Sat, 19 Jan 2013 08:01:10 +0000, Alex W <ingilt@yahoo.co.uk> wrote:

>On Thu, 17 Jan 2013 21:56:10 -0800, Jason wrote:
>
>
>> I'll try again:
>>
>> Should we have armed guards in public schools? yes or no
>
>No.
>
>It fosters an atmosphere of fear in a place where there
>should be nothing but trust.
>
>It is expensive.
>
>It didn't work in Columbine, so what makes you think it
>would work anywhere else?
>
>Deflect the atrocity from schools, and what other target
>will they find?

Case recently where the guard just left his gun unattended in a rest room in
the school.
--
Ferrit

()'.'.'()
( (T) )
( ) . ( )
(")_(")
Atheist #1211
EAC(UK)#252 Ironic Torture Div.

SERV:
http://www.youtube.com/watch?v=W...
https://www.youtube.com/watch?v=D...
https://www.youtube.com/watch?v=6...