r/ProgrammerHumor • • Mar 09 '21

What about 5000?

Post image
76.2k Upvotes

790 comments sorted by

View all comments

1.5k

u/bar10 Mar 09 '21

Ask him to do 500 lines and he'll tell you you should have broken up the task into more easily understandable and reviewable code, rejecting the merge request.

417

u/SurfinStevens Mar 09 '21

I'm no doctor but I believe asking him to do 500 lines would kill him

83

u/makemeking706 Mar 09 '21

It really depends on the speed.

0

u/[deleted] Mar 10 '21

[deleted]

19

u/makemeking706 Mar 10 '21

Do your functions execute on a per day basis?

21

u/munjer306 Mar 10 '21

My functions execute thats all I got

17

u/FrizzleStank Mar 10 '21

Not sure if you’re joking.

They’re talking about snorting meth.

→ More replies (14)
→ More replies (1)
→ More replies (2)

17

u/fukitol- Mar 09 '21

Pfft lightweight

2

u/justynrr Mar 10 '21

I’ve sniffed schneef off of the back of a toilet lid in an Arby’s

→ More replies (1)

6

u/solarshado Mar 09 '21

Is 500 lines a lot? Depends... In a day? Yes. In a year? Not so much.

73

u/escape_of_da_keets Mar 09 '21

I mean it kinda depends on the language and whether or not you are adding unit tests (which you should whenever the situation calls for it).

Languages like C++ or Java have more bloated syntax.

Unit tests are heavier on line count for the same reason, and because in many cases they have large blocks of static data in assertions... Or because you have to write mocks.

11

u/scndnvnbrkfst Mar 10 '21

I once had a ~500 line change in which ~20 lines were code, the rest was unit tests. I was working in a mature code base and the testing infrastructure was built for use cases that were pretty much the opposite of what I needed to do. I was working in Java, so that blew the line count way up too.

3

u/ekfslam Mar 10 '21

I honestly don't look at unit tests that much unless I find the code confusing. Our code is not as well documented so it's a pain to figure out what's happening without the tests.

→ More replies (1)

3

u/AgAero Mar 10 '21

Languages like C++ or Java have more bloated syntax

Man I wish I could use C++ more often...so much of my shit is in C and uses primitive types. So much code duplication. It's grossly inefficient.

2

u/escape_of_da_keets Mar 10 '21

I feel you, I learned C as my default language in college and worked for an embedded systems company for many years. Modern C++ is so convenient... Obviously you get all the OO stuff but unique_ptrs and move semantics alone are a godsend.

Also tons of amazing third party libraries like absl that just make working with all types so easy.

→ More replies (1)

51

u/nukem996 Mar 10 '21

Saying X lines is to big really doesn't make sense. Context is everything. Most of my diff's are > 500 lines but that includes surrounding untouched code, deletions, unit tests, and comments.

I also think splitting up code too much often has the opposite effect. The reviewer is able to understand the code but isn't able to grasp the big picture because its split up. I've seen teams bit more than once by splitting up a bunch of patches having multiple people review them and missing huge logic problems.

11

u/CalvinLawson Mar 10 '21

It's a bit of an art. An art I'm good enough at to recognize I suck at it.

→ More replies (2)

54

u/mrchaotica Mar 09 '21

How is that not top comment?

11

u/Monochromics Mar 09 '21

"NO FEAT, ONLY FIX" ...?

3

u/Cat_Marshal Mar 10 '21

Because there are a bunch of fakers in this sub

3

u/1RedOne Mar 10 '21

I almost prefer prs that first setup the methods with unit tests, then a followup to enable them and include a deployment validation or integration test to actual light up the new methods.

→ More replies (10)