Live data from Hacker News

Uncle Bob and Silver Bullets

hillelwayne.com

151–160 of 228 posts

Re: Uncle Bob and Silver Bullets

#151
post #143

Earlier quoted context omitted.

it's often not about expressivity, it's about conciseness. It's much easier to say a correct statement than it is to prove the statement correct. This seems to be the main cost to stongly typed static languages, all the time spent proving to the compiler that this thing is actually compatible with that thing.

As opposed to the main cost to dynamically-typed languages, all the time spent proving to the test suite and proving to your teammates that this thing is actually compatible with that thing. And I say this as someone who adores Python! Dynamic typing does not magically make problems go away, it just makes them easier to ignore (whether deliberately or accidentally).

> proving to the test suite and proving to your teammates that this thing is actually compatible with that thing.

I really don't know where that canard comes from. My test suites rarely if ever explicitly test compatibility.

They test for specific values: if I do this and that, do I get the value that I expect. The type "test" gets covered implicitly, because if it's not the correct type, it will also not be the correct value.

Re: Uncle Bob and Silver Bullets

#153
post #21

I think Uncle Bob is a great read just because he'll challenge some of your opinions and at least forces you to reason against his arguments. You won't have that if you only visit https://swiftisfreakingawesomeblog.com or http://www.igetpaidtolikethislanguage.org where everybody repeats your opinion. There's not a lot in Clean Code that I wouldn't recommend to most programmers.

I strongly recommend against reading Clean Code, because it only applies to Java-like languages, and it doesn't really make good advice anyway. It doesn’t even properly apply to C++, and certainly doesn’t apply to languages with different models (like Ruby or Python). Uncle Bob has made a very successful business out of saying things that sound profound, become popular, but are at best the technical equivalent of for…

Every type declaration implies a set of unit tests, and needing to actually write them is not better in any way.

Re: Uncle Bob and Silver Bullets

#154
post #96
post #89

Earlier quoted context omitted.

Completely agree with this. The post where Martin derides modern, type-safe languages (Kotlin and Swift) [0] was just unbelievable to me. "Ask yourself why we are trying to plug defects with language features. The answer ought to be obvious. We are trying to plug these defects because these defects happen too often. Now, ask yourself why these defects happen too often. If your answer is that our languages don’t preve…

Somebody should show Uncle Bob this: https://youtu.be/fPF4fBGNK0U My point being: yes, if we'd be perfect drivers at all times and in all weather conditions there would be no more accidents. Luckily for us auto designers haven't adopted this perspective :)

The top comment on that video, in light of the points being made in this thread, is quite ironic:

"And because of this 'improved safety' we have millions of drivers out there who drive even faster and take even more risks, because they think the new cars are so much safer. "

(of course this comment is silly, the number of motor vehicle deaths per capita is about a third of what it was 50 years ago: https://en.wikipedia.org/wiki/List_of_motor_vehicle_deaths_i...)

Re: Uncle Bob and Silver Bullets

#155

I think that automated testing is superior to any other tool/technique that we can use to avoid mistakes in programming. Can anyone argue with this? What is the alternative?

Static typing combined with functional programming is superior to automated testing, although the three are actually complementary, because automatic, property-based testing works better if you have type info (such that the library knows what values to generate) and referential transparency, because side effects can be awkward to specify as laws.

So it is not a coincidence that Haskell developers have innovated testing tools and are now sold on QuickCheck, those two working well together ;-)

Being the Scala developer that I am, I love ScalaCheck, but I’ve also used jsverify for JavaScript ... not as good as ScalaCheck or QuickCheck, due to not having static typing and type classes btw, but did the job.

Re: Uncle Bob and Silver Bullets

#156

My problem with Uncle Bob's opinions is that they are pretty common within the industry, even if "discipline" really isn't the issue and all those negative feelings people allude to are warranted. In general, people are made to feel guilty for not being able to use the shitty tools and techniques we are given. Lets take for example ORMs and Hibernate in particular. I can't tell you how many times I've seen horrors re…

Someone help me with the origin of this (paraphrased) quote, which I have not been able to re-find on my own: "The sooner you admit that you can't fit the whole program's source code in your head, the sooner you can begin incorporating that into your design."

