This Code Is CRAP (2011)
testing.googleblog.com
This Code Is CRAP (2011)
1–10 of 55 posts
Re: This Code Is CRAP (2011)
#2Re: This Code Is CRAP (2011)
#3Re: This Code Is CRAP (2011)
#4Also, (2011)
Re: This Code Is CRAP (2011)
#5(2011)
Re: This Code Is CRAP (2011)
#6This reminds me of a talk Sandi Metz did called "All the Little Things" where she covers the Gilded Rose kata. In the talk, she reworks her solution until there's almost nothing left showing the essence of the problem being solved.
The cyclomatic complexity metric is touted at each step as a proxy for goodness of design and removal of complexity. However, a weakness of the measure itself is that it doesn't account for the control flow indirection that happens through OO method dispatch itself.
At the same time, Kevlin Henney's talk called "Gilding the Rose" takes the same kata and arrives at a far more sane solution he works up to and reveals at the end.
Short functions used to be hot. Uncle Bob used to proselytize "The first rule of functions is that they should be short. The second rule of functions is that they should be shorter than that." Now emphasizing the benefits of longer functions is pretty trendy. https://github.com/johnousterhout/aposd-vs-clean-code
This industry is pretty idiotic sometimes ¯\_(ツ)_/¯
Re: This Code Is CRAP (2011)
#7Mild as this ironic passive aggressiveness is, can't imagine something like this in modern sterile corporate messaging.
Re: This Code Is CRAP (2011)
#8and
> Here’s why we think that CRAP1 is a good anti-pattern to detect. Writing automated tests (e.g., using JUnit) for complex and convoluted code is particularly challenging, so crappy code usually comes with few, if any, automated tests.
This is so wrong.
The formula uses code coverage as a fundamental metric, when in reality, a lot of people write code "correct from construction", so coverage is not even applicable. Many times too, people only care the use cases they care about work perfectly.
There are also many other reasons code is not tested, not because it's complex, but because it's simple.
Re: This Code Is CRAP (2011)
#9>Note: This post is rated PG-13 for use of a mild expletive. If you are likely to be offended by the repeated use a word commonly heard in elementary school playgrounds, please don’t read any further. Mild as this ironic passive aggressiveness is, can't imagine something like this in modern sterile corporate messaging.
Re: This Code Is CRAP (2011)
#10Title is editorialized. Original: "This code is CRAP" referring to code in review as Change Risk Anti Pattern. Also, (2011)