synchronized (this[.classinfo]) in druntime and phobos

Jacob Carlborg doob at me.com
Wed May 30 23:47:01 PDT 2012


On 2012-05-30 21:10, Andrei Alexandrescu wrote:

> I see how these can be annoying, but they're not the result of us not
> designing things. We designed things best we could.

I would say it's not good enough. The whole approach of designing the 
language is wrong. This is how it works today, which is bad:

1. Designing feature X
2. Implementing in the compiler
3. Shipped with the next release

Andrei, Walter: "Hey look at this new feature X in the next release, 
it's great".

Community: "Say what now. What did that come from?".

Some time later

Community: "X is broken in these different ways. X can't integrate with 
Y, Z, W. Since Phobos doesn't use the feature we can't use it, making it 
useless"
Andrei, Walter: "No, it's perfectly designed"
Community: "But it's not working in practice"
Andrei, Walter: "Sure it is, end of discussion"

This is the bad approach, but there's also a worse approach:

1. Designing feature X
2. Document the feature in TDPL
3. Wait wait wait
4. Community: "Where is feature X, it's in TDPL"
5. Andrei, Walter: "It's not implemented yet/correctly"
6. Repeat step 3-5 a couple of times
7. Implement feature X in the compiler
8. Ship with the next release

Community: "X is broken in these different ways. X can't integrate with 
Y, Z, W. Since Phobos doesn't use the feature we can't use it, making it 
useless"
Andrei, Walter: "No, it's perfectly designed"
Community: "But it's not working in practice"
Andrei, Walter: "It can't be changed, it's already in TDPL, it's written 
in stone"

What should have been done is something like this:

1. Designing feature X
2. Show the new feature for the community
3. Consider the feedback and possible tweak/redesign
4. Implementing in an experimental branch of the compiler
5. Release an experimental version with just this feature
6. Repeat step 3-5 until satisfied or put on hold/drop the idea
7. Prepare Phobos and druntime for the new feature
8. Move the implementation to the main branch
9. Ship feature X with the next release
10. wait
11. Fix bugs for feature X
12. Repeat step 10-11 a couple of times
13. Write about it in TDPL

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list