I don't get this C/C++ Joke

后端 未结 6 1089
北海茫月
北海茫月 2021-01-31 15:57

After reading this article on thedailywtf.com, I\'m not sure that I really got the joke.

It says there that some guy changed the code from

int function()         


        
6条回答
  •  深忆病人
    2021-01-31 16:44

    OIC, this is a source-code-churn issue

    At first glance the two forms are equivalent. The second one does look nicer but they do the same thing.

    But then I read the cited page.

    The problem is that the new guy churned the source tree, lots of it. It's bad form to troll through a giant source tree and make a meaningless change. Sure, perhaps one style is slightly better than another, but in practice, it should be a whole lot better before putting 1,000 deltas into a source code control system for people to wade through for eternity is justified.

    I suspect that this was a source release, or some other unmentioned complexity caused the editing of that many files to expand their distribution. The contributions to that site are edited quite a bit, but basically the issue is understandable without specifics.

    One of the problems with editing a zillion files for a style change is that the chance of an inadvertent error increases. This chance is greatly multiplied when a junior developer does it. Even for the experienced, there is Murphy's law to consider. If it happens right before a release it really is a hanging offense.

提交回复
热议问题