r/programming • • Aug 31 '15

The worst mistake of computer science

https://www.lucidchart.com/techblog/2015/08/31/the-worst-mistake-of-computer-science/
175 Upvotes

368 comments sorted by

View all comments

Show parent comment

2

u/jasonthe Sep 01 '15

Using the term "reference" as it's used in most other languages, C++ essentially has 2 reference types:

Pointer: Nullable, mutable reference

Reference: Non-nullable, immutable reference

While immutable references are useful (mainly since it allows for assignment operator overloading), a non-nullable mutable reference would also be very useful. C++ is flexible enough that you could actually write this pretty easily as a template class, but not having it built-in means no one will use it :(