News for hackers. Stuff that matters.
Re:Ask HN: How is the job search coming along for people who... by icedchai on Tuesday December 06, 2022 @01:31PM (#33884812)
Yes, I understand... But the result, practically speaking, is objects are passed by reference, just like I said. Methods/functions can modify their parameters.
Re:Ask HN: How is the job search coming along for people who... by foepys on Tuesday December 06, 2022 @01:59PM (#33885231)
But you cannot change the reference itself which is possible in languages like C, C++, C#, and many more.
Re:Ask HN: How is the job search coming along for people who... by ShroudedNight on Tuesday December 06, 2022 @02:23PM (#33885608)
It's been a while, but my understanding was that actual C++ references were immutable, and what you are describing can only happen as a result of passing a pointer by value.
Re:Ask HN: How is the job search coming along for people who... by westmeal on Tuesday December 06, 2022 @02:43PM (#33885893)
Yeah, you cannot 'reassign' a reference. The compiler will yell at you if you try. You can definitely modify values of your referenced object though, that's fair game. When it comes to pointers you can do whatever the hell you want but be careful.