On Tuesday, 29 May 2012 at 22:01:50 UTC, Alex Rønne Petersen
wrote:
On 29-05-2012 23:54, Andrei Alexandrescu wrote:
On 5/29/12 2:49 PM, Alex Rønne Petersen wrote:
It doesn't, and neither does C#. Java still encourages using
synchronized, and C# still encourages using lock, but many
prominent figures in those programming language communities
have written blog posts on why these language constructs are
evil and should be avoided.
Besides, it seems to me that D can't quite make up its mind. We
have TLS by default, and we encourage message-passing (through
a library mechanism), and then we have the synchronized
statement and attribute. It just seems so incredibly
inconsistent. synchronized encourages doing the wrong thing
(locks and synchronization).
I can't remember having read those blog posts. I agree message
passing is a better abstraction, but I haven't read Josh Bloch,
for example, saying "don't use synchronized".