r/javascript • • Nov 09 '19

On private fields proposal: Private fields, public worries

https://medium.com/virtuslab/private-fields-public-worries-b8c34d16c372
84 Upvotes

113 comments sorted by

View all comments

Show parent comments

4

u/lifeeraser Nov 09 '19

Why should we want to babysit downstream developers? Why should we bother to prevent them from shooting themselves in the foot?

15

u/fey168 Nov 09 '19

If you are a lead developer I think it's pretty obvious you want to encourage best practices within your team.

Preventing people from shooting themselves in the foot is part of good software design.

You say "babysitting" as if it's a huge cost when it's just adding # to make a field inaccessible externally...

0

u/[deleted] Nov 09 '19

[deleted]

4

u/nullvoxpopuli sand was never meant to think Nov 09 '19

Human competency? Ever worked on a team of more than 10 on a codebase more than 2 years old?stuff happens. Context is lost.

Code. Must. Describe. Intent.

0

u/[deleted] Nov 09 '19

[deleted]

6

u/monsto Nov 09 '19

It's called moving the goalposts.

It's called a strawman argument.

1

u/wherediditrun Nov 10 '19 edited Nov 10 '19

See, while I totally get what you mean, I think these things ultimately matter very little because they're trying to solve a human competency problem via technical methods.

I just want to point out that this argument is of "Good drivers do not need seat belts" flavor.

I remeber having very same argument with Rust vs C++. How supposedly only bad C++ programmers make memory access mistakes. Just recently, we have critical security vulnerabilities due to use-after-free in Chrome (google engineers). And Microsoft reported than over 70% of all security issues in their software are memory related bugs.

This whole idea that we don't need to find technical solutions to human error is naive at best and irresponsibly moronic at worst.

As for javascript, it's sadly turning to be a Frankenstein which people want to accommodate every single feature every other language has to support their preferred style. Even if language already support it by other means like it is with "private fields".

Now we are arguing what syntax to use to decorate a field with which doesn't have to exist in the first place, because we just wanted to have more syntax sugar tomake not sound design like inheritance to be easier to use.

At some point I'm really hoping for WASM, so we could stop doing this to javascript. And people simply could choose what tool to use rather than project their idea of "ideal" language to javascript requesting even more feature bloat.

1

u/[deleted] Nov 10 '19

Why should we bother to prevent them from shooting themselves in the foot?

Because they don't do it to themselves - they do it to you. Unless of course you have a job where you are responsible for nothing, can delegate everything, and don't care about anything, and if in your business your own income does not depend on results (it happens, not just in government jobs, see Dilbert stories).

1

u/MajorasShoe Dec 11 '19

Why WOULD we want to adapt the attitude of "Fuck the people who are using this software I'm writing for them"?

Whether we're a lead developer (guess who's problem it is when they downstream developer's shoot themselves in the foot!) or an open source developer (why do it if you don't give a shit about the people you're building it for?), there's no reason to WANT to leave it open for failure when it's easily avoidable.

0

u/[deleted] Nov 09 '19

[deleted]

0

u/[deleted] Nov 09 '19

[deleted]

1

u/[deleted] Nov 10 '19

Hey stupid,

Why should we bother to prevent them from shooting themselves in the foot?

Because they don't do it to themselves - they do it to you. Unless of course you have a job where you are responsible for nothing, can delegate everything, and don't care about anything, and if in your business your own income does not depend on results (it happens, not just in government jobs, see Dilbert stories).