[stringtemplate-interest] Limited control flow with stringtemplate - by design?

Andrew Goodnough Andrew.Goodnough at wicourts.gov
Tue Nov 15 05:39:15 PST 2005


I was initially frustrated by this as well but have come to discover
that most times a boolean method makes sense.  Ask yourself what
business problem you're trying to solve and name the method with that in
mind.  So, while you could do this:
 
isDouble()
isd0Ubl3()
isdouble()
 
you might find this is what you're really asking:
 
isRegular()
isLeetSpeak()
isPrimitive()
 
Obviously, my knowledge of your business domain is totally made up
above, but hopefully it makes sense.  As it turns out this is more clear
for everyone who is reading the code because you're embedding more of
your knowledge of your business domain into the code.  (read: less
comments necessary, whohoo!).
 
Andy

>>> Sohail Somani sohail at taggedtype.net> 11/15/2005 12:22 am >>
...

Now if you are translating into more than one language, where a double
can be Double, d0Ubl3 or double, it makes things very difficult.

Although I suppose this could be replaced by
t.setAttribute("name",template("double"));

:)

Sohail


_______________________________________________
stringtemplate-interest mailing list
stringtemplate-interest at antlr.org
http://www.antlr.org:8080/mailman/listinfo/stringtemplate-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org:8080/pipermail/stringtemplate-interest/attachments/20051115/e94f21a8/attachment.html


More information about the stringtemplate-interest mailing list