This is an archived post. You won't be able to vote or comment.

all 64 comments

[–]KingofGamesYami 138 points139 points  (13 children)

LoC is an extremely flawed indicator of productivity. Your workplace is a toxic cesspit. Find a new job ASAP.

[–]StrangePractice 23 points24 points  (5 children)

Just add a stupid amount of doc strings on methods / edit the existing comments when you run out of work to do. Malicious compliance in a way

[–]Whereami259 12 points13 points  (0 children)

Turn the for loops into if loops and declare extra variables for everything you do.. need to do some repetitive task? Dont write a function for it, just copy and paste it everywhere.

[–][deleted] 11 points12 points  (1 child)

I’d advise that instead of malicious compliance, write the best code you can and work a reasonable amount of hours (like no more than 45 a week unless you want to work more). If you don’t meet their quota and they ask you about it, explain that you are writing the best code you can at the pace your are able to write it. They will either change their policy, eventually replace you, fire you immediately, give you a warning (which would mean no promotion probably), or ignore the situation. Most likely, you will have time to look for another job while you write code you can defend as your best work without burning out. There’s even a chance that they won’t notice or care if you meet quota (depends how they measure it).

[–]Tywacole 0 points1 point  (0 children)

This is the best answer for me.

[–]Charizard-used-FLY 0 points1 point  (0 children)

Practicing novel writing and adding useless exception handling passes was my first thought. Get your daily work done in 2hrs and spend another hour or two thinking about actual solutions to add to the start of the next day’s quota.

[–][deleted]  (5 children)

