2 ms·
Gee, so why do I STILL see so many programmers writing "synchronized" all over their Java or Android code? I wish I were joking. HN is not like the real world
by bsder 10y ago
Gee, so why do I STILL see so many programmers writing "synchronized" all over their Java or Android code?
I wish I were joking. HN is not like the real world.
This is just like "git/hg is superior" arguments. Those of us in the real world are still happy when we see a business actually use source control of any form.
- lemming 10y agoUsing synchronised and j.u.c aren't mutually incompatible. It's quite easy to use synchronised to conservatively control access to the state of a single object, and often that's all you need. It can affect performance depending on your access patterns, but it's not like synchronised is deprecated or anything. When was the last time you saw wait/notify? I'm willing to bet that was a long time ago.