Johan Rylander

2011-05-09

Annotera konstruktor-argument i Scala

Postat i: Programming, scala — Johan Rylander @ 16:26

När man annoterar argument till en konstruktor i Scala måste man också ange till vilken användning man avser att annoteringen ska vara till. Det finns ju både instansvariabel, getter och setter. Därför annoterar använder man en lite rolig syntax med @(annotering @scope), t ex @(Nullable @field)

Se: http://stackoverflow.com/questions/3769624/annotating-constructor-parameters-in-scala

2009-12-12

Try to use val, be suspicious of loops

Postat i: scala — @ 0:00

It seems to me a good advise. Try to see if you can write your loop
without the loop, maybe it yields better, more understandable code.
Same with variables.

Of course, it does help if you use a more functionally targeted language e.g. Scala.

Tema: Silver is the New Black. Blogga med WordPress.com.

Follow

Get every new post delivered to your Inbox.