Date: 2013-02-21 05:34 pm (UTC)
My argument is completely irrelevant to garbage collection or memory leaks. What is the benefit to the following (variable names are just for brevity):

var a, b, c, d, e, g, h, i, j, k, l, m, n, o;
o = 1;
n = o;
m = n;
l = m;
k = l;
j = k;
i = j;
h = i;
g = h;
f = g;
e = f;
d = e;
c = d;
b = c;
a = b;

This is adding a layer of abstraction that is completely unnecessary to the code that was shown in the original post. You already have references to the two pertinent pieces of information. You're saying it's fully valid to add two more references to the *exact* piece of information? I will admit, I have, on occasion, created my own version of object, either so I can extend it with additional methods, or reformat the data so that it make more sense internal to the application I'm developing. That is not the case here. The code declares two new references to existing data without an apparent improvement in readability, accessibility or clarity.

I agree that an introductory course is not necessarily the place to teach complete "best practices", but neither should it teach inherently bad practices which must then be unlearned later.

-Michael
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

elfs: (Default)
Elf Sternberg

May 2025

S M T W T F S
    123
45678910
111213141516 17
18192021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 7th, 2025 08:40 pm
Powered by Dreamwidth Studios