Re: const

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Zach wrote:
On Nov 11, 5:01 pm, Peter Duniho <no.peted.s...@xxxxxxxxxxxxxxxxxx>
wrote:
Zach wrote:

I'm not here to argue that C++ is superior to C# or C# sucks
or anything like that.

Of course you are. You are at the very least making that statement with
respect to a specific feature.

Actually, no I'm not.

Actually, yes you are.

You specifically claim that "const" is something "C++ gets hand down correct". The implication is that C# doesn't. If saying that C# is incorrect and C++ is correct isn't a clear statement that C++ is superior to C#, I don't know what would be.

The rest of your post reads like the usual religious-war stuff: you presuppose the superiority, and then use that supposition as "proof" that someone with a counter-argument must just not understand the superior feature.

Whatever. Fact is, you aren't going to get this in C#. If you want "const", go use a different language.

As for the discussion on the topic by others, there's this great Internet tool out there. Maybe you've heard of it. It's called "Google" and it does a wonderful job finding things on the Internet for you. No doubt you'll have some rationale for discounting every negative comment found on the Internet related to "const" in C++, but the comments are at least out there for you to discount.

Pete
.



Relevant Pages

  • Re: How to prevent passed value types from being changed
    ... proposals. ... taken at face value he was asking if a feature exists ... an array parameter, to allow different tables to be passed, you might ... formal parameter is const, the object referred to by the formal ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: C++-style treatment of const?
    ... get me wrong, I am not against the feature, but actually not completely ... Elegance may not be considered a valid driver for a new feature, but elegance brings simplicity and the C++ rules for const simplify code. ... By adopting the existing C++ rules, we wouldn't have to invent new linkage rules. ...
    (comp.std.c)
  • Re: How to prevent passed value types from being changed
    ... that the array contents itself are not to be changed by the routine. ... can declare that the formal parameter is const, ... but I see where this feature would be useful ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: C++-style treatment of const?
    ... get me wrong, I am not against the feature, but actually not completely ... Some of the arguments that were made for the need of such const don't ... with static storage duration, case labels of switch statements) there is ... but then the use of "register" would have to be widened to file scope. ...
    (comp.std.c)
  • Casting volatile and const variables
    ... I read on the internet, ... that const and volatile ... shouldn't we type cast ...
    (comp.lang.c)