Re: How to test if an enum is inside a set

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

From: Alexander Muylaert (Remove_amg_at_pandora.be)
Date: 06/08/04


Date: Tue, 8 Jun 2004 21:43:05 +0200


> IOW, the inventor(s) seem(s) to have pandered
> to the whims of users who want to write "nice" looking code,
> not how it is designed to be easy for the compiler (to optimize)
> aswell as to code.

Euh, you're joking right? What is the difference of "begin" or "{" as token
for the optimizer?

begin
    DoThing();
end;

{
    DoThing();
}

Honestly, if you believe that the first syntax is less optimizable then the
second, then I can advise you a great book of Steven S. Muchnick. Advanced
compiler design. Perhaps the parses looses some ticks because the tokens in
pascal are multicharacter. But, trust me, your cpu doesn't care if you
assigned with a := or with a =. MOV is MOV and that's it.

btw, are you aware that Delphi is a 1 pass compiler where as C/C++ are two
pass compilers.

It is true, that delphi doesn't allow you to write something like this

if (MyTempVar = (++Counter++ == 5)) {
    Counter += ++MyTempVar-- != 2;
}

Perfectly valid syntax in C/C++. But I think it is safely to say that even
a C-die-hard manager would fire any guy that codes this way. I like pascal
since it forces you to use multiple statements. It keeps code easier to
track.

But, apart from the syntax. Delphi has some really nice features I miss in
C# and vica versa.

Kind regards

Alexander



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: why still use C?
    ... OOP in general tends to be slower. ... As if the compiler didn't know... ... > their associated method functions from a design perspective. ... as a language design I feel it has failed. ...
    (comp.lang.c)
  • 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)
  • Compiler positions available for week ending August 14
    ... Subject: Job openings at Tensilica ... TIE compiler engineer ... work on the TIE compiler. ... talented team changing the nature of silicon-based design. ...
    (comp.compilers)
  • Re: writeObject signature
    ... > or the compiler must do a cast to Object. ... Java refers to a syntax for type conversion -- namely, ... it would be wrong (or bad design) to ...
    (comp.lang.java.programmer)