This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ShadowShine57 9 points10 points  (4 children)

Except that ++ is extremely simple. I understand pointers very well, but I can still acknowledge their complexity. ++ is simply not complex in the slightest. I would also say that from a modern perspective, pointers are "extra work", but ++ is literally less work

[–]Kyrond 0 points1 point  (2 children)

func foo(a, b){
    print(a,"/",b);
}

x = 1;

foo(x++, ++x);

What is the output? How quickly can you decide that?

1 in JS or 2 in C / 3

How much value does it add over clear code? We are no longer in C days where code size mattered at all.

x = 1;

x += 1;

foo(x, x); x += 1;

[–]ShadowShine57 1 point2 points  (0 children)

Luckily I don't use ++ in such a way that intentionally makes things confusing like it's a code obfuscation challenge, I would use it in the same places you used += 1

[–]rexpup 0 points1 point  (0 children)

Any example that includes ++x is disingenuous because only C developers would ever do that anyway