Re:Programmers are hipster librarians
by ape4 on Friday September 19, 2014 @12:51PM
(#8341281)
Should be:
[ Parent
| on HN ]
Not in ruby, which is the language he's writing the pseudocode in.
Correcting the syntax of pseudocode, you must be fun at parties.
You are going to kick sand in my face for being a nerd now.
No, for being a pedant. An incorrect one, at that.
In the C family, it should be ++frustration, for speed :p
For an integer, if the pre-increment value isn't used, GCC at least will generate the same code, even with optimization turned off:
int pre(int a) { int post(int a) {
++a; a++;
return a; return a;
} }
pre: post:
.LFB0: .LFB1:
.cfi_startproc .cfi_startproc
pushq %rbp pushq %rbp
.cfi_def_cfa_offset 16 .cfi_def_cfa_offset 16
.cfi_offset 6, -16 .cfi_offset 6, -16
movq %rsp, %rbp movq %rsp, %rbp
.cfi_def_cfa_register 6 .cfi_def_cfa_register 6
movl %edi, -4(%rbp) movl %edi, -4(%rbp)
addl $1, -4(%rbp) addl $1, -4(%rbp)
movl -4(%rbp), %eax movl -4(%rbp), %eax
popq %rbp popq %rbp
.cfi_def_cfa 7, 8 .cfi_def_cfa 7, 8
ret ret