[antlr-interest] wow; talk about premature optimization

Terence Parr parrt at cs.usfca.edu
Thu Mar 31 09:06:13 PST 2005


I had no idea writing software was so complex!  Code generation and 
compilers?  What are those?  Hokey smokes!  Design?  Maintenance?  
Hm....i'll have to look all those up on google. ;)

Ter

On Mar 31, 2005, at 5:26 AM, Scott Stanchfield wrote:

>> On Mar 30, 2005, at 8:22 PM, Scott Stanchfield wrote:
>>> Next time, remember -- write it for good design, then profile, then
>>> tweak...
>>> You'll rarely outguess a compiler & optimizer
>>
>> Without doing the bytecodes at some point, how could one
>> compare?
>
> History, my friend. People have been attempting to do this for years 
> and the
> compilers always win (or at least they do after the compiler writers 
> have
> had a year or two to optimize).
>
> Usually for the first year or so of a compiler's life, misguided 
> programmers
> keep writing their own assembly code "because real programmers write in
> assembler". They might be a wee bit more efficient, but then them 
> compiler
> catches up and they're left with some nasty, unmaintainable code 
> that's at
> best the same as what the compiler optimizes to (and usually not as 
> good).
> Then it's time to rewrite it maintainably ;)
>
> It all boils down to the fact that intuition (& common sense) is a
> misdirected optimizer. Go for good, understandable & maintainable 
> design and
> let a profiler figure out what you need to tweak into submission.
>
>
>> I just did it first 'cause it seemed like fun. :)
>
> Of course, and that's a good reason ;)
>
> -- Scott
>
>
>





More information about the antlr-interest mailing list