Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> You need to be able to change the internal representation without breaking users.

Unless the user only links an opaque pointer, then just changing the sizeof() is breaking, even if the fields in question are hidden. A simple doc comment indicating that "fields starting with _ are not guaranteed to be minor-version-stable" or somesuch is a perfectly "reasonable" API.



I'd imagine semantic versioning to be more subjective with a language that relies on a social contract, because if a user chooses to use those private fields, a minor update or patch could break their code.

It does feel regressive to me. I've seen people easily reach for underscored fields in Python. We can discourage them if the code is reviewed, but then again there's also people who write everything without underscores.


The chance of someone relying on the size at an API level is extremely small. That's far less risky than exposing every field.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: