V Forum

[ log in ]

pub, opt-in or opt-out?

rwgk 2019-07-02 18:12
With your current design making something pub requires effort. I believe this will cause more harm (lost productivity and agility) than good (prevent accidents). Fast-forward 5-10 years when V is mainstream. Many (casual/inexperienced) users will be too rushed to care about pub, creating a lot of friction and copy-pasted code down the road. Some users will be judicious but also opinionated, creating a long and heated discussions. Making pub the default and private an effort, on balance the community may win. When people see "private", they know the author really meant it; it's not that it's private just because they were too rushed to think about pub/private.
medvednikov 2019-07-04 15:53
Hi

All major languages have `private` by default. I think it's the better choice, just like with immutability by default.

Adding `pub` is not much work :)
rwgk 2019-07-09 19:18
No doubt about both.
My suggestion is about balance; see above. Could you say something about that?
Are you familiar with this research? https://sparq.stanford.edu/solutions/opt-out-policies-increase-organ-donation
Question: What balance do you want your community to guide into?
ntrel 2019-07-11 07:41
Accidentally exposing symbols in libraries means library implementations can never change without breaking user code. Public symbols should only be exposed in a conscious way. Adding pub and making a point release is much better.

One issue with retiring grouping for access and mutability attributes is that changing them presumably breaks the binary layout of fields (i.e. the ABI).
ntrel 2019-07-11 07:42
retiring -> requiring
medvednikov 2019-07-12 10:34
> One issue with retiring grouping for access and mutability attributes is that changing them presumably breaks the binary layout of fields (i.e. the ABI).

This is a good point.
rwgk 2019-07-16 09:22
> Accidentally exposing symbols in libraries means library implementations can never change without breaking user code.

C and Python leave many symbols out in the open. Very popular, long-term-successful languages, with many, and some huge, evolving libraries.



Powered by Vorum, open-source blogging/forum software written in V