shouting versus dotting

Tom S h3r3tic at remove.mat.uni.torun.pl
Sun Oct 5 03:48:35 PDT 2008


I don't like using "." for template instantiation. The tokenizer in my 
eyes clearly separates constructs at ".". On the other hand, "!" as a 
graphical character is more 'filled', thus doesn't separate the 
identifier and arguments that much visually.

foo.bar          <-  obviously member access
foo.(bar, baz)   <-  multiple member access?

... It looks like it should yield a tuple containing bar and baz :P


foo!(bar, baz)   <-  distinct, no issue.


As for the other queries, I like how template instantiation stands out 
right now with the exclamation mark. I would not like to have 
compile-time and run-time merged visually in code. And I don't forget to 
put the exclamation mark there when programming templates.

Let's also keep in mind what Ary said, that using "." will cause 
problems for IDEs.

What's the point in pretending that run-time is the same as 
compile-time? You can't instantiate compile-time constructs with 
run-time arguments, the costs are very different, too. Heck, when I see 
too many "!" in the code, it indicates that there may be a design issue 
and some massive bloat involved. I would not like this additional 
insight into the code removed from my eyes.


-- 
Tomasz Stachowiak
http://h3.team0xf.com/
h3/h3r3tic on #D freenode



More information about the Digitalmars-d mailing list