Steve, On Wed, 2009-05-13 at 11:10 -0400, Steve Appling wrote: > I'm still not sure that I understand the motivation to change from using > createTask to the keyword style syntax. I think this looks less like normal > groovy code (which makes it harder to initially understand). Perhaps I'm > just > ranting about DSLs in general, which are always a balance between convenience > and ease of learning.
I agree with you on this one.
> That said, if you are going to use a keyword style syntax, I would prefer a
> keyword to create a new task that looked more like a verb - perhaps
> createTask
> or newTask. I think the keyword task is confusingly close to the
> Project.task
> methods and Project.getTasks. If I was going to the javadoc to try to
> understand what methods in project were available to me, I would find this
> confusing.
I have a very different view of language from you on this one. I prefer
declaration to action so I prefer noun forms to verb forms for this sort
of thing.
> There is already a method to add actions to a task. Why is the "<<" syntax
> needed? It just seems like more non-obvious magic. Could you not just use:
> task hello.doLast { stuff to do }
<< is traditionally used in C++ and Groovy as an inserter, so append to
a list, etc. Used in that context it is idiomatic. Used simply to
replace a call of a method that doesn't have inserter semantics, it is
probably a bad thing to do.
[ . . . ]
--
Russel.
============================================================
Dr Russel Winder Partner
Concertant LLP t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road, f: +44 8700 516 084 voip:
sip:[email protected]
London SW11 1EN, UK. m: +44 7770 465 077 xmpp: [email protected]
signature.asc
Description: This is a digitally signed message part
