Handling constructive criticism

Bill Baxter dnewsgroup at billbaxter.com
Fri Apr 18 17:08:37 PDT 2008


Bruce Adams wrote:
> On Fri, 18 Apr 2008 23:33:41 +0100, Robert Fraser 
> <fraserofthenight at gmail.com> wrote:
> 
>> Hans W. Uhlig wrote:
>>> oOo... First question what is Dil besides an herb.
>>
>> http://code.google.com/p/dil/ Sorry, should have posted the link when 
>> I was writing that.
>>
>>> Second, where is this java code. Java I understand and would probably 
>>> be a faster read then D or C source would.
>>
>> http://www.dsource.org/projects/descent/browser/trunk/descent.core/src/descent/internal/compiler/parser 
>>
>>
>> I promise you it's not. We copied/pasted the C++ source and edited it 
>> to make it compile under Java. If that meant throwing and catching an 
>> exception to replace a goto, then so be it.
> 
> Walter used a goto? Please say there was a sensible reason otherwise my 
> opinion of him will be lowered several notches.

cd dmd/src/dmd
grep -nH -e 'goto ' *.c *.h | wc
     932    3913   50909

Walter used 932 goto's to be exact.  :-)

He's a low-level kinda guy.  Gotos are what the hardware does.  Gotos 
map nicely to what happens in a finite state machine.  I wouldn't write 
the code that way, but I wouldn't say it's all that unreasonable a way 
to write the code for a person that's used to programming ASM.

A lot of them seem to be of the "goto FINISHED;" variety to do some 
final tidying up before leaving a function no matter what path you took 
inside the function.  That's a pretty reasonable use of goto in C code 
in my opinion (though DMD is actually C++).

--bb



More information about the Digitalmars-d mailing list