Re: Equals Operator

Tech-Archive recommends: Fix windows errors by optimizing your registry



Roger:

The language is called C#. Much of the syntax is taken from C/C++ design. I
lot of the problems that were caused by == in C / C++ are caught be the C#
compiler. You can't get away with stuff like:

if (a = b)

In most cases this is a typo in C / C++ but the comiler wouldn't flag it. If
[b] was zero it would come out false else it would be true. C# will yell at
you if you try this.

Problem solved.

"Roger" <roger@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:OPqDhoccFHA.2936@xxxxxxxxxxxxxxxxxxxxxxx
> What did MS not take the chance to change
> the silly == operator when they designed C#,
> to something reasonable like = ?
> Why change the universal meaning of = ?
>
> Wouldn't it be better to have:
> Assignment := //or something else
> Equal = //but keep = to be =
>
> My view,
> Roger
>
>


.



Relevant Pages

  • Re: Handling error/status messages by interface to C++ programs
    ... about how to design a compiler, please tell me where I can find ... exceptions for managing the error detection is rather a bad idea. ... I have to say I have seen a simple example of an object-oriented parser design in some book (unfortunately I forgot ... It would trigger user notification and do recover housekeeping like reseting the current syntax row's token stack because one wants to continue parsing and detect any other errors w/o aborting. ...
    (comp.object)
  • Re: CASE...ENCASE Query...
    ... Once you've got one compiler and semantic checker, ... A 'syntax and semantic checker' designed ... for use at the 'compilation' stage will have very different design ...
    (comp.sys.acorn.programmer)
  • Re: Is Forth suitable for writing compilers?
    ... used to your syntax won't mind at all. ... need extra complexities in your compiler design too. ... Albert van der Horst, UTRECHT,THE NETHERLANDS ...
    (comp.lang.forth)
  • Re: How to test if an enum is inside a set
    ... > not how it is designed to be easy for the compiler ... compiler design. ... that delphi doesn't allow you to write something like this ... Perfectly valid syntax in C/C++. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: The Decline of C/C++, the rise of X
    ... >> syntax rules, so people can quickly get comfy and stop relying on the ... X's compiler ... in C/C++. ... typing effort in the most common coding activities. ...
    (comp.programming)