|
REPERTUARAI |
Koncertai ir vakarai
Scala is an hbiyrd imperative/functional language, so even if the use of vals is encouraged, No vars is not an absolute rule.Quoting Programming in Scala , you have to prefer using val as much as possible unless you have a specific need and justification for them . Well in this case it is just 2 to 3 times faster (a potentially valid justification to me), and the whole method still has no side effects.Just to say that the pure functionnal style programming may be the most elegant, but not always the most efficient. When you deal with time critical code, it may be important to have this in mind.
|
<< Sugrįžti į straipsnį
|
|
|
Susiję numerio straipsniai
Kiti susiję straipsniai
Straipsnio raktažodžiai
|
|
|
© "7 meno dienos". Visos teisės saugomos. Leidėjas: VšĮ "Meno dienos", Maironio g. 6, LT-01124 Vilnius. Tel. +370 52613039, fax. 370 52611926
Sprendimas UAB "Fresh media"
|