|
|
|
|
|
by rapala
3037 days ago
|
|
My comment "not something people do" was about directly accessing memory to circumvent the private data abstraction in c++ and I stand by that. I admit that I kinda pushed you into it, but you are moving the goal post. People indeed use public fields in languages like C and Javascript. In C it's often done for the sake of performance. Hiding data behind a pointer has a cost. In Javascript I would say it's lazyness above all. Front end programs often aren't that big nor pinacles of code quality. But it is possible to define abstract data types in both languages. ML makes it a bit easier and some times even more performant, but it doesn't "own" the idea. Abstractions are quite like immutability. You can enforce both in many languages, some just give you better tools for it. |
|
You say that, even when the language doesn't enforce it, people don't break it ..... except when they do. It doesn't really matter why, it simply makes every thing else more brittle as a consequence and limits how you can reason about your code.
You seem to trust that programmers will play by the rules, even if the compiler doesn't enforce them. We will simply have to agree to disagree. :)