Live data from Hacker News

-2000 Lines of Code (2004)

folklore.org

71–80 of 134 posts

Re: -2000 Lines of Code (2004)

#71
post #52

Earlier quoted context omitted.

Show management a picture of the code. Show them a visualization of all of it with its myriad connections. Tell them you just got rid of 4,000 lines of that crap. Show a visualization that's smaller and connected neatly. Promise to continue attempting this incrementally and safely in between new features. New features that are coded similarly neat. Not sure if it will work but I keep wanting to see someone try it. :)

I've pretty much exactly that, and it did work. Though it was at a company that had a headcount of 15, so in a larger org it might not go down so well.

We've done this as a recap of successes with a few clients, now. It helps that the old stuff was stupid slow and ours has been both understandable and faster.

Re: -2000 Lines of Code (2004)

#74
It's not just old managers that dislike negative lines of code: Static analysis tools dislike them too, under the right bureaucracy.

At a certain huge company that sells seeds, they decided to start having both a base test coverage target, and a specific plugin that demanded that the coverage never went back more than half a percent from the high water mark on any given project. The engineering managers thought it was a good idea: As time goes by, we'd have better code coverage!

I joined a team that had an application full of repetitive code, because nobody had spent much time thinking about reuse. I decided it was bad for maintainability, and the team let me rewrite a big chunk of repetitive, well tested code. I shrunk the codebase by a good 10K LOC, and it still did the same thing. Teammates liked what I had written, and everyone was happy. But when I pushed it, the build refused to deploy, because now the code didn't meet coverage standards.

The manager was mad at me: you wrote all that code, but I guess your unit tests were sloppy! he said. But when I went and looked at the code changes, I had a 100% code coverage. Since I am not a football player, I just couldn't give 110%. So then we look at the reports, slowly, and saw that while I had full code coverage, the code I was replacing also had full code coverage, but mine was so much smaller, our total coverage percentage went down! 1000 lines of uncovered code, in a codebase with 30K lines, gave us better numbers than the same lines in our shinier 20K LOC codebase. And building tests for some really old, badly factored code just wasn't in our top list of priorities.

The people in charge of this system refused to change it, even though it was really not helping things in our case. So what did we do? Fool the tool, of course. Added a bunch of well tested dead code that was never going to get called in production, and wouldn't even get built into the binary, thanks to some packaging magic. We put it in a separate module, clearly marked as 'dead code to make Sonar happier', and we went our merry way.

Re: -2000 Lines of Code (2004)

#75
post #38
post #11

I wish the output from git diff used red for new lines and green for removed lines...

Stock market indicators in China are reversed in colour from the western world (up=red, down=green). Sometimes I wonder if Github really should be flipping the colours on diffs for Chinese language users for the sake of consistency.

Do you know if that is because up is generally "bad" for them, or because red means "good" and green means "bad"?

Re: -2000 Lines of Code (2004)

#76
post #29

I finished up a 24-month project earlier this year on a codebase of ~1M lines in which I dropped a net of almost 100k lines of code and reduced the main Visual Studio solution from 325 projects down to 105 projects. Compile times dropped from ~40 minutes to 6 minutes. If only all my projects could be that fun.

What kind of software takes 1M lines of code and 105 project? Is it one of those Java enterprise software projects?

Re: -2000 Lines of Code (2004)

#77
post #51

I worked somewhere where the support manager somehow managed to get approval to bill his costs against each product group based on the lines of code in their product. We spent part of a week refactoring and reformatting to cut it by 70% before we gave him our numbers.

That's brilliant.

I would love to know how he reacted and what happened next.

Re: -2000 Lines of Code (2004)

#78
post #38

Earlier quoted context omitted.

Stock market indicators in China are reversed in colour from the western world (up=red, down=green). Sometimes I wonder if Github really should be flipping the colours on diffs for Chinese language users for the sake of consistency.

Do you know if that is because up is generally "bad" for them, or because red means "good" and green means "bad"?

Red is considered good and prosperous. Hence the huge amount of red in Chinese culture.

https://en.m.wikipedia.org/wiki/Color_in_Chinese_culture#Red

Re: -2000 Lines of Code (2004)

#79
post #3

I had a job interview once where the HR rep asked me how many lines of code I wrote a week. I responded, "On a really good week -1000, I don't remember the exact figure." She was extremely confused by this answer and wanted me to give her a number. So she said, "I'll just put down 10,000." This is also the interview where they refused to continue unless I told them how much money I made (which I don't do anymore). Th…

It's a well-known tactics to lowball you. The standard answer is "I'm not allowed to disclose it" and if they push, I just give them what I want them to give me minus 5% regardless of what the actual number is.

If they end up calling my current employer and that this employer gives them the number (which is extremely unlikely), I just tell them "What I'm making right now is irrelevant, I gave you the salary I think I'm worth right now. If you don't agree, I'll just walk, no big deal".

Re: -2000 Lines of Code (2004)

#80

Earlier quoted context omitted.

No... there are recruiters who are a lot more invasive and pushy (and a couple employers I've run across). "Proof of previous income" was required at one place I applied years back, and I've heard similar stories from colleagues. No, of course, I don't bother going forward in those situations. "What are you making now?" is crass. The good recruiters I've worked with phrased it as "what are your salary expectations?"…

> recruiters Dude, that right there is the problem. They make a commission off your starting salary, so OF COURSE their primary concern is your past and future financials. This is why I hate recruiters.

I disagree. Recruiters have a conflict of interest that often goes to the candidate's advantage and against their employer's interest. The higher your salary, the higher their commission. And employers are fine with that because a good hire is better than no hire.
Post reply on HN