2 ms·
>But in your example, your only describing one specific task (n=1). That's to maintain parity with the example TFA gives. I'm not saying it's never worth it...
by coldtea 7y ago
>But in your example, your only describing one specific task (n=1).
That's to maintain parity with the example TFA gives. I'm not saying it's never worth it... Of course you'll optimize often repeated tasks, loops, etc.
Here's what TFA quotes as bad reasoning, because it makes fun of optimization effort in some cases:
"@tveastman: I have a Python program I run every day, it takes 1.5 seconds. I spent six hours re-writing it in rust, now it takes 0.06 seconds. That efficiency improvement means I’ll make my time back in 41 years, 24 days :-)"
Unlike TFA I agree with the twitting guy above that the efficiency improvement here wasn't worth it.
- juststeve 7y agoYeah agreed. i mean in that example, if tveastman wrote it in a fast language the first time, the rewrite probably wouldn't have been required. (i think that tweet was for a bit of a laugh anyway, because he can now write new code in Rust.) But as many languages support implicit static typing, the folklore that dynamic languages are "more expressive" is not actually correct. such as: let x = "string literal" //compiled as string let y = 42 //compiled as int let z : i32 = 100 //compiled with type declared as 32 bit int.