Hacker News new | past | comments | ask | show | jobs | submit login
Learning Scala in small bites (might.net)
20 points by r11t on Oct 11, 2009 | hide | past | favorite | 3 comments



Is there a reason the variables in the first example are titled 'x1' through 'x13'? Seems strange and undesirable compared even pseudo-meaning variable names. As another post mentioned, sample code lives forever but this particular coding style isn't what I would to see sticking around.


I agree that it seems like an odd practice, could be a mental artifact from using the scala interpreter. When you create objects in the interpreter w/o a name it is starts enumerating at res0.

  Welcome to Scala version 2.7.5.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_15).
  Type in expressions to have them evaluated.
  Type :help for more information.

  scala> "hello"
  res0: java.lang.String = hello

  scala> "world"
  res1: java.lang.String = world


Thanks for pointing that out.

I don't remember why I did it that way.

I changed them to more sensible variable names.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: