News for hackers. Stuff that matters.
Re:React: You Might Not Need an Effect by the_gipsy on Thursday March 23, 2023 @04:58AM (#35272003)
Go using casing for access is quick but is awful when you just want to change the access later on. It's not like writing `pub` before the var/field is suddenly javaland, see rust.
Re:React: You Might Not Need an Effect by aatd86 on Thursday March 23, 2023 @05:19AM (#35272103)
What do you mean changing the access?

You mean from private to public?

In that case, you would just have to change a single package.

(also, if yes: does it happen often and is that really what we should optimize for then?)

Re:React: You Might Not Need an Effect by the_gipsy on Thursday March 23, 2023 @06:06AM (#35272381)
Yes, you have to rename a var/field to change public/private. It's not a huge deal of course, just an annoying exception.

Re: optimization, what does using casing instead of an explicit `pub` prefix optimize for, exactly? Compiler complexity? Typing ergonomics?

Re:React: You Might Not Need an Effect by rawoke083600 on Thursday March 23, 2023 @06:25AM (#35272524)
You ever read the access modifier rules of C++ ?

Can you explain that to a newbie in 2 sentences ?

Re:React: You Might Not Need an Effect by the_gipsy on Thursday March 23, 2023 @06:50AM (#35272716)
No, but I don't think that's relevant. Rust or Java access is doesn't require much typing ceremony, and doesn't require you to rename a var to change the access.
Re:React: You Might Not Need an Effect by aatd86 on Thursday March 23, 2023 @08:44AM (#35273853)
I think it optimizes for readability.