tag:blogger.com,1999:blog-5089773352404981635.post9110665934253058118..comments2023-10-04T08:15:13.812-07:00Comments on Daily scala: zipWithIndexAnonymoushttp://www.blogger.com/profile/07600430363435495915noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-5089773352404981635.post-63517753674290349762015-03-24T13:29:36.349-07:002015-03-24T13:29:36.349-07:00Ideology? I don't think you know what that wor...Ideology? I don't think you know what that word means.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5089773352404981635.post-61996158318215001192012-06-01T09:26:56.505-07:002012-06-01T09:26:56.505-07:00A couple years after your last post and I'm st...A couple years after your last post and I'm still finding your blog useful and inspiring. Perhaps instead of daily scala, you'd write about your other open source work in Scala? Regardless, thank you for the work done here.matiashttps://www.blogger.com/profile/03025931747390992632noreply@blogger.comtag:blogger.com,1999:blog-5089773352404981635.post-84317824116489704742010-12-23T16:19:26.109-08:002010-12-23T16:19:26.109-08:00Hope you'll get back to blogging again soon! :...Hope you'll get back to blogging again soon! :)Gabrielhttps://www.blogger.com/profile/10084723413561739772noreply@blogger.comtag:blogger.com,1999:blog-5089773352404981635.post-85029203609147799552010-12-07T03:11:47.865-08:002010-12-07T03:11:47.865-08:00sad I know but I have been spending all my spare t...sad I know but I have been spending all my spare time on Scala IO. I sadly have much less free time than I would like. :(Anonymoushttps://www.blogger.com/profile/07600430363435495915noreply@blogger.comtag:blogger.com,1999:blog-5089773352404981635.post-88577833965090918762010-12-05T22:02:21.049-08:002010-12-05T22:02:21.049-08:00This article more than 6 months ago was the last p...This article more than 6 months ago was the last post on a daily blog ... wha' happened? I know the blogger is ok because he tweeted yesterday.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5089773352404981635.post-60288890675186324222010-12-05T21:40:18.278-08:002010-12-05T21:40:18.278-08:00The first comment is a perfect example of ideology...The first comment is a perfect example of ideology replacing intelligence. This is a <i>general</i> article on iterating through a collection with an index; it is obviously the right place to mention the double iteration issue and how to solve it and it would be incompetent not to. And using views in this case is not premature optimization, it is simply a matter of understanding one's tools and using them properly; omitting the view would be amateurish -- in the real world, pointlessly doing twice as many list traversals as necessary has consequences.ianamnoreply@blogger.comtag:blogger.com,1999:blog-5089773352404981635.post-77429172935198326002010-08-12T04:02:13.095-07:002010-08-12T04:02:13.095-07:00The latter example (with filter) I'd rather wr...The latter example (with filter) I'd rather write it with for comprehensions:<br /><br />for ((value,index) <- list.zipWithIndex if index % 2 == 0) yield value<br /><br />JAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5089773352404981635.post-79473325900102016632010-06-30T12:13:17.255-07:002010-06-30T12:13:17.255-07:00"But wait!
Does that not trigger an extra it..."But wait!<br /><br />Does that not trigger an extra iteration through the collection?. Indeed it does and that is where Views help."<br /><br />This is a perfect example of premature optimization. Worrying about this is almost never worth it.Anonymousnoreply@blogger.com