From: Sam on
On 13 Feb 2007 17:51:00 GMT, Jorgen Grahn
<grahn+nntp(a)snipabacken.dyndns.org> wrote:
> Well, C++ is a better language than C in many ways. So, if he needs to learn
> one of them, why does it have to be C?
>
> Another reason some people choose C++ over Python for some tasks is that
> they feel that larger programs benefit from strong, static type checking.
> I like both ways, but depending on the task, one or the other is better.

C++ is -not- strongly typed. You can cast anything to void *, and
manipulate it in ways unimaginable. Plus there's the whole mess that
is pointer arithmetic and a weak typesystem...

Disclaimer: I am unashamedly in the "C++ Is Evil" camp, and wholly
believe that if you want proper strong, static type checking, use
Haskell, or if you want proper, complete object-orientation (C++'s
primitive types compromise its object system's integrity, and I
believe I've already discussed casting and pointers), use Python, and
if you want under-the-hood pointer-fu, use C.

--Sam
From: Anders Arnholm on
Sam <free.condiments(a)gmail.com> skriver:
> On 13 Feb 2007 17:51:00 GMT, Jorgen Grahn
><grahn+nntp(a)snipabacken.dyndns.org> wrote:
>> Well, C++ is a better language than C in many ways. So, if he needs to learn
>> one of them, why does it have to be C?
>>
>> Another reason some people choose C++ over Python for some tasks is that
>> they feel that larger programs benefit from strong, static type checking.
>> I like both ways, but depending on the task, one or the other is better.
>
> C++ is -not- strongly typed. You can cast anything to void *, and
> manipulate it in ways unimaginable. Plus there's the whole mess that
> is pointer arithmetic and a weak typesystem...


C++ can be both, The type systenm is as fragila as you like it to be.
I mainlty use c++ when i the need stronger typing that Python och C
can't give me. In some ways it's even stronger types than languanges
as Java and ObjectiveC. C++ it however at least four different
languanges, in one ball of soupe.

And yes you can do it, that doesn't mean you have to dio it. As
_functions in python or __, you can use them from anyware, you don't
have to.

/ Balp


--
http://anders.arnholm.nu/ Keep on Balping
From: Nicola Musatti on
On Feb 14, 12:26 am, Sam <free.condime...(a)gmail.com> wrote:
[...]
> C++ is -not- strongly typed. You can cast anything to void *, and
> manipulate it in ways unimaginable. Plus there's the whole mess that
> is pointer arithmetic and a weak typesystem...

The previous poster wrote "strongly typed", not "a straight jacket".
The fact that you may do certain things doesn't mean that you have to
nor that they are going to be done to you against your will.

> Disclaimer: I am unashamedly in the "C++ Is Evil" camp, and wholly
> believe that if you want proper strong, static type checking, use
> Haskell, or if you want proper, complete object-orientation (C++'s
> primitive types compromise its object system's integrity, and I
> believe I've already discussed casting and pointers), use Python, and
> if you want under-the-hood pointer-fu, use C.

The trouble is that in addition to proper, strong, static type
checking people often also want their daily bread, fancy that. As to
the merits of complete object orientation, I'd like to hear about
them, because nobody managed to explain them to me in a satisfactory
way yet.

There are many valid reasons to dislike C++ and to prefer Python to
it, but dismissing it as "C++ Is Evil" is just plain stupid. Moreover,
C might be a valid competitor for small projects and it probably
covers most Pythonistas' needs for "closeness to the metal", but it
just doesn't scale.

Cheers,
Nicola Musatti

From: jkn on
Hi Thomas

On Feb 12, 6:00 pm, "Thomas Nelson" <t...(a)mail.utexas.edu> wrote:
> I realize I'm approaching this backwards from the direction most
> people go, but does anyone know of a good c/c++ introduction for
> python programmers?
>

They are not particularly aimed at Python programmers, but Bruce
Eckel's "Thinking in C++" books are (a) excellent, and (b) freely
downloadable, as well as purchasable in book form:

http://www.mindview.net/

Bruce is a python fan FWIW ;-)

HTH
Jon N

From: Neil Cerutti on
On 2007-02-13, Sam <free.condiments(a)gmail.com> wrote:
> On 13 Feb 2007 17:51:00 GMT, Jorgen Grahn
><grahn+nntp(a)snipabacken.dyndns.org> wrote:
>> Well, C++ is a better language than C in many ways. So, if he
>> needs to learn one of them, why does it have to be C?
>>
>> Another reason some people choose C++ over Python for some
>> tasks is that they feel that larger programs benefit from
>> strong, static type checking. I like both ways, but depending
>> on the task, one or the other is better.
>
> C++ is -not- strongly typed. You can cast anything to void *,
> and manipulate it in ways unimaginable. Plus there's the whole
> mess that is pointer arithmetic and a weak typesystem...

Don't forget the lack of standard garbage collection.

Also there's the hell known as exception safety.

Python conceptually has many of the same issues with exception
safety, but at least memory leaks aren't one of the consequences.
I imagine most Python programmers don't even think about
exception safety, but probably should be. We just happily raise
exceptions willy-nilly, without worrying about our objects
remaining in a reasonable state. Or do we? Maybe it's better not
to think about it. ;-)

> Disclaimer: I am unashamedly in the "C++ Is Evil" camp, and
> wholly believe that if you want proper strong, static type
> checking, use Haskell, or if you want proper, complete
> object-orientation (C++'s primitive types compromise its object
> system's integrity, and I believe I've already discussed
> casting and pointers), use Python, and if you want
> under-the-hood pointer-fu, use C.

C++'s standard library seems such a huge win over the C library,
that I'd hate to switch back. Of course it has its warts and
cancers, but it's an awesome accomplishment. And you *can* get
harder-to-use C versions that are basically portable.

--
Neil Cerutti
A billion here, a billion there, sooner or later it adds up to real money.
--Everett Dirksen