News for hackers. Stuff that matters.
Re:TDD did not live up to expectations by Joeri on Thursday June 29, 2017 @05:02PM (#14666850)
They thought "refactoring" was a made-up word that programmers used to cover up dicking around and wasting time. From a non-programmer's perspective, all they see is the programmer spending several hours with the end result being that nothing has visibly changed.

The thing is, many refactoring efforts make code worse, not better. Refuctoring is something I've observed many times over, by people who consider themselves quite skilled at the art. The end result of their efforts is that the code is fancier or trickier, not more robust or easier to understand.

So, from a manager's perspective, how are you to discern between a programmer whose refactoring efforts save time down the road, and one whose efforts lose time down the road. Of course, normally you have technical leadership that can make this distinction and makes sure those people get a cold hard reality check, but many organizations discourage technical people from gaining enough power that they can stop other technical people in their tracks before they mess things up.

Re:TDD did not live up to expectations by moron4hire on Friday June 30, 2017 @10:37AM (#14671004)
Even in the honest case, I think people go about it wrong. Refactoring as a separate step is going to get a lot of push-back from a lot of different places. But there frequently is a need to change the structure of existing code to make room for new features (especially if you're on a team having to deal with "refuctoring").

Just put it in the estimate for that new feature. When your boss starts to needle you about why such a "simple" feature is taking so long, that is when you throw the bad code under the bus. You get to demonstrate a real need, rather than just a theoretical one.

The older I get, the more I believe "Big Bang" code is a bad idea, no matter what the bang actually entails. Gotta make a branch to make a feature? Gotta rewrite a large part of the underpinnings of the app to make things able to move forward? Please don't, please develop it in parallel in the mainline.

In a way, refactoring on its own violates TDD. You are supposed to write failing tests first, then write code that passes the test. Refactoring as it is described by the most zealous of TDD advocates is just a hand-waiving over writing code without testing. If we're being strict about it, write a test that proves the code needs to be changed, then you can change the code. If we're not being strict about it, what is even the point?

Regression is some of the biggest harm that can come to users, because it violates their ingrained expectations. Greenfield defects might prevent the adoption of a new feature, in which case the status quo is maintained, but regression is forward progress that is physically lost.

Re:TDD did not live up to expectations by charlieflowers on Thursday June 29, 2017 @06:54PM (#14667499)
Did you intend to say "Refuctoring"? It could be a typo or it could be clever wordplay. And it leads to two drastically different interpretations of what you're saying :)
Re:TDD did not live up to expectations by nickpsecurity on Thursday June 29, 2017 @09:22PM (#14668093)
I think I'm going to start using that one. Especially on ports of legacy software from one, crappy language to another crappy language. I'd especially guess that the COBOL to OOP COBOL translations involve a lot of refuctoring. I just gotta remember to give Joeri credit for coming up with it.
Re:TDD did not live up to expectations by mdpopescu on Friday June 30, 2017 @09:12AM (#14670457)
Greg Young also uses that word :)
Re:TDD did not live up to expectations by Joeri on Friday June 30, 2017 @12:53AM (#14668707)
Sorry, for not making it clearer. I did mean to spell it with a 'u'.