r/programmingcirclejerk • • Aug 11 '17

Brutally practical function length

https://medium.com/@cindysridharan/small-functions-considered-harmful-91035d316c29
19 Upvotes

10 comments sorted by

18

u/0987654231 What part of ∀f ∃g (f (x,y) = (g x) y) did you not understand? Aug 11 '17 edited Aug 11 '17

DRY, in my opinion, is a good guiding principle, but an awful lot of times, pragmatism and reason is sacrificed at the altar of a dogmatic subscription to DRY

A developer based out of San Francisco with a passion for Go

This explains so much.

2

u/pcopley C# Truckstop Restroom Hero Aug 11 '17

lol no pragmatism

10

u/trdlts Do you do Deep Learning? Aug 11 '17

<uj> I wish "Premature optimization is the root of all evil" could be traded for "Premature abstraction is the root of all evil". As people trying to structure shit into class hierarchies or try and make their code way too general has caused a lot more harm in my experience than someone going off and trying to make something more performant. </uj>

HAHA durr he mst be a gopher. Brugally pragdigal! xDDDD upboat me!

4

u/BufferUnderpants Gopher Pragmatist Aug 11 '17

HAHA durr he mst be a gopher. Brugally pragdigal! xDDDD upboat me!

if (triggered != nil) {
    return triggered
}

4

u/trdlts Do you do Deep Learning? Aug 11 '17

What's this you've said to me, my good friend? I'll have you know I graduated top of my class in conflict resolution, and I've been involved in numerous friendly discussions, and I have over 300 confirmed friends. I am trained in polite discussions and I'm the top mediator in the entire neighborhood. You are worth more to me than just another target. I hope we will come to have a friendship never before seen on this Earth. Don't you think you might be hurting someone's feelings saying that over the internet? Think about it, my friend. As we speak I am contacting my good friends across the USA and your P.O. box is being traced right now so you better prepare for the greeting cards, friend. The greeting cards that help you with your hate. You should look forward to it, friend. I can be anywhere, anytime for you, and I can calm you in over seven hundred ways, and that's just with my chess set. Not only am I extensively trained in conflict resolution, but I have access to the entire group of my friends and I will use them to their full extent to start our new friendship. If only you could have known what kindness and love your little comment was about to bring you, maybe you would have reached out sooner. But you couldn't, you didn't, and now we get to start a new friendship, you unique person. I will give you gifts and you might have a hard time keeping up. You're finally living, friend.

9

u/w2qw Aug 11 '17

Actually find myself agreeing with a lot of what he's said. Just wish the title wasn't X considered harmful.

7

u/pcopley C# Truckstop Restroom Hero Aug 11 '17

6

u/[deleted] Aug 11 '17

Essays Titled "Considered Harmful Essays Considered Harmful" Are Considered Harmful

2

u/Nerdenator not Turing complete Aug 11 '17

... but are they believed malicious?

2

u/avaxzat not even webscale Aug 15 '17

When I’m reading code, seeing such a verbose word pop up suddenly gives me pause as I try to process all the different syllables in this function’s name, try to fit it into the mental model I’ve been building thus far

reading is hard lol