Ruby is a language of least surprises but I am not sure whether I can say that for Scala yet. I have already encountered some of them, here is one example
You can define method without '()'
def height: Int = 0 //This is a valid method
def width(): Int = 0 //This is valid too
Now you can invoke 'width' method with and without parenthesis but you cannot do that for height method.
SURPRISED
Update: The Scala convention is, use '()' for parameter less method if it has side effects otherwise don't
Stuff about software development, agile and testing
Monday, January 14, 2008
Subscribe to:
Posts (Atom)
Labels
- agile (4)
- agile testing (1)
- build tool (1)
- design (1)
- DSL (1)
- duck typing (1)
- eclipse (1)
- ejb3 (1)
- Fluent Interface (1)
- grails groovy (1)
- groovy (1)
- gwt (1)
- hacking (1)
- haskell (1)
- java (1)
- javascript (1)
- jvm (1)
- languages (1)
- mac (1)
- pipes (1)
- programming (1)
- qa (1)
- rant (2)
- ruby (6)
- sas (1)
- scala (3)
- scripting (2)
- software rewrite (1)
- statically typed (1)
- testing (4)
- two phase commit (1)