Olaf Schlüter
1 min readDec 14, 2023

No, that is not why we use them. We use them to be able to mutate memory through the reference. No one ever wants to have memory structures being mutated in "various places". No, I am not a functional programming evangelist. But having memory structures subject to change in "various places" is asking for trouble. Every method or function granting me immutability of its arguments is a relief.

And value types aren't always an option. The two most important programming languages of all times so far, C and C++ do not have those for structs and class objects, And deep copy of data structures (which would be required to support pass-by-value for everything) isn't the thing you want to have most of the times. You want to have zero-copy pass of arguments everywhere. And state those places where mutation may happen.

So there is a reason for things like immutable references and almost every programming language these days have them, including C and C++. And this won't be dismissed by blogs here on medium. This is a more serious debate you may find in universities. Why is it that every Joe and Jane thinks he/she knows it better than those doing professional research?

TL:DR;: doesn't look like you know what you are talking about.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Olaf Schlüter
Olaf Schlüter

Written by Olaf Schlüter

IT security specialist, Physicist by education, believing in God as for the exceptional harmony of the laws of nature to create and support life.

Responses (3)

Write a response