Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > C or C++ something else....

Reply
Thread Tools

C or C++ something else....

 
 
vadam17@hotmail.com
Guest
Posts: n/a
 
      09-29-2006
Thanks for your answers.
I already know programming in Java and I am starting studying the
perl. I would like to learn C or C++ but I need someone to tell me
the + and - of each one. I have noticed that every computer exploit
and almost every linux program is builted in C why is that? Because
they just know to program in C or C is better for that kind of
programs and why? Can somebody give an example of big project that
you can achive with C and you cant with C++ or vice versa? Also can
somebody suggest me a book for both of them ! (I dont want something
for begginers i want something to be as much complete book as it can
be, with all the topics you need to know for a programming language
.)Sorry for the number of the questions but i am a little bit
confused.
Thanks one more time



--
--------------------------------- --- -- -
Posted with NewsLeecher v3.7 Final
Web @ http://www.newsleecher.com/?usenet
------------------- ----- ---- -- -

 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      09-29-2006
Big-Goofy wrote:
> Thanks for your answers.
> I already know programming in Java and I am starting studying the
> perl. I would like to learn C or C++ but I need someone to tell me
> the + and - of each one.


I hope you're not blind and should see the two pluses in C++... I
don't see any minuses there, do you? Neither does C have any minuses.
It just doesn't have any pluses, that's all.

> I have noticed that every computer exploit


Is that what you're trying to get into?

> and almost every linux program is builted in C why is that? Because
> they just know to program in C or C is better for that kind of
> programs and why? Can somebody give an example of big project that
> you can achive with C and you cant with C++ or vice versa?


Find Bjarne Stroustrup's home page and read all of it.

> Also can
> somebody suggest me a book for both of them ! (I dont want something
> for begginers i want something to be as much complete book as it can
> be, with all the topics you need to know for a programming language
> .)Sorry for the number of the questions but i am a little bit
> confused.


Just Google for book suggestions. It's getting really old. Show us
that you're ready to learn either of the languages by applyting some
effort to collecting information.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


 
Reply With Quote
 
 
 
 
Phlip
Guest
Posts: n/a
 
      09-29-2006
Big-Goofy wrote:

> I already know programming in Java and I am starting studying the
> perl.


I have used Perl for years, and come to the conclusion that its author,
Larry Wall, must be a very fast, accurate typist.

Download Ruby to see how clean and elegant a language can get!

> I would like to learn C or C++ but I need someone to tell me
> the + and - of each one. I have noticed that every computer exploit
> and almost every linux program is builted in C why is that?


Roughly speaking, C is older and more Standard, so it has a much bigger
establish corpus of legacy code. Including Linux. By "more Standard" I mean
that more Standard-compliant code has been written to work in more
Standard-compliant compilers than C++.

(I suspect we still don't have a standard-conforming compiler, despite
almost a decade of a ratified Standard. And I suspect that the committees
are upgrading this Standard before it even achieves compliance!!)

Entry level programmers don't need to worry about any of that. Learn C++
first, and learn enough C to diagnose and debug it. Learn C++ as a
high-level language, starting with features like std::string. Then learn C
things like strlen(), so you can avoid the troubles these cause.

> Because
> they just know to program in C or C is better for that kind of
> programs and why?


Anything you can do in C, you can do the same way, with better typesafety
and more conveniences, in C++.

Almost anything you can do in C, you can do better in C++ using Object
Oriented, Generic, and similar paradigms.

The only thing you can't do is the very last step of optimization. Kernels
like Linux's need that (and you _don't_), so they must use C-style code. C++
can compile C-style code, so they still don't need C.

Most C code can be tweaked to compile in C++. But Linux shouldn't compile as
C++ because Linux works on many kinds of CPU hardware, and some of them
don't have C++ compilers. Only situations without a C++ compiler strictly
need C.

> Can somebody give an example of big project that
> you can achive with C and you cant with C++ or vice versa?


C++ is better for very large projects because it allows you to create
modules and components better than C. C has poorer support for
encapsulation, which is a good high-level technique to prevent bugs.

> Also can
> somebody suggest me a book for both of them ! (I dont want something
> for begginers i want something to be as much complete book as it can
> be, with all the topics you need to know for a programming language
> .)


Tip: Most programming today should not be in a C language at all. It should
be in a soft rapid language (like Ruby or Python) where you don't need to
reinvent the wheel all the time.

