• 0 Posts
  • 43 Comments
Joined 9 months ago
cake
Cake day: December 23rd, 2023

help-circle



  • Six levels of abstractions, sure, if you have that many, you may want 6 functions. But that contradicts Martin when he’s saying that there should be one line in an if, and everything more should be promoted to its own function. There’s no way a programmer routinely writes code so terse that you get six levels of abstraction in a dozen of lines of code. Otherwise, Martin doesn’t understand what an abstraction is.

    Managing a stack in your head like a computer is very challenging as far as cognitive load is concerned. You don’t want to jump all over the place. Otherwise, when you reach your destination, you end up forgetting what got you here in the first place.

    This form of code fragmentation makes debugging an absolute nightmare, and finding sources of mutation absurdly frustrating. Good tooling can help you track where a variable is used and in which order mutations happen trivially in code in a single function. It’s not as as helpful when it’s spread all over the place. You can infer so much less statically if you follow Martin’s advice.

    I’m not advocating for 1000-lines functions here, mind you. When functions become too big, other challenges arise. What’s necessary is balance, which Martin’s book fails to teach.


  • It’s inspired so many crimes against engineering as a whole that it’s OK to discourage people from reading it. Not only is it pointless, but it’s also actively harmful to the industry as a whole.

    When something is mostly garbage and good advice is so sparse in it, there’s no need to hold onto it. It’s as much of a mixed bag as a turd with a nice ribbon is a mixed bag of prettiness.

    Burn it with napalm.

    … Nah, I don’t actually mean it should be burnt, that was a joke. The book is a nice reminder that, on top of being a bigot, Robert Martin (not my uncle) should not be hired to write any kind of code in any professional capacity.


  • I know it is, and I find it to be a pretty ridiculously complex fix for a self-inflicted wound.

    The disruption it’s caused me outweighs by far any minor inconvenience with the multiplication or micro packages in the NodeJS world. There’s that, and the Python 2 vs 3 shitshow from which the world still hasn’t fully recovered from yet.

    I mean it: Python has no business laughing at Javascript. Get your act together, snek 😜


  • Python has other stupid problems related to pip. As much as stupid micro-dependencies suck in Javascript, they’re not the shitshow managing dependencies in Python is. It’s an inefficiency that never actually caused me noticeable issues in my former webdev life.

    And let’s not talk about C++… People reinvent all sorts of wheels all the time because sharing anything is so annoying.


  • On top of being super bloated, Intellij’s Rider is far from “just working” in my experience. Not only is it super slow to boot, but it also changes asmdefs in my Unity project unprompted, in a way that prevents my project from working (creates cyclic dependencies). The debugger also sometimes doesn’t trigger breakpoints 😵‍💫

    I absolutely despise it, viscerally.










  • Even though I like intermediate variables myself, I’ve been told the same thing when co-authoring code.

    What these anecdotes suggest is that this is subjective, and I think it can be overdone. I don’t think objective general rules can be established from the article, even though I think it’s good advice.

    In my examples, I was overdoing it and causing too many indirections, creating leaky abstractions (leaky because, in my context, the abstraction was not tightly self-contained and understanding the “implementation” of the abstraction was necessary to understand what the line of code that was using it was doing).

    I don’t think it’s a black-and-white matter. Your reviewer might not necessarily have been a moron, or might have lacked the self-awareness to realize they were imposing their own preferences onto you. But there’s a slight chance that you legitimately confused them with your indirections. Hard to say without context.