tag:blogger.com,1999:blog-6140632138569689510.post6609692630522598261..comments2023-03-25T08:40:15.248-07:00Comments on missingbytes: Whitespace, you're doing it wrong.missingbyteshttp://www.blogger.com/profile/00276195535678106593noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-6140632138569689510.post-2305166551315344462018-03-22T15:08:31.716-07:002018-03-22T15:08:31.716-07:00Hi @Felice! Welcome :D
You raise an interesting po...Hi @Felice! Welcome :D<br />You raise an interesting point which warrants an entire blog post by itself! <br />TL;DR:<br /> for(auto i=a.begin(); i<a.end(); i++){...} //vanilla<br /> for(auto i=a.begin(); i<a.end(); ++i){...} //faster?? (*)<br /> for(auto &v : a){...} //better...<br /><br />(*) Only faster if no move semanticsmissingbyteshttps://www.blogger.com/profile/00276195535678106593noreply@blogger.comtag:blogger.com,1999:blog-6140632138569689510.post-40471175096232542512018-03-22T14:10:20.326-07:002018-03-22T14:10:20.326-07:00I hate to necropost on a three-year-old blog threa...I hate to necropost on a three-year-old blog thread on a random site, but...<br /><br />@Unknown - You consider it worse to pre-increment? Granted, with integer values that aren't actually evaluated, it makes no difference, but with an iterator that isn't evaluated, it does make a difference, as a post-increment operation on an iterator always requires more work (save value, do increment operation, return saved value). People need to pre-increment habitually, even on integers, so they'll be in the right habit when it matters. Preferring post-increment just because it's a familiar style is a poor excuse for a genuinely bad habit.Felicehttps://www.blogger.com/profile/03513373067905307911noreply@blogger.comtag:blogger.com,1999:blog-6140632138569689510.post-78706333242045113232015-01-25T12:32:34.851-08:002015-01-25T12:32:34.851-08:00Your "byte stream to pixels" example is ...Your "byte stream to pixels" example is a bit broken - the middle rendering isn't actually from the bytestream presented, unless the editor is seriously screwing with you. It both has additional spaces, and worse pre-increments i instead of post-incrementing it.Unknownhttps://www.blogger.com/profile/10074148119346343309noreply@blogger.comtag:blogger.com,1999:blog-6140632138569689510.post-64454361063206787452015-01-18T00:24:18.712-08:002015-01-18T00:24:18.712-08:00Hey Mark!
'Which formatting choice offers the...Hey Mark!<br /><br />'Which formatting choice offers the higher likelihood of a document being readable when opened in a random text editor'?<br /><br />Setting aside for a minute that 'being readable' is still a subjective test (Is Russian more readable than English? Yes if you're Russian, No if you're English...), there's still the problem that the authors of those random text editors presumably made choices to make them more readable. The ones who chose to represent tabs as 8 spaces (e.g. vim) would presumably prefer the tabbed version of your document. That means there's a non-zero number of programmers (including all the ones who are the authors of the 8xSPACE editors) who would come up with a 'TABS' as an answer on your test.<br /><br />Compare that with 100% of programmers who would agree that the size on disk (on average) is never larger for TABS compared with 4xSPACE. i.e. not just most of them, or 99.999% of them, but literally all of them, every single one, without exception. Even the programmers who prefer 4xSPACE.<br /><br />Just one other point, we must be careful about polling programmers about what other programmers think, it's the equivalent "Do you think most astronomers would agree Pluto is a planet?" - great for building consensus, terrible for being objective. We actually have a definition for what constitutes a planet. To be objective means to apply that definition. To be subjective is to ask opinions.<br /><br />>This IMO is problematic - it'd be OK if there existed *exactly* one objective test...<br />Yeah, you raise a good point. I've tried to address it a bit later on, but keep in mind this is only used in the 'existence proof' section, as in the 'base case' for a http://en.wikipedia.org/wiki/Mathematical_induction . Actually, I think it unlikely the 'disk space' metric would be used in a formal definition of the Kolmogorov Style, (i.e. a formatting style based on minimizing Kolmogorov complexity) I just use it here because it is convenient and mush more familiar to a casual audience.missingbyteshttps://www.blogger.com/profile/00276195535678106593noreply@blogger.comtag:blogger.com,1999:blog-6140632138569689510.post-5861924227823375112015-01-17T16:53:04.667-08:002015-01-17T16:53:04.667-08:00> If there exists even one objective scientific...> If there exists even one objective scientific test against (i.e. 100% of competent C++ programmers would complete the test and choose 4xSPACE over TAB) then please post such a test in the comments below.<br /><br />How about:<br /><br />'Which formatting choice offers the higher likelihood of a document being readable when opened in a random text editor'?<br /><br />I'm a tabs man myself, but I thought that was the point of spaces - and it's quite a good one. In some contexts, I can see it being very important, perhaps more important than storage space.<br /><br />> “There exists at least one objective test which can be used to make a decision between alternative formatting options.”<br /><br />This IMO is problematic - it'd be OK if there existed *exactly* one objective test, but there is usually (almost always?) more than one such test - and they can give conflicting results, ala tabs vs spaces.<br /> <br /><br />marksiblyhttps://www.blogger.com/profile/15527495082612941633noreply@blogger.com