Annotations for language features
Reinier Zwitserloot
reinier at zwitserloot.com
Sun Aug 16 09:53:49 PDT 2009
Not quite, Arthur:
Annotation processors can create *NEW* source files. (Let's call those
generated source files). Real source files can refer to types that
exist in generated source files. In fact, the real source file that
contains the annotation that created the generated source file can
refer to the generated source file. Attempting to compile this code
while you turn your annotation processors off will mean the code
doesn't compiler.
Sure, no annotations in the core java libraries actually create
generated source files, but the ability to generate files clearly
isn't an afterthought; it's a very valuable part of the annotation
system. I don't see why you are perfectly willing to accept crippling
valid uses of the annotation system like that. Can you explain to me
why you adhere to this rule of thumb? What are the advantages? What
are the disadvantages? Reasons are nice.
> Next step and we will end up Borland
> Pascal way and put control instructions in comments/javadoc.
That's a logical fallacy. Please try to keep your emotions out of this
discussion. Read up here: http://www.nizkor.org/features/fallacies/slippery-slope.html
--Reinier Zwitserloot
On 2009/16/08, at 10:03, Artur Biesiadowski wrote:
> Reinier Zwitserloot wrote:
>> http://projectlombok.org/ is a prototype that lets you play around
>> with what happens when you use annotations for language features.
>>
>> So far, the sky has not fallen down. On the contrary; they are
>> namespaced and serve as document pointers, so they've been quite
>> nice.
>>
>
> For me, rule of thumb is: if you remove all properties from the source
> code (everywhere, libraries and user code), code should still compile.
> It can fail only on runtime and only because somebody is explicitly
> using reflection to retrieve annotations. So far, all official
> annotations and all proposed ones follow this rule. Even JSR 308 is
> the
> same - type annotations are optional, meaning that if you would remove
> them from std lib and your code, everything would compile properly.
>
> Project lombok is interesting hack, but I would never, ever like to
> see
> it happening to official java. Next step and we will end up Borland
> Pascal way and put control instructions in comments/javadoc.
>
> With best regards,
> Artur Biesiadowski
>
More information about the coin-dev
mailing list