To proceed in C++, read /The C++ Programming Language, 3rd Edition/ by
Bjarne Stroustrup. It fits the "complete" spot you requested.

--
Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!


 
Reply With Quote
 
loufoque
Guest
Posts: n/a
 
      09-29-2006
Phlip wrote :

> Roughly speaking, C is older and more Standard, so it has a much bigger
> establish corpus of legacy code. Including Linux. By "more Standard" I mean
> that more Standard-compliant code has been written to work in more
> Standard-compliant compilers than C++.


AFAIK, there is only one frontend which is compliant to the latest C
standard, just like for C++.
And it's the same one, actually.


> The only thing you can't do is the very last step of optimization. Kernels
> like Linux's need that (and you _don't_), so they must use C-style code. C++
> can compile C-style code, so they still don't need C.


Not really.
A lot of notable C++ features are not only acceptable in a kernel but
can also boost its performance and improve its design.

 
Reply With Quote
 
Phlip
Guest
Posts: n/a
 
      09-29-2006
loufoque wrote:

>> The only thing you can't do is the very last step of optimization.
>> Kernels like Linux's need that (and you _don't_), so they must use
>> C-style code. C++ can compile C-style code, so they still don't need C.

>
> Not really.
> A lot of notable C++ features are not only acceptable in a kernel but can
> also boost its performance and improve its design.


Oops; right. I was trying too hard to say "C++ is always better than C, even
for C-style optimization" that I forgot about "C++-style optimization".

An OS kernel built out of a sick "expression metatemplate" package, taking
hours to compile, would shred!!!

And would still be maintainable, unlike the raw Assembly it would compete
with.

--
Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!


 
Reply With Quote
 
kwikius
Guest
Posts: n/a
 
      09-29-2006
Phlip wrote:
<...>

> Most C code can be tweaked to compile in C++. But Linux shouldn't compile as
> C++ because Linux works on many kinds of CPU hardware, and some of them
> don't have C++ compilers. Only situations without a C++ compiler strictly
> need C.


re: Linux, AFAIK Linus Torvalds just plain doesnt like C++, and that
is the beginning and end of the matter. Theres an interview or quote
somewhere... but where I don't know.

regards
Andy Little

 
Reply With Quote
 
Ron Natalie
Guest
Posts: n/a
 
      09-29-2006
kwikius wrote:
> Phlip wrote:
> <...>
>
>> Most C code can be tweaked to compile in C++. But Linux shouldn't compile as
>> C++ because Linux works on many kinds of CPU hardware, and some of them
>> don't have C++ compilers. Only situations without a C++ compiler strictly
>> need C.

>
> re: Linux, AFAIK Linus Torvalds just plain doesnt like C++, and that
> is the beginning and end of the matter. Theres an interview or quote
> somewhere... but where I don't know.
>

Linux, fortunately, has gone way beyond the personal whims of Linus.
Just about every implementation of Linux I've seen uses the GCC suite
for it's compilers which pretty much comes with both C and C++. The
few exceptions also provide C++ environments.

There's no trememdously compelling reason to NOT allow C++ in the
kenrel. There are user-mode programs in LINUX that are written in
C++ (and a bunch of them like the X libraries would fare better had
they been written in a real object-oriented language rather than a
half-assed attempt to implement OO concept in strict C.
 
Reply With Quote
 
loufoque
Guest
Posts: n/a
 
      09-29-2006
kwikius wrote :

> re: Linux, AFAIK Linus Torvalds just plain doesnt like C++, and that
> is the beginning and end of the matter. Theres an interview or quote
> somewhere... but where I don't know.


Did you mean this quote ? (It's from 2004 I think)
You can obviously see he doesn't know C++ well and that moreover he does
nothing more than insult C++ and the people that use it.

[Beginning of quote]

The fact is, C++ compilers are not trustworthy. They were even worse in
1992, but some fundamental facts haven't changed:

- the whole C++ exception handling thing is fundamentally broken. It's
_especially_ broken for kernels.
- any compiler or language that likes to hide things like memory
allocations behind your back just isn't a good choice for a kernel.
- you can write object-oriented code (useful for filesystems etc) in C,
_without_ the crap that is C++.

In general, I'd say that anybody who designs his kernel modules for C++ is
either
(a) looking for problems
(b) a C++ bigot that can't see what he is writing is really just C anyway
(c) was given an assignment in CS class to do so.

[End of quote]
 
Reply With Quote
 
arnuld
Guest
Posts: n/a
 
      09-29-2006
wrote:
>>> Thanks for your answers.
>>> I already know programming in Java and I am starting studying the perl.
>>> I would like to learn C or C++ but I need someone to tell
>>> me the + and - of each one.


So you want to learn C or C++. (thank God, you did not ask C/C++ ).

Q: do you want to eat an apple or an orange?

A: http://www.parashift.com/c++-faq-lite/ &
http://www.research.att.com/~bs/papers.html

C & C++ are different lanugaes. you do not need to post it here, do
these 4 things:

1.) First, write down your goals & plan of your career, where & why you
want to go & in which direction (you know "software world" has many
domains or application areas)

2.) Search for jobs you want on your faourite (but also popular) job
site. i like "www.monsterindia.com" (as i live in India)