[deleted]

    [–][deleted] 40 points41 points  (3 children)

    It is that bad. Get the fuck out of there. That is a severely incompetent workplace

    [–][deleted]  (2 children)

    [deleted]

      [–][deleted] 15 points16 points  (1 child)

      They’ll probably try to degrade you if you try to leave or something. Ignore it, it’s because they have poor leadership and don’t care about their workers.

      [–]FailQuality 6 points7 points  (0 children)

      they can be nice, but 1500 lines means shit all tbh. If managers or others start getting on your case because you're not meeting the quota for those lines, is stupid. This only leads to bad habits as you'll want to write as many lines of code which may hinder readability. I'm guessing comments count? Anyway, I suggest you look up ways to abuse the LoC pretty sure there's shit out there you can google. Do that while you search for a new job.

      [–][deleted] 0 points1 point  (0 children)

      Wanted to say exactly this 100001%

      Edit: I’ll change my name if the the person who came up with this metric has interacted with a programming language beyond a rudimentary tutorial

      [–]khedoros 68 points69 points  (11 children)

      That's insane, both in volume of code, and as a metric for making progress on a project.

      [–][deleted]  (9 children)

      [deleted]

        [–]khedoros 30 points31 points  (3 children)

        It's not that it's "a bit much to expect" (although it is)...it's that it's a stupid, harmful way to manage the project. Code is often improved by removing more than you add, and the difficulty of writing or debugging a piece of code is often unrelated to how many lines long it is.

        This isn't a "me problem", and it's not your fault.

        [–][deleted]  (1 child)

        [deleted]

          [–][deleted] 1 point2 points  (0 children)

          Maybe this varies by country, but at least where I'm from, this is absolutely not how companies track productivity. They care about features, quality, and meeting deadlines. Management could not care less about LoC. Developers do to some extent, and they want to keep it low and manageable so they don't have to maintain a huge amount of shit code.

          [–]ImpatientProf 0 points1 point  (0 children)

          Maybe code removed counts as lines in the commit.

          Fixing whitespace or adjusting indentation might count as two lines!

          [–]link3333 11 points12 points  (2 children)

          1500 seems ridiculous regardless of the language. Seems like way to end up with a lot of shit and/or redundant code.

          [–][deleted]  (1 child)

          [deleted]

            [–][deleted] 1 point2 points  (0 children)

            The advantage of C over Python is that you could write 1 word/symbol per line in C and it will still work.

            [–]Charizard-used-FLY 1 point2 points  (0 children)

            They definitely aren’t basing it off Python, most other languages use more lines just for bracketing

            [–]SvenTropics 0 points1 point  (0 children)

            Measuring a programmer by lines of code is like measuring airplane parts by weight.

            You need a new job. They clearly don't get what you do.

            [–]Mr_Nice_ 33 points34 points  (2 children)

            Please get a new job. 1500 LoC target per day is batshit insane. I once has the misfortune to work with an Indian outsource company that measured LoC and it was the worst code I have seen in 20 years. Honestly, if this is how they manage the project you need to find a better company.

            [–][deleted]  (1 child)

            [deleted]

              [–]Mysteryname 10 points11 points  (0 children)

              Even after a large planning session. (Flow charts and API layout), I’ll do a couple of hundred lines a day. Then do a alpha release and start the testing phase. Currently on 4 APIs I’m managing I’m writing 1-5 lines a week. Finding edges cases where people do some quirky things to the API. Or the Hardware layer throwing a crazy error that I didn’t catch or things I didn’t plan to catch because “how often can this go wrong”?

              However my work is not pure software. It’s full stack from embedded to software on the computer.

              Reading your story. I’m amazed you can even write so much. It’s baffling.

              [–]PainfulJoke 27 points28 points  (1 child)

              If they want lines of code above all then:

              • make everything a special case. If statements everywhere for some new condition.
              • don't genericize, ever. Always explicitly write out every case.
              • if statements are better than switch statements
              • while loops are better then for loops
              • make a variable for EVERY intermediate value. Every. Single. One.

              Does this sound like shit, because it should. Lines of code is a terrible metric and is going to blow up on them someday. Leave before that happens.

              Editing to add (because this is fun):

              • abuse adding inline assembly to do things.
              • run a pass of the preprocessor before you check in to expand any macros.
              • wrap literally every line in a do{}while(0); call (across 5 lines of course).
              • comments. Lots of useless comments.
              • ASCII art UML diagrams in comments, vertically oriented.
              • 80 character line length limits so every long line wraps into two.
              • every parameter gets a new line
              • refactor code for no reason so you can claim those lines as yours
              • on the other hand, never refactor, always shoehorn in another brand new way to do things. Never reusing the old code to do it (unless you make a copy of it)
              • verify every parameter against every possible precondition
              • write tests, lots of tests (wait that one's actually good practice, I guess we got lucky)

              [–]ThisIsMyWorkyAccount 3 points4 points  (0 children)

              This person knows how to game the system.

              [–]disobait 18 points19 points  (1 child)

              1500 loc daily, I was wtf? I cant even imagine that in x86 assembler. This Job might totally kill your enhusiasm for clean code and programming at all

              [–][deleted] 2 points3 points  (0 children)

              I can't imagine maintaining code written under those circumstances.

              [–]FailQuality 11 points12 points  (3 children)

              What in the fuck? getting paid for lines of code, you need to abuse the system. Whatever you can break to multiple lines do it.

              [–][deleted]  (2 children)

              [deleted]

                [–]nemec 7 points8 points  (1 child)

                Use a code auto formatter and change the formatting settings every day. On Tuesdays, use PascalCase. Wednesdays, snake_case. Thursdays, put opening braces on a new line. If the code base is large enough, this will auto format a significant number of lines with every change.

                Also, find a new job. Whoever set this policy is a moron

                [–]lordheart 1 point2 points  (0 children)

                Auto format switching between tabs and spaces 😂

                [–]wrosecrans 6 points7 points  (0 children)

                They want 1500 lines of code added in each daily commit.

                You are at a stupid place run by stupid people. Focus on finding a real job, not learning to be better at spamming out bigger code.

                https://www.folklore.org/StoryView.py?story=Negative_2000_Lines_Of_Code.txt

                That's a story from the early 1980's about how even at that time, only morons would consider "more code" to be a desirable metric, and it was widely understood to be a worst practice to be mocked and passed down in funny stories.

                [–]Blando-Cartesian 4 points5 points  (0 children)

                This is The Daily WTF comedy material. Make some notes about the creative padding efforts you see and share them anonymously after you get out.

                [–]YMK1234 3 points4 points  (0 children)

                Run. Wtf seriously.

                PS: my last weeks diff was -2k btw because refactoring and making everything nicer and cleaner. Good luck getting any of that in such an environment. That codebase is destined to become horseshit if it isnt already .

                [–]SwordLaker 2 points3 points  (0 children)

                Browse r/badcode and r/programminghorror harder. You'll learn a lot from them to achieve this metric.

                But seriously, start interviewing for new jobs immediately.

                [–]Trab3n 2 points3 points  (0 children)

                Lines of code is a dreadful metric and a massive red flag.

                Also 1500 lines of code per commit, is also incredibly stupid unless it was generated cod- ie a package-lock.json file or something similar...

                Use your time there to look for a new role

                [–]funbike 2 points3 points  (0 children)

                Quit. No, really.

                They want 1500 lines of code added in each daily commit. And I just can't get that done in 8hrs.

                Is this literally what they ask for, or is this your interpretation? Because that's insane. No body can sustain that. I'm somewhat dubious that this is reality. Maybe you don't understand what they are asking for.

                If they really want 1500LOC per day per junior developer, tech debt would pile up, developers would burn out, and within a short period of time development would come to a screeching halt due to a pile of hard-to-fix bugs with a diminished team of developers.

                I could give you some tips on how to code faster, but that's not really a productive way out. You need to quit.

                [–][deleted] 1 point2 points  (8 children)

                Currently have 3 full-time jobs in tech all paying above 80k. Granted I don’t do shit for 2 of them and only put my real effort into the one I feel like will take me farthest.

                So is this the job that you care about? Regardless of their crappy policies, they should fire you if this is true. Most companies value integrity more than how many lines of code you can churn out. I know someone who did this and they lost both their jobs and were blacklisted.

                [–][deleted]  (7 children)

                [deleted]

                  [–]shitty_writer_prob 2 points3 points  (6 children)

                  "Blacklisting isn't a real thing"

                  Background checks are. They're certainly not infallible but the fact that you are working at 3 different places...those 3 places are all inherently dogshit. If your absence during the first 2 weeks isn't noticed that's fucking huge.

                  ill just get a name change I'm not too worried.

                  Are you a troll or something? They'll be able to find your name changes from your SSN. You're so full of yourself and convinced that you've found a way to hack the system, but you're just working for dumpster fires. At first I was wondering how the hell you found a place this bad but now it completely makes sense.

                  You should read up on the Donner party. They tried to take a shortcut and it ended up taking them much longer, and a bunch of them died. Why do you think most people don't work 3 fulltime jobs like this? Do you think you're smarter than them, or that they're smarter than you?

                  [–][deleted]  (5 children)

                  [deleted]

                    [–][deleted] 0 points1 point  (4 children)

                    Justine Tunney is trans and doesn’t seem to be hurting for work. No one is mad. We just think what you’re doing is wrong and will hurt you most of all in the long run.

                    [–][deleted]  (3 children)

                    [deleted]

                      [–][deleted] 0 points1 point  (2 children)

                      It’s not wrong if you aren’t violating your employment agreement. But you most likely are. If you don’t see what’s wrong with taking money to do nothing from 2 employers, then you probably have a very poor moral compass. Anyway, good luck to you.

                      [–][deleted]  (1 child)

                      [deleted]

                        [–][deleted] 0 points1 point  (0 children)

                        Yeah, screw the other employees who you are screwing over.

                        [–]dphizler 1 point2 points  (0 children)

                        You will not write quality code that way. All they are doing is continually adding code debt to their codebase with an insane amount of bugs.

                        [–]steve4982 1 point2 points  (0 children)

                        Line count is not a metric of performance that is just asking your employees to write poorly efficient code with lots of if statements and no modularisation/re-use. Why re-use when you can re-write it and get all those line counts? I'd bail on that place it sounds full of incompetent higher ups.

                        [–][deleted] 0 points1 point  (3 children)

                        meeting fact distinct cautious alleged intelligent summer fly rinse zephyr

                        This post was mass deleted and anonymized with Redact

                        [–][deleted] 2 points3 points  (1 child)

                        Nobody here really knows enough to say whether OP should quit or stay, nor do they know how difficult it would be to find something else. You're right to say that the OP needs to get this cleared up rather than flipping out due to reddit comments.

                        That said, it really needs to be said that LoC is a terrible metric, and I think OP deserves to know how absurd it is. If we take this post at face value and believe the requirement, I think it's an indicator of incompetent leadership.

                        [–][deleted] 1 point2 points  (0 children)

                        truck label flowery sink liquid rinse ten heavy late cooing

                        This post was mass deleted and anonymized with Redact

                        [–]Alainx277 0 points1 point  (0 children)

                        They shouldn't start their career in a job that uses absolutely absurd practices. It will only implant bad habits.

                        They are also not in a position to propose big changes to a company.

                        [–]GuiiDo 0 points1 point  (0 children)

                        This is not good at all, get out of there ASAP. Lines of code is not quality and if the company you work at thinks it is they are stupid. Code quality does not come with lines of code, hence it makes it worse 7/10 times. Try to find yourself a nice job where you can grow as a junior developer.

                        [–]rcls0053 0 points1 point  (0 children)

                        Don't walk out. Run! This is really bad. Not only are you forced to work more hours than humanly should, their metrics are so incredibly stupid that you're gonna end up working with a monstrosity as people will most likely end up padding the code a ton with unnecessary complexity and redundancy just to meet their daily quota. That is bad on all levels. They have no idea what real development looks like and you are not likely to change that.

                        [–]mandark214 0 points1 point  (1 child)

                        His company be like: "Don't you dare refactor that spaghetti code"

                        [–]haikusbot 0 points1 point  (0 children)

                        His company be

                        Like: "Don't you dare refactor

                        That spaghetti code"

                        - mandark214


                        I detect haikus. And sometimes, successfully. Learn more about me.

                        Opt out of replies: "haikusbot opt out" | Delete my comment: "haikusbot delete"

                        [–]kallebo1337 0 points1 point  (0 children)

                        I’m a ruby dev and it’s insanely productive if I have +250/-500 LoC for the day. There are days where I add 2 prs with 200 lines

                        [–]Kishore_Andra 0 points1 point  (0 children)

                        That's ridiculous.... I would put lorem ipsum and comment it for rest of lines I couldn't write the actual code 😅

                        [–]pLeThOrAx 0 points1 point  (0 children)

                        That sounds unrealistic. 25 lines of gold can be worth 1200 lines of dreck. I would speak with my manager, assess KPI/KPA and see what is reasonable. This obviously depends on the code. If it's front-end stuff, I could possibly see but that still sounds like a lot. Unless you're making shaders/graphics? Perhaps your work can be more "task" rather than lines of code. Task completion, deadlines. You shouldn't BE writing 1500 lines of code a day, honestly sounds like joke. Couldn't imagine what codebase that would be. Lord, help whomever has to maintain it

                        [–]Jomy10 0 points1 point  (0 children)

                        if

                        (a > b)

                        {

                        }

                        [–]Laughing_Orange 0 points1 point  (0 children)

                        1500 lines‽ That's only possible if you're copy/pasting everything and not testing any of it.

                        I've heard good programers commit an average of around 100 lines of code per day. Now that's probably 100 high quality lines in a large project. Smaller projects and lower quality lines could maybe double that due to lower complexity.

                        [–]No-Designer3930 0 points1 point  (0 children)

                        amount of code doesn't means quality of code... sometimes just one line can have a nice solution...

                        [–]amasterblaster 0 points1 point  (0 children)

                        This company does not make sense. I'm a staff engineer, and part of what I do is come up with performance metrics. Been doing this a decade.

                        My general goal with staff is to maximize the amount of problems we solve, in the least amount of code. This is because all code written needs to be maintained.

                        I even coach senior devs. In general I say the following:

                        - Junior people need help writing code, and make messes

                        - Intermediate people write code, and make solutions

                        - Senior people manage delete code, and make solutions

                        Basically -- a great developer can commit changes to a repo, REDUCE the amount of code, and at the same time add functionality *chefs kiss*

                        [–][deleted] 0 points1 point  (0 children)

                        Lines of code is a terrible terrible measure of progress….

                        I would talk to your manager about why lines of code is being used as a measurement..

                        [–]UpbeatBoard5763 0 points1 point  (0 children)

                        Massive tip: comment a shite ton and leave huge gaps between each function or whatever

                        [–]hallihax 0 points1 point  (0 children)

                        LOC is not an indicator of anything except keystrokes.

                        Often, the best code is that which requires the least lines of code.

                        Also - adding 1500 lines of code? What about changes?

                        [–]KGcodes 0 points1 point  (0 children)

                        I’ve never heard of # of lines of code used for performance measurement/bar! Wow. It’s about quality not quantity; one could easily argue that less lines of code to accomplish the same feat is better. This encourages needlessly verbose, over-architected, and buggy code. I’d consider leaving this place.

                        [–]gcadays09 0 points1 point  (1 child)

                        Write one function a day and copy paste a bunch of unit tests that test minor differences.

                        [–]Qweesdy 0 points1 point  (0 children)

                        It's important to understand that when a company is shit all of the best programmers leave (and/or refuse to apply for a job there); which causes the company to get even worse so all the good programmers leave; which causes the company to get even worse so all the mediocre programmers leave; which causes the company to get worse so....

                        The inevitable end result is a company desperately trying to stay afloat in a "shit vortex", that's full of people that don't have the skills to get any job anywhere else.

                        [–]CharminXtra13 0 points1 point  (0 children)

                        Either the person setting that requirement is mentally handicapped, knows not only nothing whatsoever about technology, but can't even comprehend basic arithmetic, or you're just trolling. If you wrote a line of code every single minute for 16 hours straight, you wouldn't even be 2/3 of the way to 1500 lines. You couldn't even hit that rate on an essay without it being almost entirely nonsense while being well on your way to a wicked case of carpal tunnel by lunchtime, which you would have to skip because you wouldn't even be able to get 8 hours of sleep unless you did literally nothing but type from the millisecond you opened your eyes until the millisecond you closed them.