Comment by lifthrasiir

5 days ago

The answer is simple: Bellard can recall all 50K lines of context, while most can't. I too happen to have a larger working memory and only later realized that my threshold for files and functions is way higher than most others. The dogma is only required when the file is to be read and written by multiple people.

I have written long methods and will do so again and I wouldn't say it's because I have larger working memory or some other supposedly superior attribute. Some methods are just a long series of steps that you can just write one after another. Reading it from top to bottom is exactly as difficult/confusing/whatever as reading them as separate methods would be (assuming you put short comments in the same places where you would otherwise break it up). I think people just don't want inexperienced programmers to do that because they'll end up with tons of mutable state spanning the whole thing, and it's easier to tell them to break it up into methods than to explain what you mean by mutable state and limited scope.

  • Of course that's a legitimate case of longer files or functions, but I found that I was generally able to follow much larger functions, so comfortable with writing larger-than-average code in general.

    Also I should note that longer code doesn't mean less abstraction; it rather means that abstraction is done without separate functions and files, and ordering and visual cues can (and probably should heavily) be used instead. Apparently this is not enough for most others though, as I have received multiple complaints in spite of such readability efforts.

Tbh I've lived already through at least three different dogmas contradicting each other. Those are sometimes behaving like a fashion

  • I would say that dogmas are normally born out of necessity before they become dogmatic, so it is beneficial to analyze and extract core values out of dogmas instead of entirely ignoring them. In this particular case we can conclude that the threshold should be determined per team, because some team may have a member whose working memory is exceptionally smaller than the average. (Ultimately this shouldn't surprise anyone because the coding convention has to be per team anyway.)

    • I never ignored them and usually followed them. They always have reason but sometimes there appears another reason that longs for a solution contradicting the previous dogma.

      E.g. monolith -> modular monolith -> microservices

I feel like this is an underrated superpower. I don't have it - my digit span[0] is about 3, well below normal, so I've always felt that while I'm pretty smart (and managed to get a scientific PhD at an Ivy, so my brain's doing /something/ right), I've always felt like I'm driving a Ferrari but the windows are all blacked out and I'm looking through a tiny hole.

[0] https://en.wikipedia.org/wiki/Memory_span

tbh working on one file is most often much more ergonomic for me. Depends entirely on the sw architecture of course.