6 ms·
Here is the post this post is in response to: http://blog.cleancoder.com/uncle-bob/2017/10/04/CodeIsNotTheAnswer.html http://blog.cleancoder.com/uncle-bob/2017
by Terretta 9y ago
Here is the post this post is in response to:
http://blog.cleancoder.com/uncle-bob/2017/10/04/CodeIsNotTheAnswer.html http://blog.cleancoder.com/uncle-bob/2017/10/04/CodeIsNotThe...
I don’t interpret the original piece as saying any of these tools and techniques are not useful.
I interpret it as saying average developer mindset needs to shape up.
I tend to agree. I work with guys who believe in formal reasoning tools (we collaborated with Amazon’s ARG for example[1]), and use all these tools. These guys are almost compelled to write these tools and evangelize using the tools in an effort to help, because the developers around them don’t carefully reason about their code and it makes the guys who care crazy.
So you have two camps. People who believe correctness is important, and people who think continuous deployment is an answer to bugs. The first group is trying to help the second group through tools that can become part of the SDLC.
I read “Uncle Bob” as suggesting that’s not enough, it’s not the root cause — the second group needs to care.
I see nothing in his post that suggests the tools shouldn’t be used. (“I think that good software tools make it easier to write good software.“) But if the crowds in his talks aren’t using unit tests, are they really going to be using TLA+?
First, do no harm, then use like Light Table, Model Driven Engineering, and TLA+.
I take that as his point, and it seems painfully valid.
1. https://www.slideshare.net/mobile/AmazonWebServices/aws-reinvent-2016-automated-formal-reasoning-about-aws-systems-sec401 https://www.slideshare.net/mobile/AmazonWebServices/aws-rein...
- JamesFM 9y ago> I don’t interpret the original piece as saying any of these tools and techniques are not useful. I don’t even know if that is up for interpretation, > I have nothing against tools like this. I’ve even contributed money to the Light Table project. I think that good software tools make it easier to write good software. However, tools are not the answer to the “Apocalypse”. If this is indeed the article OP is responding too I can’t but help he was missing the point. The point is scheduling pressures lead to awful code because quality is cut.
- watwut 9y agoI had luck to work on some projects without time pressure. Some people still produced low quality work.
- tom_mellior 9y ago> First, do no harm, then use like Light Table, Model Driven Engineering, and TLA+. Looking at some of Uncle Bob's other posts linked from this article, I don't think that's what he's saying. He (Uncle Bob) goes on and on about discipline, but at the same time dismisses anything that might actually force programmers to be disciplined, like type systems that force you to check references for null before dereferencing them. For example, in http://blog.cleancoder.com/uncle-bob/2017/01/11/TheDarkPath.html http://blog.cleancoder.com/uncle-bob/2017/01/11/TheDarkPath.... he asks: "It is very risky to have nulls rampaging around the system out of control. The question is: Whose job is it to manage the nulls. The language? Or the programmer?" and goes on to answer: "Defects are the fault of programmers. It is programmers who create defects – not languages." Then he goes ranting about programmers who don't test their code, and if only they tested, such type systems would not be needed. Again: He dismisses the one thing that actually forces programmers to be disciplined and instead just wishes (against all evidence) that they were disciplined. To me, he seems to be saying "First, do no harm, then use tests, then nothing."
- falcolas 9y agoNo tool will ever successfully enforce discipline. If anything, it makes people more lax. "I don't have to reason about whether this can be null, the type system takes care of that for me." "I don't have to worry about leaking memory, valgrind will let me know." "I don't have to pay attention to the road, Tesla's autopilot takes care of it for me." All the tools do is enforce a loop of compile -> make compiler happy -> compile.
- wasted_intel 9y agoSo, you're advocating removing the "make compiler happy" step and you think that will lead to greater discipline? If the tool automatically fixed it, you'd have a point, but most if not all of the static analysis tools I've come across simply point to the error and leave it up to the developer to fix, which is the right thing to do, reinforcing good habits.
- gregmac 9y ago
- Tehnix 9y ago> People who believe correctness is important, and people who think continuous deployment I don't see why these exclude each other? You can easily have both, through e.g. powerful type systems (a la Haskell) and still use continuous deployment. > I interpret it as saying average developer mindset needs to shape up. I think you're giving Uncle Bob too much leeway. If you go through his other posts it should be a bit more clear, but he is very much focused on the programmer being at fault. Heck, in one (as the other commenter pointed out) of his posts he even says that it's never the languages fault (which is obviously wrong, you can eliminate wrong behaviour with good language design). Another example is http://blog.cleancoder.com/uncle-bob/2017/01/13/TypesAndTests.html http://blog.cleancoder.com/uncle-bob/2017/01/13/TypesAndTest... where he states, So, no, type systems do not decrease the testing load. Not even the tiniest bit. But they can prevent some errors that unit tests might not see. (e.g. Double vs. Int) Which is not just something taking out of context, it's more or less the thesis of his article. He really shows here his inexperience with what powerful type systems can do, and I can assure you that you can definitely cut down on a wealth of tests by modelling things in the type system instead - let the compiler do the job for you.
- rev_null 9y agoPlus, there are systems like quickcheck that can greatly simplify the act of writing tests.
- bad_user 9y ago> I don’t interpret the original piece as saying any of these tools and techniques are not useful. You haven't been reading much of Uncle Bob's articles or tweets then, because that's exactly what he's saying and there's no point in second guessing.
- Stranger43 9y agoIt's Clear from that that it's been a while since Bob Martin worked in the real world with real bosses, budgets and deadlines. The problem is that the business tend to drive the "if it compiles, ship it culture" but also want to blame some lowly replaceable coder for any mistake so the organization and it's leaders can avoid any responsibility for any damage done due to their decisions to ship first and test later. And Bob Martins post seams to cater perfectly for that sentiment, of never blaming the CIO/CXO for demanding the impossible, and overruling concerns but laying the blame entirely on the lowest and least powerful link in the chain. People tend to forget that shipping despite warnings from a formal test suite, is baiting an audit failure in a way that overruling concerns voiced by actual people.
- s73ver_ 9y agoBecause Uncle Bob isn't speaking to the CXO. He's speaking to those first line developers. And he's saying that those people need to push back, they need to stand up and tell the bosses that what they're doing is unsustainable.
- unclebobmartin 9y agoIt's the CEO's job to demand the impossible. It's the engineer's job to deal with reality. When the engineer tells the CEO that the impossible is possible, the engineer has forsaken his/her responsibilities.
- subwayclub 9y agoIt's also the engineer's job to make rent and pay their health insurance despite unreasonable demands. But apparently the only part of this labor issue we want to discuss is the nobility of sacrifice.
- mannykannot 9y ago> So you have two camps. People who believe correctness is important, and people who think continuous deployment is an answer to bugs. I am curious as to how the people of the second group (if they do, in fact, exist) think that the continuous deployment of serially faulty code is a solution to anything.
- dtauzell 9y agoI don't think there is such a group (or at least it is very small). What continuous deployment does do is help you find bugs faster as they get shipped sooner. It also promotes more automated testing which can help as well since manual testing is less likely to fully regress everything.
- Terretta 9y ago> What continuous deployment does do is help you find bugs faster as they get shipped sooner. Yep, that's the thinking that stresses me in the second group.
- aidenn0 9y agoThis post is not in response to just that post. It's important to take that post in the larger context of what Bob has said. He has many times implicitly (and some times explicitly) made the claim that typed languages are uninteresting because the type checker merely duplicates the work that unit tests accomplish. As an aside, I rarely write unit tests, but I often use static analysis tools. I find that for the majority of the software I write, I get more bang for the buck with functional and integration tests than I do with unit tests.