News for hackers. Stuff that matters.
Re:C++ vs. Rust Build Times by gavinray on Friday January 06, 2023 @03:40PM (#34280731)

  > I think anyone who's done anything beyond beginner JavaScript is going to understand the difference between pass by value and pass by reference, even if they don't call them that?
Pass-by-reference is a concept that is unfamiliar to many (most?) modern JS/TS developers, as the common idiom is that you "return" a new object or value at the end of your function.

If you want to update a value in an existing object, you pass it by value and return a clone of it with the updated values

Performance doesn't matter, you can do the most pants-on-head-stupid thing you can imagine, or have your frontend page/component be re-rendering 20 times on every state change, and it makes no perceptible difference. (This has been my experience)

It wasn't until I learned C that I realized you might even program in this fashion (somewhat to my horror) where passing variables to functions could mutate them

Re:C++ vs. Rust Build Times by petesergeant on Sunday January 08, 2023 @12:05AM (#34296215)
> It wasn't until I learned C that I realized you might even program in this fashion (somewhat to my horror) where passing variables to functions could mutate them

If you pass an array to a function in JavaScript, then any changes you make to it will mutate the version the caller has.