840 karma · joined Nov 15, 2011 (15y ago) · 364 submissions
39.
Why Won't It(blog.cleancoder.com ↗)
10 points · by insertnickname · 7y ago · discuss
comment 7y ago · link · parent
It's not so much the extra typing that's the problem, it's the extra reading. All the stuttering is visual noise.
comment 7y ago · link · parent
The problem with relying on tests written after the implementation is that the checklist might be incomplete. If your checklist is incomplete, then you can't rely on it. Of course, even a highly disciplined practitioner of TDD cannot produce a test suite that is guaranteed to be complete and correct, but there is an enormous difference between a checklist that is adequate 50 % of the time and one that is adequate 95 % of the time.
Look for ways to avoid simply "going through the motions". Checklists (including TDD) are about avoiding making mistakes, not merely about noticing when you do make mistakes.
comment 7y ago · link · parent
comment 7y ago · link · parent
>This was a large, well designed study that supports previous research linking high blood levels of omega-3 fatty acids with prostate cancer risk. However, it cannot show that fish oil supplements cause prostate cancer and it is possible that other confounders affected men’s risk (although the researchers tried to take these into account).
Their conclusion contradicts their own headline.
comment 7y ago · link · parent
I agree with him that abstractions should be crafted carefully, but not because abstractions are categorically bad. If he thinks abstraction is so bad, why does he write software at all? Software is extremely abstract, even assembly language is an abstraction of what the CPU does. Human language is abstract too: we can talk about trees without having to consider any specific tree.
Abstraction is a fundamental building block of human civilization. Of course, he doesn't actually believe that abstractions are bad. It would be nice if he differentiated between good abstraction and bad abstraction.
On a side note: I take issue with his criticism of mocking. Good abstractions are easily mocked and make the code base easier to understand because you don't have to consider every detail of the application at the same time. On the other hand, mocking concrete objects,[0] rather than abstract roles, definitely complicates things.
[0] Or "header interfaces" that duplicate the API of a concrete class exactly : https://www.martinfowler.com/bliki/HeaderInterface.html
comment 7y ago · link · parent
Quoting from the blog post:
>It also seems that Go's implicit interfaces were designed to avoid unnecessary abstraction.
Actually, interfaces are often extremely abstract in Go. How much more abstract does it get than io.Reader? It's a thing that you can read bytes from into slices (arrays). The io.Reader abstraction is far simpler than os.File, net.Conn, or even bytes.Buffer (a file object, a network connection, and an in-memory buffer, respectively).