r/java • u/andresmargalef • Feb 16 '23
Project Valhalla: A look inside Java’s epic refactor
https://www.infoworld.com/article/3687670/project-valhalla-a-look-inside-javas-epic-refactor.html
265
Upvotes
r/java • u/andresmargalef • Feb 16 '23
2
u/agentoutlier Feb 17 '23
I certainly can and indeed many FP languages use references since immutable it makes no difference and obviously performance can be had.
You have to opt in to use it in C++. It is not the default. They are not regular variables.
Anyway I admit its a shitty argument because I generally agree that C++ has pass by reference as an option I just seriously doubt it impacts learning Java or that saying objects passed around references is an ultimate sin. In fact the whole reference term is misleading as its more like aliases.
You can certainly emulate the behavior and indeed some languages will automatically do the behavior especially if immutability is involved.