top | item 45643174

(no title)

westcoast49 | 4 months ago

I think you're right. I'm on the opposite side of it, but I have a colleague who routinely writes functions that are hundreds of lines long, with 30-40 local variables inside each function. I've come to realize that he does so because his brain allows him to do it. He has a brain that is more detail-oriented than my brain. Where I naturally see a problem as a "tree" of sub-problems with their own details, he naturally sees one large problem with 100 details. He naturally writes code to accommodate his own cognitive style, while I write code to accommodate my own cognitive style.

Moreover, I've come to realize that my colleague is not adverse to using abstractions if they are well established, and if they already exist. But he is (much) less inclined to invent or write new abstractions than I am. As you have concluded, I have also concluded that this is actually a matter of cognitive style, more than it's a symptom of "slop" or "cargo-culting of best practices".

discuss

order

delichon|4 months ago

I had a colleague who wrote long functions like that. Over time I came to think of him as an inconsiderate asshole. Unfortunately he was me a few years earlier. I gradually learned the value of organizing code in short sweet methods. When that style become old code, I and my other colleagues came to like that crusty old coder better. I also thought it was a matter of cognitive style but for me it turned out to be inexperience.