"I want my code to run fast, so I pick the fastest language runtime for my code", says the dev who does not know the ways of the tao.
-
"I want my code to run fast, so I pick the fastest language runtime for my code", says the dev who does not know the ways of the tao.
Behold, their JS code:
// remove items equal to "item" in array "arr" function removeItem(arr, item) { let idx = arr.indexOf(item); if (idx < 0) return arr; let newArr = []; for (let i = 0; i < arr.length; i++) { if (i !== idx) newArr.push(arr[i]); } // isn't recursion great? return removeItem(newArr, item); }
(this example isn't realistic because This Type Of Guy typically uses TypeScript with
any
all over, but I was too lazy to do that) -
"I want my code to run fast, so I pick the fastest language runtime for my code", says the dev who does not know the ways of the tao.
Behold, their JS code:
// remove items equal to "item" in array "arr" function removeItem(arr, item) { let idx = arr.indexOf(item); if (idx < 0) return arr; let newArr = []; for (let i = 0; i < arr.length; i++) { if (i !== idx) newArr.push(arr[i]); } // isn't recursion great? return removeItem(newArr, item); }
(this example isn't realistic because This Type Of Guy typically uses TypeScript with
any
all over, but I was too lazy to do that)@toast what the fuck am I reading
also if this guy wants the fastest runtime, he should be programming in x86 assembly. No excuses. -
@toast what the fuck am I reading
also if this guy wants the fastest runtime, he should be programming in x86 assembly. No excuses.@fristi the worst implementation you've ever seen -
@fristi the worst implementation you've ever seen@toast every time someone shits on php for people making dodgy shit looking scripts in it, I will show them this snippet of javascript.
php gets way too much flak for this type of shit compared to javascript. -
@toast every time someone shits on php for people making dodgy shit looking scripts in it, I will show them this snippet of javascript.
php gets way too much flak for this type of shit compared to javascript.