Notes on Structured Programming: http://www.cs.utexas.edu/users/EWD/ewd02xx/EWD249.PDF

Page 3:

  Summarizing: as a slow-witted human being I have a very
  small head and I had better learn to live with it and to
  respect my limitations and give them full credit, rather
  than to try to ignore them, for the latter vain effort
  will be punished by failure.
The Humble Programmer: http://www.cs.utexas.edu/users/EWD/ewd03xx/EWD340.PDF

Page 11:

  The competent programmer is fully aware of the strictly
  limited size of his own skull; therefore he approaches
  the programming task in full humility, and among other
  things he avoids clever tricks like the plague.
He expressed similar thoughts on other occasions. And there are others who express the same idea.

Re: Uncle Bob and Silver Bullets

#157
I'm sure this comment will get buried because I'm so late to the thread but oh well.

"Later, the guilty programmer thanked the lead developer for protecting him. He said: “I knew I shouldn’t have reused that code, but we were in a rush.” She smiled at him and told him not to worry about it."

This quote describes the real issue. Uncle bob is equating software development as some kind of unified profession and making apples to apple comparisons for all software projects. But software development is not like being a civil engineer or being a doctor. Writing software is totally different from heart surgery or bridge building.

Software development is applied differently to all projects and all projects having varying needs about quality and cost. If you are building a bridge it there is a high standard of quality every time. If you take a shortcut you may kill people, or more likely never pass inspection.

In software sometimes you could kill someone but far more often the quality of the software may not matter. There are times when it makes sense to cut corners, there are times when it makes sense to do a quick hack, there are times your boss makes the decision to something the worst way possible and fix it later, and sometimes that's ok. There are other times when it's not ok.

Every person on earth has an ethical obligation to not bring physical harm to others and should avoid doing so even at the cost of employment. But no one has an ethical obligation to write "good" code just for the sake of it. There are times when the best thing for everyone is writing software badly.

Maybe software engineers should have some widely disseminated ethical principles, but they have to be realistic and take into account the entire spectrum of software development. We have different ethical standards depending on the type of project we are working on. If you are a developer working on software for Airline Autopilot you have different ethical obligations from a developer working on Angry Birds 10.

Re: Uncle Bob and Silver Bullets

#158

My problem with Uncle Bob's opinions is that they are pretty common within the industry, even if "discipline" really isn't the issue and all those negative feelings people allude to are warranted. In general, people are made to feel guilty for not being able to use the shitty tools and techniques we are given. Lets take for example ORMs and Hibernate in particular. I can't tell you how many times I've seen horrors re…

I think you don't see much TDD in companies because, when a snag is hit, the first thing out the window is testing.

Re: Uncle Bob and Silver Bullets

#159
post #143

Earlier quoted context omitted.

As opposed to the main cost to dynamically-typed languages, all the time spent proving to the test suite and proving to your teammates that this thing is actually compatible with that thing. And I say this as someone who adores Python! Dynamic typing does not magically make problems go away, it just makes them easier to ignore (whether deliberately or accidentally).

> proving to the test suite and proving to your teammates that this thing is actually compatible with that thing. I really don't know where that canard comes from. My test suites rarely if ever explicitly test compatibility. They test for specific values : if I do this and that, do I get the value that I expect. The type "test" gets covered implicitly, because if it's not the correct type, it will also not be the cor…

The problem is that without knowing the type in question you don't know the values you're testing with cover all of the possible cases. When interfacing with an external dynamically-typed function this requires attempting to reverse-engineer the types from the definition (and recursively for all the functions it calls).

Re: Uncle Bob and Silver Bullets

#160
After reading the post by Hillel Wayne I decided to read Uncle Bob's article that is mentioned in the post (http://blog.cleancoder.com/uncle-bob/2017/10/04/CodeIsNotThe...). After reading both posts, and after reading most of the comments on this thread, I have to admit that my inclination is in favor of Uncle Bob. I agree with most of the points Uncle Bob made in his blog post.

Tools are not the answer. TDD is not the answer. Agile is not the answer. More programming languages are not the answer. There is no silver bullet. For me the answer is to do the best I can, with the tools I have.

Never stop learning, always strive to improve my skills. And yes, it takes discipline.

Post reply on HN