tag:blogger.com,1999:blog-7317245822288637185.post3068666746366536430..comments2023-03-28T10:19:42.467-07:00Comments on Graham Hacking Scala: Missing Parameter Type For Expanded Function?Graham Leahttp://www.blogger.com/profile/07862939329898536954noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-7317245822288637185.post-14836176355609696812010-11-09T17:53:59.262-08:002010-11-09T17:53:59.262-08:00I can see how avoiding it is probably a good idea ...I can see how avoiding it is probably a good idea in many situations - it is a character that tends to disappear amongst everything else going on. However, in simple scenarios it can really cut down the amount of code required.<br /><br />Consider this for example:<br /><br /> List("one", "two").map {"and " + _}<br /><br />without using underscore would become this:<br /><br /> List("one", "two").map((s:String) => {"and " + s})<br /><br />It's a fair bit uglier, yeah?Grazerhttps://www.blogger.com/profile/00435359638152521056noreply@blogger.comtag:blogger.com,1999:blog-7317245822288637185.post-51395971125961888842010-11-07T04:52:42.850-08:002010-11-07T04:52:42.850-08:00I'm coding scala since some time now and also ...I'm coding scala since some time now and also read a bit about that. I can tell you that i would personally avoid the underscore as much as possible, why? There was a thread on the mailing list about all the different meanings of the underscore, it's just too many (IMHO).Andreas S.https://www.blogger.com/profile/02348200687113193504noreply@blogger.com