Tag: reference

52 votes
22 answers
1.7K views
List changes unexpectedly after assignment. Why is this and how can I prevent it?

While using new_list = my_list, any modifications to new_list changes my_list every time. Why is this, and how

avatar
Elicia
0 1 0 9
asked 07 September, 2021
59 votes
30 answers
1.4K views
How do I pass a variable by reference?

The Python documentation seems unclear about whether parameters are passed by reference or value, and the foll

avatar
Gigi
0 1 0 9
asked 07 September, 2021
52 votes
10 answers
1.3K views
MongoDB relationships: embed or reference?

I'm new to MongoDB--coming from a relational database background. I want to design a question structure w

avatar
Robyn
0 1 0 9
asked 07 September, 2021
52 votes
30 answers
2.2K views
Is Java "pass-by-reference" or "pass-by-value"?

I always thought Java uses pass-by-reference. However, I've seen a blog post that claims that Java uses p

avatar
Emilia
0 1 0 9
asked 07 September, 2021
62 votes
7 answers
2.3K views
get_instance() in Codeigniter: Why assign it to a variable?

In Codeigniter, get_instance() is a globally available function that returns the Controller super-object which

avatar
Winford
0 1 0 9
asked 07 September, 2021