Live data from Hacker News

-2000 Lines of Code (2004)

folklore.org

111–120 of 134 posts

Re: -2000 Lines of Code (2004)

#111
Imagine being a civil engineer, and your boss says "how much concrete did you use? I'll pay you to use more."

Or an electrical engineer: "How many resistors did you solder? I want them all gone."

Or an aeronautical engineer: "What does the plane weigh? I was expecting a few more tons."

Or a traffic engineer: "Why haven't you put more stop lights in?"

Or a mechanical engineer: "More gears!"

Always hard to get the bean counters to appreciate elegance.

Re: -2000 Lines of Code (2004)

#112
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…

These sound like two very big red flags. You have probably dodged a bullet here.

Re: -2000 Lines of Code (2004)

#113
I work on a large Android app.

I have absolutely no idea of what my average LOC / week is and I would argue that it is a silly metric.

Last week I deleted 30k LOC from the project (~10% of the code base) :

-we used to have both the old & new version of the UI in the codebase so we could switch between the twos in production. Now that the new version is complete, there is no need for that.

-There were many deprecated parts of the app and unused resources, I did a big cleanup of these and I have even more work in that area.

This has resulted in way cleaner code, easier to apprehend for newcomers. The app is also lighter by 2 mo. Probably a very productive week overall.

Re: -2000 Lines of Code (2004)

#114
post #31

One of the most interesting experiences I had very early on in my career was reducing a 12,000 line C program to a roughly 1,000 line version (in C itself) without losing any functionality. No, it had nothing to do with my prowess as a young coder, but solely due to the fact that my predecessor did not know what a function was nor how to use parameters. He had written unrolled versions of the same piece of code, with…

... I remember deleting ~500 C++ files .. they were all classes that differed by a constant, so I just passed in a parameter. Was not popular at all, they liked lots of files.

Re: -2000 Lines of Code (2004)

#115
post #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 wa…

> And building tests for some really old, badly factored code just wasn't in our top list of priorities.

Really? I always thought that it's the old, ugly and brittle code that needs unit tests the most. Especially right before the moment you finally decide to rewrite it.

Re: -2000 Lines of Code (2004)

#117
post #94

Earlier quoted context omitted.

None of what you say has anything to do with someone's current salary. If I'm in a job paying $50,000 in a market where the typical salary is $80,000 and I want $100,000 then asking for the $50,000 number doesn't help anyone. It's just meaningless data that clouds the issue of what you are willing to pay to hire me. I can understand asking a candidate what salary they're looking for. That's useful. It's got nothing t…

How do you know what the typical salary is?

How do you find out anything at all? Talk to other people in the same profession, glassdoor etc.

Re: -2000 Lines of Code (2004)

#118
post #31

One of the most interesting experiences I had very early on in my career was reducing a 12,000 line C program to a roughly 1,000 line version (in C itself) without losing any functionality. No, it had nothing to do with my prowess as a young coder, but solely due to the fact that my predecessor did not know what a function was nor how to use parameters. He had written unrolled versions of the same piece of code, with…

I've had that exact same scenario about 4 years ago with a very large website (you've probably used them) which was put together in a hurry. The site was written in Java and each and every access to the database contained the exact same pre-amble, a bunch of database interaction with the aforementioned change to the where clause and then a cleanup section. Typically 50 to 100 lines. There must have been 100's of these copies in the code. In the end I moved the db open and close stuff to program startup and shutdown and replaced all the rest of it with a single function with a couple of parameters. The code suddenly became maintainable again.

Re: -2000 Lines of Code (2004)

#119
post #18

Earlier quoted context omitted.

Don't be so literal about it. I used to get defensive about that question too, but the truth is they aren't asking you how much you are making, they are asking you to start the salary negotiation so they can get a feel for what it's going to take to hire you and describe you adequately to a hiring manager. It's just an opportunity for you both to ballpark the situation and eject early if there's going to be a wide di…

> equally advantageous to both parties There ain't no such thing. Salary negotiations are pretty close to zero-sum.

Depends on the BATNA; failed negotiations can quite easily be negative-sum if it results in not hiring someone and both parties having to spend effort continuing the search.

Re: -2000 Lines of Code (2004)

#120
post #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?

An EPOS application:

  PS D:\project\> (dir -include *.cs,*.cpp,*.h,*.idl,*.asmx -recurse | select-string .).Count
  1626667
At a previous employer, a piece of chip design software got to 1.25m lines of C++ over the course of a decade.
Post reply on HN