3.) after collecting the information from last 2 points, now, search
the archives of 4 newsgroups "comp.lang.c", "comp.lang.c++",
"comp.lang.c++.moderated" & "alt.comp.lang.learn.c-c++" with following
keywords: "c or c++", "why c++", "why c" etc. etc. then read all the
information. If you have a printer(like me, i have a dot-matrix ,
then take print-outs of things which seem important from the
perspective of information you collected from points 1 & 2.

4.) know that its 14th day since you started from point 1.

this will 1st, remove the "fog of confusion" & 2nd, you will get a much
better, an accurate & focused answer.

actually i was pondering into the same confusion & i relieved my pain
in the same way (but i used quite "a trial & error method" & what i
told you is the *extract* of my experience).

>>> I have noticed that every computer exploit and almost every linux program is builted in C
>>> why is that? Because they just know to program in C or C is better for that kind of
>>> programs and why?


C is older than C++ & was standardized almost a decade ago & hence it
has large community base. even Linus Torvald created Linux kernel many
years ago (IIRC in early 1990s & C++ was standardized in 1998, the year
C++ Primer 3/e was published)

> Can somebody give an example of big project that
> you can achive with C and you cant with C++ or vice versa?


do the 4 points.

> Also can somebody suggest me a book for both of them !


Now, that will be a "recipe for disaster", if somebody does so.

> (I dont want something
> for begginers i want something to be as much complete book as it can
> be, with all the topics you need to know for a programming language
> .)Sorry for the number of the questions but i am a little bit
> confused.


read & do those 4 points, only then ask for a book. Otherwise you will
waste a lot of money which you can earn later but you can not earn the
time you will loose.


take care

thanks

"arnuld'

 
Reply With Quote
 
arnuld
Guest
Posts: n/a
 
      09-29-2006
Victor Bazarov wrote:
> Big-Goofy wrote:
> > Thanks for your answers.
> > I already know programming in Java and I am starting studying the
> > perl. I would like to learn C or C++ but I need someone to tell me
> > the + and - of each one.

>
> I hope you're not blind and should see the two pluses in C++... I
> don't see any minuses there, do you? Neither does C have any minuses.
> It just doesn't have any pluses, that's all.


Ha...Ha...Ha....

> > I have noticed that every computer exploit

>
> Is that what you're trying to get into?


Hmmm... Victor is really serious here.

> > and almost every linux program is builted in C why is that? Because
> > they just know to program in C or C is better for that kind of
> > programs and why? Can somebody give an example of big project that
> > you can achive with C and you cant with C++ or vice versa?

>
> Find Bjarne Stroustrup's home page and read all of it.



Best Answer Award, so far.

"arnuld"

 
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
XPath query for <?define something="something" ?> Pekka Järvinen XML 2 04-29-2008 08:12 PM
How to find and replace something that is nested inside something else? alainfri@gmail.com Perl Misc 4 05-31-2007 11:50 PM
var Something= new Something() What does it mean ? pamelafluente@libero.it Javascript 9 10-05-2006 02:43 PM
Etching tutorials-or now for something completely different Technoholic Case Modding 71 09-27-2005 06:39 AM
umm... something... template(s)... something else... pointer(s)... and such... 0.o yah, I'm hopeless and clueless o.0 C++ 4 10-13-2004 10:34 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57