# Tuesday, September 19, 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, September 19, 2006 12:27:49 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [4]
Wednesday, September 20, 2006 2:47:15 PM (Eastern Daylight Time, UTC-04:00)
Nice :-)
Tuesday, November 14, 2006 5:23:31 PM (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, March 22, 2007 4:43:55 PM (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, March 22, 2007 5:32:11 PM (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.