Samstag, 16. August 2008

functional vs. imperative

Today I came across this post[1]. It discusses about readability, comparing functional and imperative code snippets. I think its quite hard to tell which reads better because it depends on you think it should work. I guess this shows how important code style guides are when it comes to big scala code basis, involving possibly many different team members.


[1]http://www.drmaciver.com/2008/08/functional-code-not-equal-good-code/

Dienstag, 12. August 2008

Scala functions

Scala offers so many different concepts that it sometimes can be quite overwhelming. Scala blends object orientated and functional programming. The very basic block of functional programming is of course a function. Now a functions seem similar to a method but a function in scala can be a value. Today I found another usefull resource from the blogsphere[1]. The essential points discussed:

  • the apply method
  • Closures
  • Partial Functions
  • apply (ied) in many places


[1]http://creativekarma.com/ee.php/weblog/comments/scala_function_objects_from_a_java_perspective/