from <<Programming in scala>>
[list]
[*] Actors should not block
[*] Communicate with actors only via messages
[*] Prefer immutable messages
[*] Make messages self-contained
[/list]
[quote]
[b]A balanced attitude for Scala programmers[/b]
Prefer vals, immutable objects, and methods without side effects.
Reach for them first. Use vars, mutable objects, and methods with side
effects when you have a specific need and justification for them.
[/quote]
[list]
[*] Actors should not block
[*] Communicate with actors only via messages
[*] Prefer immutable messages
[*] Make messages self-contained
[/list]
[quote]
[b]A balanced attitude for Scala programmers[/b]
Prefer vals, immutable objects, and methods without side effects.
Reach for them first. Use vars, mutable objects, and methods with side
effects when you have a specific need and justification for them.
[/quote]
本文摘自《Scala编程》一书,介绍了使用Scala进行编程时应当遵循的一些基本原则:避免阻塞操作,仅通过消息传递来与其他Actor通信,优先使用不可变消息,并确保消息自身包含所有必要的信息。此外,还强调了Scala程序员应采取平衡的态度,优先考虑使用val、不可变对象及无副作用的方法。
8452

被折叠的 条评论
为什么被折叠?



