# Tuesday, 19 September 2006

Some people don't like the different kinds of punctuation in C++. I do. I like having :: and . and -> instead of always dots. And in C++/CLI I really like having ^ instead of overloading * to mean either pointer-to-native-heap or pointer-to-managed-heap. But you know what some people say about C++, don't you? That it looks like comic book characters swearing? Well here's what I say to that:



Tuesday, 19 September 2006 12:27:49 (Eastern Daylight Time, UTC-04:00)  #    Comments [4]
Wednesday, 20 September 2006 14:47:15 (Eastern Daylight Time, UTC-04:00)
Nice :-)
Tuesday, 14 November 2006 17:23:31 (Eastern Standard Time, UTC-05:00)
I must say I agree with you. The advantages of having a more elaborate operator alphabet are numerous. For instance I find it annoying that in C#, usage of a static member has the same syntax as usage of an instanced member. In C++ the Scope Resolution operator immediately tells you that a static member is being used.
It's also great to syntacticly differentiate between pointers to the managed heap and those to the unmanaged heap so that one does not have the situation of much hair pulling while attempting pointer arithmetic on pointers to the managed heap ... need I say more.
Thursday, 22 March 2007 16:43:55 (Eastern Standard Time, UTC-05:00)
I think you mean "C#/CLI", not "C++/CLI". In C++, "^" means the same thing it does in C, which is just the binary bitwise-exclusive-or operator.

Personally, I'm trying to do more Python these days. :)
Lawrence D'Oliveiro
Thursday, 22 March 2007 17:32:11 (Eastern Standard Time, UTC-05:00)
Trust me, Lawrence, I meant C++/CLI. It's a subtly different language from standard C++. In C++/CLI, ^ can mean either "bitwise-exclusive-or" or "handle" depending on whether it's binary between two expressions or unary after a type name. Just as * can mean "multiply" or "deference" depending on whether it's binary or unary.

There's no such thing as C#/CLI, and C# does not have a handle or a pointer or a way to distinguish between the pointer and pointee.

As for Python, I spent YEARS telling people who were inconsistent about braces after "if" and "while" statements "The compiler doesn't read indents!". I have done a small amount of work in Python and don't plan to do any more.

Comments are closed.