News for hackers. Stuff that matters.
Re:Goodbye, Clean Code by jt2190 on Saturday January 11, 2020 @06:12PM (#22023090)
> You should not take issue of your work being reverted (for good reasons), like other people should not take issue of "their" code being modified. Better ask for forgiveness than permission.

Changing one developers _working code_ after they’ve invested a significant amount of time into without discussing it with the team first it is to basically heap on a number of unwritten requirements and also decide that the schedule allows for addressing them. If removing repetitive code is a requirement then the team needs to be informed that code will be reviewed for repetition, and introduced to various techniques for spotting and removing repetitive code. The schedule also needs to be adjusted to allow for this additional work.

And if the rewritten code is so superior than perhaps there needs to be a discussion about whether there should even be a team, or whether the other people should be let go and all work assigned to the developer who can do the work “properly” the first time. After all, what’s the point in having one developer’s work constantly rewritten by another?

Re:Goodbye, Clean Code by celticmusic on Saturday January 11, 2020 @09:07PM (#22023951)
So relevant.

I had an experience this year where I was working with another developer. This guy would legit walk behind me rewriting everything I did. To put this into perspective, I've been doing this work for over 20 years this guy came out of a bootcamp last year.

But it wasn't even that this guy was rewriting things, it's that he was constantly breaking things as a result. Imagine every fucking day you come in and something's broken that was working last week and you're like "wut?!? that was working, what happened?!".

This was a contract with a guy I'd been doing work with for years. The other developer was from another country and was one of his first employees. The straw for me was when he rewrote my small testing framework. I spent about a day trying to standup a unit testing library in the framework they were using and finally decided it would be quicker to just write a simple testing mechanism + runner, which took me a few hours to do. I come in the next week, and this guy had taken that idea, and then just rewrote the entire thing.

I called the owner up and just straight up told him he's paid me to do nothing. Literally every single line of code I've written has been rewritten by this guy, only in a shitty, buggy manner. That was 2 months in, and at that point I had tried talking to the guy about it and I was done.

Fast forward to today and that system STILL isn't working. It would've taken me 4 weeks at MOST to build and stabilize. We're coming up close to a year now. I'm still good friends with the owner so I ran cloc over the codebase. It went from 3k LoC to 21k LoC. The owner finally admitted to me that he's going to be paying for employing that developer for a very long time.

So while I understand the sentiment about not 'owning' code and would have agreed with it before this experience, the trust issue with respect to rewriting is waaaaay bigger than that.

I told the owner that this developer should never have been let near a code base with any ability to make decisions on their own. They needed years of mentorship. I literally disagree with every single decision they make. It's mystifying. It's almost like the guy always asks me my opinion and then does the complete opposite, only that's not the case.

Re:Goodbye, Clean Code by latchkey on Saturday January 11, 2020 @09:37PM (#22024088)
You sound really angry about it and you've hung onto it for quite some time. A good friend of mine used to tell me 'who cares?' when I would rant on about things just like you just did. It is honestly startling to hear that in response to a rant. If you answer 'i care!', then that is exactly the problem.

Let it go, it isn't worth it. At the end of the day, I'd say this is your problem to work on. You didn't step back, slow down, forget about the code, and mentor the other developer well enough when you were there. That is kind of exactly what the OP is saying in his post.

(Side note: I've been you many many times and it only hurt me in my career. I actively work against it now and things have been much better.)

Re:Goodbye, Clean Code by celticmusic on Sunday January 12, 2020 @05:05AM (#22025477)
Your supposition is that caring about the quality of your work is a problem.

We should simply not continue this conversation because we fundamentally disagree. I don't get out of bed for "I don't care".

This other developer has put this new business at risk of closing. Maybe you don't care, but someone somewhere does.

Re:Goodbye, Clean Code by user5994461 on Sunday January 12, 2020 @07:33AM (#22025999)
Just leave the job already.

I've only seen that once in my career. One developer rewriting existing code constantly, to such an extreme degree it's unfathomable.

He rewrote large amount of scripts (often overnight). Other developers would wake up the next day or continue the project next week, only to find a swath of issue reported by users and the project is gone (rewritten and moved). Did that for while, destroying the work of many people across a number of teams, making enemies and leaving a trail of projects ablaze. Didn't manage to get him fired (organizations rarely fire people) so over time other developers simply stopped working (what's the point when it will be undone the next day) or left.

At first, I thought this was the normal junior mistake. Reading code is quite hard, so one reflex of junior developers is rewrite existing code to make it "prettier" or "better", of course it's just a path to understanding the code because they understand what they just rewrote after the fact. One aspect of learning real world software developer is to stop the urge of constantly rewriting like that.

But that was not it for this developer, he went on and on never learning. Trying to mentor lead nowhere, his stubbornness and deeply ingrained vision was stronger than the will of any lead or manager. Worst challenges were, he fundamentally disagreed on almost all objectives, required features and design decisions, he simply had a different vision and ideals deep down that there is nothing you can do to reason about. He was ultimately unmentorable and unmanageable.

Re:Goodbye, Clean Code by celticmusic on Sunday January 12, 2020 @07:12PM (#22030743)
I specifically state it was a contract and you're talking about a job.

this reminds me of Steve Yegge. He did a post on the difference between employed developers and entrepreneurs, and how they're completely different creatures.

You've allowed yourself to become a pet and you've given up the ability to care about your work for food and you think it's a moral failing in others who have not.

You're to be pitied.

Re:Goodbye, Clean Code by user5994461 on Sunday January 12, 2020 @08:53PM (#22031220)
Same thing. Do you realize that the average tenure in permanent positions is around a year nowadays? It's not longer than the usual contractor.
Re:Goodbye, Clean Code by latchkey on Monday January 13, 2020 @12:45AM (#22032128)
Your responses to this thread still makes me feel like you're the problem. You're just trying to point the finger at someone else, instead of looking inwards.

My supposition is not about caring about the quality of work at all. You totally missed the point. It is about being upset about things and not dealing with it in the right manner.

If this developer is breaking the company, then it is your job (while you were there) to mentor the developer. It isn't about the code at all, it is about the culture of the company to tolerate the behavior that the developer is exhibiting.

What you describe as a problem, is such a general common problem in this industry that as a more senior person, you should have been able to help define better.

Once you have the policy in place, it is much easier to go to the CEO and say... "hey, we've put these policies in place, everyone agreed to them, i've tried to mentor the developer and nothing is working. i don't think this person is beneficial for the business."

Until you do that, it is he/she/they said and the likely non-technical ceo has no understanding of what good/bad code practices are.

I'm also a contractor, been one for ages now. I only take a 'real job' when I'm a founder. I've got perspective on both sides though.

Re:Goodbye, Clean Code by celticmusic on Monday January 13, 2020 @05:01AM (#22033164)
And on the 8th day latchkey created programming. And he saw that it was good. And then the sun started shining, the rainbows came out, and everything was perfect.

In reality I walked away from the work, told the owner in no uncertain terms that he needs to get rid of the other developer and I refused to be responsible for the quality of the work. Fast forward to today, I'll be putting a new system in place later this week to replace the old because the owner finally called me back desperate after 6+ months of this system not working when the initial estimate was for 4 weeks.

See, the great thing about it is that I do good work. I insist on it. I've been doing good work for this guy on and off for 6+ years. I still do good work. This guy knows this. And I guarantee you, the next time I call him up and tell him one of the developers doing work for him isn't worth the time, he'll listen. Because in all the years I've done good work for him, I've only said this to him once, and time showed me to be 100% correct. Because, as it turns out, despite the fact that I don't shit sparkles, I do try to work with people until it's obvious they're not worth the effort.

Did I mention I still don't shit sparkles?

Re:Goodbye, Clean Code by d303 on Sunday January 12, 2020 @08:41AM (#22026218)
In a certain perspective, by quitting this conversation you too „don’t care“ about what latchkey thinks about this topic, though „someone somewhere“ (most likely their employer) definitely cares that they would tolerate the behavior your coworker displayed. You are doing what they propose, just at another perimeter of tolerance.

I don’t think that you „fundamentally disagree“, but that you have different understandings on when the time has come to quit caring. And given the limited amount of things we can care about during our lifetime I find it certainly helpful to reevaluate from time to time what I decide to care about.

I agree that your coworkers behavior is harmful to a team’s productivity and I would seek the conversation to resolve the disagreement in a professional manner. But if there is no path of a resolution, I would escalate the problem, stop caring and get on with my life, because there is nothing more I could’ve done.

Re:Goodbye, Clean Code by celticmusic on Sunday January 12, 2020 @07:09PM (#22030726)
and I'm sure there's an idiot somewhere out there that would agree with you.

meanwhile, the rest of humanity understands why we're ok with being labelled intolerant due to "intolerance of intolerance is itself intolerance".

Re:Goodbye, Clean Code by habitue on Saturday January 11, 2020 @07:23PM (#22023460)
> Changing one developers _working code_ after they’ve invested a significant amount of time

How much time they invested is irrelevant. There are lots of times where someone is wrestling with something for so long they just want to get it done and don't want to look at it anymore. Many times it's trivial for someone fresh to tidy it up

> If removing repetitive code is a requirement then the team needs to be informed that code will be reviewed for repetition

This focus on "requirements" is only really trotted out when someone doesn't like someone changing their code and is looking for a defense. In reality, coding is super subjective, there are dozens of aesthetic judgement calls everyone has to make. Saying something "wasn't a requirement" basically means "fuck off I don't like you touching my code".

There's no way to codify concrete requirements for handling every possible way code can be improved. If devs are throwing requirements at each other, that's a culture problem, not a spec problem

Re:Goodbye, Clean Code by roenxi on Saturday January 11, 2020 @09:09PM (#22023958)
> How much time they invested is irrelevant.

That is a central point to gp's argument though. The amount of time does matter, because it affects the schedule and hence triggers management decisions.

> ... aesthetic judgement calls everyone has to make. Saying something "wasn't a requirement" basically means "fuck off I don't like you touching my code".

If you believe that then you really shouldn't be tidying up other people's code. Why are you making people unhappy over something that you think is an aesthetic judgement call? Let them be happy.

Re:Goodbye, Clean Code by jt2190 on Saturday January 11, 2020 @10:14PM (#22024220)
> There's no way to codify concrete requirements for handling every possible way code can be improved.

If the change can’t be codified, then it calls into question why the change needs to happen at all.

Assuming that there is some improvement that can be justified, then explain it to the team, and have the team start reviewing for it.

By not going through the process of explaining the improvement to the team, it signals that the team can’t be trusted to learn and improve code on their own. Again, if that’s the case, a conversation needs to happen about whether there should be a team at all.

Re:Goodbye, Clean Code by kortilla on Sunday January 12, 2020 @02:45AM (#22025073)
If you don’t trust someone to change your code to make small improvements, it sounds like you have a trust problem, not the other way around.

Working on a software project as a large team is like growing a garden, not building a house. Just because someone planted a hedge doesn’t mean it can’t be improved by pruning it.

Re:Goodbye, Clean Code by blub on Sunday January 12, 2020 @04:22AM (#22025327)
Trust would allow that the code is modified in the first place, but then a code review needs to happen anyway to ensure that at least one more person is aware of the change and as a sanity check that the change makes sense.
Re:Goodbye, Clean Code by habitue on Sunday January 12, 2020 @02:55PM (#22028773)
> If the change can’t be codified, then it calls into question why the change needs to happen at all.

No, there are lots of things that are difficult to codify but are very valuable. If you look at law and policy you'll find plenty of examples. This is akin to saying "If I can't formalize it mathematically, it doesn't exist" which is obviously false

Additionally, there's the category of things which are maybe in principle codifiable as requirements, but are tedious to specify. I would definitely put aesthetic judgements about code in this bucket. It's much simpler if you say something like "and the developers will use their best judgement on how to write clean maintainable code" and be done with it

Re:Goodbye, Clean Code by tragic on Sunday January 12, 2020 @04:30AM (#22025361)
> If removing repetitive code is a requirement then the team needs to be informed that code will be reviewed for repetition, and introduced to various techniques for spotting and removing repetitive code.

Things like this are never requirements, at least in the conventional sense of 'things the stakeholders ask for the software to do'. Nor should they be: it's our job as professionals to know how to do our work. I don't want a PM or sales rep worrying about the Liskov substitution principle (unless I'm working for code climate or something): it's a waste of their time.

Code cleanliness should make future changes easier. Of course, some 'cleaning' expeditions do the opposite, so there should still be code review etc.