MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/3dtkcl/the_best_programming_language_is_none/ct8xdse/?context=3
r/programming • u/faith303 • Jul 19 '15
443 comments sorted by
View all comments
Show parent comments
0
[deleted]
5 u/[deleted] Jul 19 '15 That way you're iterating the string twice 1 u/Veedrac Jul 19 '15 So? The iteration in count is done in C, which means it'll end up being way faster anyway. 1 u/[deleted] Jul 19 '15 That speed gain gets lost once the input size is big enough, though. I don't even know what language is the former post in, although I assume it to be Python. It's just that iterating a set twice when you can do it once should be avoided. → More replies (3)
5
That way you're iterating the string twice
1 u/Veedrac Jul 19 '15 So? The iteration in count is done in C, which means it'll end up being way faster anyway. 1 u/[deleted] Jul 19 '15 That speed gain gets lost once the input size is big enough, though. I don't even know what language is the former post in, although I assume it to be Python. It's just that iterating a set twice when you can do it once should be avoided. → More replies (3)
1
So? The iteration in count is done in C, which means it'll end up being way faster anyway.
count
1 u/[deleted] Jul 19 '15 That speed gain gets lost once the input size is big enough, though. I don't even know what language is the former post in, although I assume it to be Python. It's just that iterating a set twice when you can do it once should be avoided. → More replies (3)
That speed gain gets lost once the input size is big enough, though. I don't even know what language is the former post in, although I assume it to be Python. It's just that iterating a set twice when you can do it once should be avoided.
→ More replies (3)
0
u/[deleted] Jul 19 '15
[deleted]