5
jestdotty
109d

readable just means "write it in the way I typically write / understand it in"

which makes it a confusing moving target of whatever the local consensus is... and I don't think these people are self-aware of this fact then just get mad at others for not "getting it" automatically, bah

Comments
  • 3
    I think a lot of unreadable is a fairly stationary target however.
  • 4
    I'm pretty sure the idea behind "readable code" is

    a) adhering to common language patterns and naming schemes

    b) Proper variable and function naming

    c) Avoiding god functions that do everything all the time

    d) comment whatever cannot be easily understood otherwise, mostly useful for optimization magic and parallelism patterns where the flow is no longer easily understandable

    I don't think these are "subjective"... Clearly you can name a function something else than I would, but as long as you name it correctly, and it's short enough so that it's easy to understand, it's going to be readable by me even if your choice of words is difference.

    ditto with language patterns. If everyone is using camelCase, don't randomly write with snake case. My eyes will be searching for specific patterns that are common for the language world wide, don't be *that one person* who likes his way better because that's how he does it in TyPEsCrIPt or something.

    and so on
  • 1
    ai is very good at writing comments and helping you make sense of what the code does
  • 1
    @retoor

    I'm sure your post violates a couple PEP entries. Let's run a linter on it XD.
  • 1
    @retoor I do that too
  • 1
    @retoor That sounds ruff ;P
  • 2
    @Demolishun The quoted blog post contains an example of a class that should not be there because it always returns false. Its confusing name: AlwaysNotAvailableAvailability to me it looks like someone wrote that to avoid the "magic number" trap of simply using false in the first place. A comment could have been more "readable", but then again there are software architects strictly against any kind of comment anywhere because proper naming should make the code self-explanatory in theory.
Add Comment