Hacker News new | past | comments | ask | show | jobs | submit login

The fundamental problem with C++ is that it has hiding ("abstraction") without safety. That's rare.

- C -- No hiding, no safety

- Python, Javascript, LISP, other interpreted languages -- hiding with safety

- Pascal, Ada, Modula, Rust -- hiding with safety

- C++ -- hiding without safety.

C++ is, decades late, trying to get to hiding with safety. But there's too much legacy.




Well C has functions. Isn't that the original hiding abstraction?


It is an abstraction, but the safety requirements are neither enforced nor abstracted away.

C's type system can't communicate how long pointers are valid for, when and where memory gets freed, when the data may be uninitialized, what are the thread-safety requirements, etc. The programmer needs to know these things, and manually ensure the correct usage.




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

Search: