Top
Best
New

Posted by xeonmc 5 days ago

-2000 Lines of code (2004)(www.folklore.org)
538 points | 245 commentspage 2
mapmeld 5 days ago|
Before a recent annual performance review, I looked over my stats in the company monolith repo and found out I was net-negative on lines of code. That comes mostly from removing auto-generated API code and types (the company had moved to a new API and one of my projects was removing v1) but it was quite funny to think about going to work every day to erase code.
jaydeegee 5 days ago||
In an old ops role we had a metric called ticket touches. One of my workmates had almost double of everyone else but only for that metric. We had a look and it was due to how he wrote notes in tickets instead of putting all his findings in a comment he would do it incrementally as he went along. Neither of these ways were wrong it just inflated that stat for him.
kunley 5 days ago||
"Every line of code not written is a correct one".

One of the early Ruby Koans, IIRC, circulated on comp.lang.ruby around 2002

__turbobrew__ 5 days ago|
Should have said “Every line of Ruby code not written is a correct one”
kunley 5 days ago||
I nominate Java for that particular category
rottc0dd 5 days ago||
Hi,

I think I have mentioned this before in HN too. I am not from CS background and just learnt the trade as I was doing the job, I mean even the normal stuff.

We have a project that tries reify live objects into human readable form. Final representation is so complicated with lot of types and the initial representation is less complicated.

In order to make it readable, if there is any common or similar data nodes, we have to compare and try to combine them i.e. find places that can be made into methods and find the relevant arguments for all the calls (kind of).

Initial implementation did the transformation into the final form first, and then started the comparison. So, the comparison have to deal with all the different combinations of the types we have in final representation now, which made the whole thing so complex and has been maintained by generation of engineers that nobody had clear idea how it was working.

Then, I read about hashmap implementation later (yep, I am that dumb) and it was a revelation. So, we did following things:

1. We created a hash for skeleton that has to remain the same through all the set of comparisons and transformation of the "common nodes", (it can be considered as something similar to methods or arguments) and doing the comparison for nodes with matching skeletal hashes and

2. created a separate layer that does the comparison and creating common nodes on initial primitive form and then doing the transformation as the second layer (so you don't have to deal with all types in final representation) and

3. Don't type. Yes. Data is simplest abstraction and if your logic can made into data or some properties, please do yourself a favor and make them so. We found lot of places, where weird class hierarchies can be converted into data properties.

Basically, it is a dumb multi pass decompiler.

That did not just speed up the process, but resulted in much more readable and understandable abstractions and code. I do not know, if this is widely useful but it helped in one project. There is no silver bullet, but types were actual problem for us and so we solved it this way.

tregoning 4 days ago||
There are still companies asking for # of lines of code written https://x.com/tregoning/status/1286329086176976896
jjice 4 days ago|
This is great actually! It's short-circuit evaluation for me to not waste my time applying.
ivanjermakov 5 days ago||
Just today I commited a +0-2kLOC change, removing two months of my coworker's contribution, because it had to be rewritten. Best feeling ever.
bravesoul2 5 days ago|
Adding that code was not a waste even. You don't have to work every line of code like a mule. Code ...is... thinking.
fathomdeez 5 days ago||
I am net negative in lines of code added to two different companies I've worked for. I wear that proudly.
zkmon 5 days ago||
Great collection of stories! Thanks for sharing. I got carried away across the pages and relished the quotes page.

The ideals probably worked for that time and that place. Many places in other parts of the world and at other times, would have different ideals, to deal with different priorities at that time and place. America in the 80's had no survival struggle, wars, cultural stigmas, pandemics or famines. Literacy and business were blooming. Great minds and workers were lured with great promises. A natural result is accelerated innovation. Plenty of food and materials. Individualism, fun and luxury was the goal for most. The businesses delivered all of it. Personal computing was an exact fit for that business.

Arch-TK 5 days ago||
I am currently working on a piece of code which I am actively trying to simplify and make smaller. It's not a piece of code which has any business ever getting larger or having more features. The design is such that it is feature complete until a whole system redesign is required at which point the code would be itself wholesale replaced. So I am sitting here trying to codegolf the code down in complexity and size. It's not just important to keep it simple, it's also important to keep it small as this bit of code is, as part of this solution, going to be executed using python -c. All the while not taking the piss and making it unreadable (I can use a minifier for that).
Kinrany 4 days ago|
Rewrite it in Rust, haha.
klntsky 5 days ago|
A more realistic end of the story would be that the form refused negative numbers so he had to put 0 and got fired.
eCa 5 days ago||
This being 1982 I’ve never even considered that the form could be anything but paper.
JdeBP 5 days ago||
It being 1982 and a story about the lead developer of LisaGraf, working on that very thing, it is certainly unlikely to be a GUI form.

But block mode terminals that did forms had been a thing for over a decade at that point. Not that this was likely at Apple. But there are definitely contemporary ways in which one could have been entering this stuff via a computer.

Indeed, an IBM 3270 could be told that a field was numeric. This wouldn't have the terminal prevent negative numbers. The host would have to have done that upon ENTER. But the idea of unsigned numbers in form data had been around in (say) COBOL PIC strings since the 1960s.

* https://ibm.com/docs/en/cics-ts/5.6.0?topic=terminals-3270-f...

LeifCarrotson 4 days ago|||
No, this was Bill Atkinson. He's famous enough to have his own Wikipedia page: https://en.wikipedia.org/wiki/Bill_Atkinson

> Bill Atkinson, the author of Quickdraw and the main user interface designer, who was by far the most important Lisa implementer...

> I'm not sure how the managers reacted to that, but I do know that after a couple more weeks, they stopped asking Bill to fill out the form, and he gladly complied.

Notice that it doesn't say "they stopped using the form" but "they stopped asking Bill to fill out the form". The rules are different at the top, they probably still used it to mis-manage junior employees who didn't have as much influence.

mavhc 5 days ago|||
He put in -2000, and it recorded it as 4294965296
meepmorp 4 days ago||
in 1982, I'd expect 63536
djfivyvusn 5 days ago||
Got laid off recently due to basically this.
More comments...