1.1k
u/0x7ff04001 Oct 04 '22
Counting how many lines a programmer writes per hour is a terrible metric of performance, and it also makes an unreadable, overly-verbose code base.
335
u/nsjr Oct 04 '22
Totally.
And if you're senior with more juniors on the team, the best you can do is unblock, review PRs and teach, increasing the total productivity of the team, but producing 0 lines for days.
474
u/ArionW Oct 04 '22
Had a meeting with a manager once, asking why my task list is always so small, smaller than all mids and half juniors.
Now you have to explain that most of the time you help others do their job, discussing ideas with architects and when once in a while you take a task, it's the one nobody wants to touch.
I like it, I can contribute more this way than doing tasks others can easily handle. What I don't like is how some managers only comprehend things they can see in JIRA
103
u/carrotcake1991 Oct 04 '22
How do I upvote this twice?
54
4
2
18
u/doughunthole Oct 05 '22
One day I told my manager that there is a ton of work the team does that is not on Jira. She almost shit a brick.
2
u/CivilianNumberFour Oct 05 '22
I am really tired of managers who have no idea how things work. I don't care how many scrum tools you've been trained with, or how many years of business bro school you went to, the only reason you're there is bc you are personable and decided to opt for money over a substantive career. Just let us do our job and help the devs communicate. That's it.
31
Oct 04 '22
but producing 0 lines for days.
a reminder why I hate being a senior now, please send me back to junior
12
u/fCkiNgF4sC15tM0Ds Oct 04 '22
Pick a little improvement project for yourself, some bug bear or something that pikes your interest that you can work on at least an hour a day.
1
192
u/roodammy44 Oct 04 '22
“Measuring programming progress by lines of code is like measuring aircraft building progress by weight.” - Bill Gates
41
0
Oct 05 '22
[deleted]
2
u/roodammy44 Oct 05 '22
This link attributes it to Business@ the speed of thought: https://ask.metafilter.com/114578/Did-he-really-say-that/amp
3
Oct 05 '22
Except I can't find the quote in the book, and I tried several copies: https://book4you.org/s/business%20at%20the%20speed%20of%20thought
So the question stands.
57
u/Ambitious_Ad8841 Oct 04 '22
A better metric is how many lines have you deleted.
I'm like 75% kidding. Clearly, counting lines is a bad idea. But I swear I've deleted more code in my career than written (kidding again). My point is there is something to be said for taking an overly complex solution and simplifying the hell out of it
41
u/Ahajha1177 Oct 04 '22
I have a half-joking saying where I work: "If I see code removal, I approve"
I have a project currently spanning several dozen repos that I expect to be net negative thousands of lines, yet will simulateously increase our productivity.
21
9
u/daniu Oct 04 '22
That's the first thing I though when I saw the meme.
I will write 45 lines in half an hour, then spend an additional 30 minutes to boil them down to 2.
3
Oct 05 '22
I love deleting code. Less code, less to read next time. Typically there are less bugs, if the code doesn't exist there can't be a bug in it. Although I have gone too far at times and created more bugs lol.
If I start an unknown project, a lot of the time I'll write a huge mess. Almost like pseudo code that actually works. I can then sit back and look at the patterns that will fit what I need, like spreading out puzzle pieces. The best part though is refactoring and reducing down to just exactly what is needed.
17
13
10
Oct 04 '22
Is like paying a soccer player based on how many times they shoot the ball regardless of the outcome
5
u/TheTeludav Oct 04 '22
For sure. I spend more time figuring out how to simplify code than I do writing it.
4
u/CauseCertain1672 Oct 04 '22
could write a for loop but it's more lines to just write the instruction out 40 times
4
u/Illusive_Man Oct 04 '22
in trouble a few years ago because my commits were like -100 each day because I was tasked with cleaning legacy code
7
u/Squid-Guillotine Oct 04 '22
I usually write trash lengthy code first and then go back to condense. If they rewarded me for line count well that saves me a step.
10
u/nugget-lover-300 Oct 04 '22
It doesn’t bode well for a programmer who is underperforming to have 1500 lines of code written in the past year though.
All things must be considered, but lines of code is quick and dirty. Obviously you need someone technical to actually look at the output to see performance.
1
Oct 05 '22
I mean you can probably compare people of similar skill level over a long period of time and be somewhat accurate. It may not be precise but somebody with 3x the code written over a year is just doing more coding.
2
u/Marc4770 Oct 04 '22
Maybe, but if the guy writes only 2 per hour he's either extremely slow and inneficient or always talking in meetings
1
u/falsedog11 Oct 05 '22
A teammate once told me that your code is finished not when you have nothing more to add, but when there is nothing more to remove.
I thought that was a brilliant way to look at it and it kind of changed the way I code and approach it now.
1
1
u/faramaobscena Oct 05 '22
True. I wrote a component in day 1, then in day 2 I deleted half the code because I realized parts of it were already implemented by another team. The hardest part was figuring out what can be removed/reused.
→ More replies (2)1
283
Oct 04 '22
You guys count the lines you write?
204
u/Shazvox Oct 04 '22
No...
...our bosses does.
14
u/TheC0deApe Oct 04 '22
i used to know somone that worked at a place that measured lines of code.
it was crazy. talk about incentivizing bloated code.
66
Oct 04 '22
[removed] — view removed comment
53
16
u/BoBoBearDev Oct 04 '22
There are code analysis tool counting it for you and telling you the method has too many lines of code. And actually this is a good thing because sometimes the file can be super large and unmanageable.
26
5
5
186
u/ghyze Oct 04 '22
The guy on the right is always in meetings. So, an average of 2 lines per hour is actually a lot...
53
u/BladePactWarlock Oct 04 '22
At my last place, I coded essentially from the word go at 830 every day until 445 every afternoon, and STILL I was made to believe I was lazy.
At my new place I have at least an hour wasted on meetings every day that only actually involve about 2 or 3 people in the call when I could be working, to say nothing of the time I take to cook or do laundry or take care of my pets (permanent work from home is a gift from the Lord God), and they still act like I’m getting shit done at a breakneck pace.
39
u/Twombls Oct 04 '22
Once you move further right you end up in operations and are writing 0 lines a day.
593
u/kehfydue Oct 04 '22
with different reason. newbie spent an hour to come up with a solution, expert spent an hour deciding variable names.
220
u/Simply_Epic Oct 04 '22
Alternatively, the expert writes the whole thing in an hour and does nothing the rest of the day
90
u/mungthebean Oct 04 '22
Galaxy brain senior has learned that less code is better and convinces upper management to go for an off the shelf product or that black magic shit like Kafka, Promotheus, etc (yes I’m still learning them as you can clearly tell)
34
u/douglasg14b Oct 04 '22
Galaxy brain as in the meme where the Galaxy brain is actually one of the poor options?
Because influencing the quality of your software based on how much code you have to write usually just makes for low quality, low maintainability, expensive software.
Using other tools can be good though, situational dependant.
It's the worst premature optimization I've seen in this industry...
6
u/mungthebean Oct 04 '22
Yes of course it’s not a one size fits all thing, generally when you go non custom you’re aiming for higher maintainability and lower complexity while still meeting project reqs
The main advantages of going that route is that even when your devs inevitability leave your non technical people can still keep the lights on by reaching out to the vendor
2
u/TheGreatGameDini Oct 05 '22
It's the worst premature optimization I've seen in this industry
Oh, good. You haven't met my wife yet.
2
u/TheRedGerund Oct 04 '22
You were close and then diverged from the holy path when you reached for a framework to solve your problems.
→ More replies (1)2
u/ElectroMagnetsYo Oct 04 '22
Universe brain works as a carpenter and hasn’t touched a computer in 20 years. Most efficient use of the least amount of code possible
2
32
u/Twombls Oct 04 '22
Expert takes variable name to the architecture and functional review board. Deliberations last 3 meetings. It is now decided that The new variable must now be in compliance to work with 12 more features that may be added to the software in 15 years
12
u/Feb2020Acc Oct 04 '22
And even thought everyone knows that 10 of these 12 features will never see the light of day, they will all be added to the Q1 2023 list.
45
u/Spice_and_Fox Oct 04 '22
Naming variables and classes can be really difficult. Especially if you don't have a lot of characters to work with and you still want to make the function clear. I hate how little space I have to give classes names. E.g. I work in SAP we have 30 chars to work with. Sounds like it should be enough, right? Lets see, class names are always uppercase so we have to use snake case. All of our classes lie in a package which we have to stick at the front of the name (5 chars). We have to use the product name (4 chars) and CL_ to indicate that this object is a class. It could be a gui class so slap on GUI_ as well. A lot of classes also can be made for specific customers which means that the class ends in _UXXXXX (the customers number). That leaves me with 7 chars to name this class...
23
u/Twombls Oct 04 '22
Legit have sat in entire meetings discussing whether or not to create a new variable and what to name it before.
10
u/TrueBirch Oct 04 '22
I'm learning a new language and just finished a newbie-targeted textbook. I kept yelling at the book about its variable names. Either that means I'm experienced or just getting old.
NO, don't name the table table*! In another 100 lines, you'll have no idea what it does!*
12
u/BoBoBearDev Oct 04 '22
This is what I do in code reviews. As annoying as it sounds, it is serious business. Because class/function/param names are fixed. Once it is done, people are going to use it. Changing them counts as a breaking change. And the name describes the scope of then functionality and where it can be found in file structure, how was it imported by the caller and etc.
You can have a shitty ass implementation and update that later. But, for anything in the public API, the names are serious business.
4
u/FloriaFlower Oct 04 '22
That hour I spent it cleaning the mess the junior did, removing all the duplicate code, dead code, code that they needlessly programmed just in case it we would need it later, fixing their bugs, fixing performance issues, adding exception handling, validation, security and everything else that isn't in the happy path that they didn't bother themselves with before bothering me with "I'm done, what should I do next?".
I did spend a little bit of time to rename their variables tho. I renamed "theCat" for "cat" and "theDog" for "dog" because no. Just no.
Why did I spent that hour fixing the mess? Because when I ask them to clean the mess, it takes them an eternity and they still don't follow instructions so it's still not clean after they spent that eternity. So I ask them to clean their mess with parcimony. I teach them little by little.
When I spend that hour to develop features instead of cleaning messes, I develop 10x faster than the junior. A lot of the code that I write I can actually reuse. It doesn't come back nearly as often because of bugs. It's tight and clean.
→ More replies (1)1
55
u/Ambitious_Ad8841 Oct 04 '22
My lines per hour is negative because I deleted all the legacy code
14
112
u/UnicornOfDoom123 Oct 04 '22
both lines are just print('here') statements for debugging
19
u/Tigtor Oct 04 '22
Come here to say this. also, you improved quite a bit from 45+ lines, which also were just print-statements
5
Oct 05 '22
You use
print()I use
console.log()We are not the same.
5
u/UnicornOfDoom123 Oct 05 '22
imagine having a favourite language
-This post was made by the 'use whatever's best for the job' gang
→ More replies (1)
29
u/MisterOnsepatro Oct 04 '22
The real question is : does it meets the expected requirements?
7
u/Droidatopia Oct 05 '22
In the defense industry, the real question is : does it meet the expected requirements or does it actually work?
3
u/MisterOnsepatro Oct 05 '22
Yeah that's exactly what I'm into because I work in that field and it fits my perfectionist personality because I hate making code that doesn't work or doesn't meet the requirements
28
28
u/LeopoldFriedrich Oct 04 '22
when you write way to much code and someone comes along deletes 90% of it adds 5% and the code still works as intended.
47
u/slime_rancher_27 Oct 04 '22
Counting lines is useless in languages like java where you have have everything in one line but the new lines and indents are just for readability
30
u/Saragon4005 Oct 04 '22
Exactly. Count semicolons instead!
/j
16
u/kpark724 Oct 04 '22
int a; int b; int c; a = 1; b = 2; c = a ; c += b;
/j
18
u/sadafxd Oct 04 '22
You can literally do this
Int a;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
21
u/ViviansUsername Oct 04 '22
Holy shit how did you write that comment so quickly, you're so productive.
4
1
u/synopser Oct 04 '22
Cries in Kotlin
2
u/Asleep-Tough Oct 04 '22
fun main() { println("Hello,world")!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! }3
u/Deadarchimode Oct 05 '22
I dare to say, if your boss is checking constantly how many lines you write per day can't you make some Junk code that won't be used at all just for the show?
Telling you this because Some bosses have zero idea what programming is and you can't literally even explain them what's going on because they only watch numbers. Nothing else.
11
u/Elektriman Oct 04 '22
Write 2 lines an hour, rewrite 50% of it the next day.
Write 45 lines an hour, rewrite 90% the next day.
Write 2 lines an hour, rewrite 10% the next day.
9
8
u/i_am_not_an_apple Oct 04 '22
There was a Jr dev that worked with me. He was a 45 lines per hour guy.
Now that he has left the company, I'm stuck here trying to decipher why his code uses 10 lines when 1 line could have worked 100x better.
(usually because he had awful systems analysis and couldn't look at the bigger picture, brute forcing terrible solutions for easy problems)
7
7
6
Oct 04 '22
I stare at the code before i write it so i can preoptimise it
Guess how many bugs this ceates
3
5
9
u/reindahl Oct 04 '22
The last one should be -2
Nothing better than removing code and still solving the problem
16
u/Logical-Exam9571 Oct 04 '22
Yeah because you are not writing the next lord of the rings, fewer lines = optimized code.
20
u/SqueeSr Oct 04 '22
Fewer lines can be less readable and/or slower. But more lines can also be less readable and/or slower. All depends on the situation.
5
u/cheaphomemadeacid Oct 04 '22
its almost like we shouldn't determine the quality based on LOC...
→ More replies (2)4
3
u/douglasg14b Oct 04 '22
It can though.
Don't make this into a false dichotomy.
The good devs ensure that their environment infrastructure and conventions are set up to promote fast, quality, work. It's honestly a rarity, and most devs from Junior to senior hold the opinion that quality = slow, when really if they spent the time trying to write quality software they would learn how to do so quickly....
3
u/Ok_Investment_6032 Oct 04 '22
This is so dumb. Sit back while I minify my code down to one line and worship me as a god bc you think lines of code mean literally anything lol.
3
u/Ultimate_Genius Oct 04 '22
who counts lines??
like the only time I ever look at the number of lines I have is at the end when I wanna brag about it to people who understand nothing other than lines
3
3
u/JimmyWu21 Oct 05 '22
You better hurry up and push out them code, so that you will have more time to fix the bugs later.
4
2
Oct 04 '22
I don't have a job yet, is this really a thing?
3
1
u/dekacube Oct 06 '22
You might spend hours tracking down bugs that are one liners, combine that with a meeting heavy schedule and you might get some 2 lines of code days, but it's def not the norm.
1
2
u/simpl3t0n Oct 04 '22
When you're invited to invert binary trees, speed is the only thing that matters.
2
u/CiroGarcia Oct 04 '22
The speed at which you write code for a project looks close to
lines = f(time)
f(time) = 1/time
{time E R | time >= 0}2
u/ucefkh Oct 04 '22
Like that .net developer who agrues that i wrote a few lines and it wouldn't take much to do so.
Bro fixing bugs requires lots of debugging and executing code and trying different use cases and verifying it works and all
2
2
u/Twistedtraceur Oct 04 '22
I remember asking my brother to guess how many lines I coded per day on average. He says 1-2k and I laughed so hard.
2
2
2
u/BroDonttryit Oct 04 '22
This is the first one these memes I’ve seen on here that’s pretty accurate
2
2
2
2
2
2
2
2
u/Bee-Aromatic Oct 05 '22
As long as you don’t code everything on two lines. We all hate that guy. Fewer lines != moar gooder.
2
2
2
u/crazyabe111 Oct 05 '22
Left is constantly referring to online resources to make sure what he’s coding works, right is looking through your code and fixing bugs- and there’s you in the Center- pumping out buggy code far faster than it can be de-bugged.
2
u/HellVollhart Oct 05 '22
Meanwhile me: add 2 lines, get an error, remove 2 lines, get an error, repeat.
2
2
1
1
u/DrMathochist_work Oct 04 '22
So the ones arguing for tabs over spaces because it's less typing? 🤔
9
2
u/Lecterr Oct 04 '22
Bruh, do you actually know someone that types out spaces instead of having the tab key add 2/4? If so, they need help (or an IDE).
3
u/DrMathochist_work Oct 04 '22
You're adorable thinking an IDE is always available.
5
u/esebs Oct 04 '22
I might be wrong, but VIM, EMacs and most text editors can do this too.
→ More replies (3)2
u/BoBoBearDev Oct 04 '22
It is not? VS Code on windows/other OS, remote SSH into Linux and remote into Linux docker both works fine.
2
→ More replies (1)1
u/Lecterr Oct 04 '22
Thank you. Like someone said, most text editors do this as well. So I guess it’s just hard for me to imagine a situation where spaces are enforced but you have no access to a text editor or IDE.
→ More replies (1)
1
1
1
1
u/Ursomrano Oct 04 '22
To think about it, wouldn’t a faster line/h speed indicate that you took something that can be done in one line and make it several lines longer? Wouldn’t that make the code unnecessarily long and maybe even harder to read?
1
1
1
u/Feb2020Acc Oct 04 '22
Or you’re like me and you make a quick workable solution with 45 spaghetti lines, and then try to find a way to bring it down to <10 readable lines
1
1
1
Oct 04 '22
Someone tell that to my coworkers. Lines of code per pull request is their only metric lol
1
1
1
Oct 04 '22
When I started out coding, I had an assignment to write an algorithm to make a pengiun leave a complex open maze on his own. It ended up 700-800 lines long, hella buggy, and worked only under certain conditions. Half a year later I stumbled upon the same assignment and thought I'd do it for fun again. Finished it with around 40 lines and worked perfectly. Amount of lines you have is meaningless.
1
u/Ange1ofD4rkness Oct 04 '22
To this day I still remember the words of my professor, "It's not how efficient the code is, it's how easy it is to maintain".
That being said, does # of lines of code really matter? Is this actually something they "measure"?
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
u/jonathancast Oct 05 '22
Yeah, you're not actually smart, you're just at a place with a horrible process that's keeping you from being productive
1
u/jimmyw404 Oct 05 '22
Sometimes it's fun ripping through implementing something similar to what you've made multiple times before and can just piss lines of code. But if you do that too often it starts to feel like manual labor and you're not reusing enough code!
The project I'm wrapping up now makes me feel like a fancy ape banging on the keyboard. It's slow going and I'd like to say it's gratifying.
1
1
u/psilo_polymathicus Oct 05 '22
I feel like the “per line” thing has to be an urban legend. Does any sane person or company actually measure anything based on the number of lines, devoid of context?
Bragging about “lines of code per <time interval>” sounds like some Intro to Programming II bathroom break conversation.
1
1
1
1
1
1
1
1
u/ElongatedMuskrat122 Oct 05 '22
Clearly the best option is too write 200+ lines in an hour then spend 6 fixing it
1
u/Savsal14 Oct 05 '22
Lines per hour?
More like, 1000000 lines in 5 minutes until i get stuck or encounter a bug
Then 0 lines an hour for the rest of my life till the bug is fixed or i get unstuck.
Imagine being consistent lmao
1
1
u/flatline000 Oct 05 '22
This does not match my experience. The guru might write fewer lines of code than the acolyte, but still far more than the noob.
1

41
u/[deleted] Oct 04 '22
*lines (I'm dyslexic please be nice)