Improving Compiler Error Messages

Steven Schveighoffer schveiguy at yahoo.com
Mon May 3 05:53:29 PDT 2010


On Mon, 03 May 2010 08:17:17 -0400, bearophile <bearophileHUGS at lycos.com>  
wrote:

> div0:
>
>> Anybody who's serious about programming needs to learn to touch type.
>> The semicolon is right there under your little finger and using it takes
>> far less time than trying to remember arbitrary and arcane rules about
>> what is the end of a statement.
>
> In my keyboard it's <SHIFT><COMMA>, and regarding rules...

What is under your right pinky?  On my keyboard it is semicolon, or colon  
if you use the shift key

If the character on that key is not as important, you may want to swap  
keycodes with the semicolon.

On my keyboard, shift-comma is the < character.  I agree it is used less  
than the semicolon, but it's a pretty common character in D, and I've  
never noticed it to be a burden to use it.

> for (int i; i < 10; i++) <= why is semicolon not accepted in D here? (I  
> know the answer)
> Newlines and semicolons probably have less rules in Python compared to D  
> :-)

That's not the same thing.  Technically, the semicolon is accepted there  
by the grammar.  And as far as I know, that's the only weird rule.

And as far as newlines, there are no rules.  They are considered the same  
as space/tab.  So one rule in D compared to how many in Python?  (I  
honestly don't know, I don't use python)

-Steve


More information about the Digitalmars-d mailing list