• xJREB@lemmy.world
    link
    fedilink
    arrow-up
    15
    ·
    7 months ago

    As a software engineering researcher, I strongly agree. SE research has studied code comprehension for more than 40 years, but for that amount of time, we know surprisingly little about what makes really high-quality code. We are decent in saying what makes very bad code, though, but beyond extreme cases, it’s hard to come to fairly general statements.

      • xJREB@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        6 months ago

        A few bad things in code for which we have fairly consistent evidence:

        • high nesting depth
        • meaningless or single-letter variable names
        • lots of code duplication
        • very inconsistent formatting
        • very complicated Boolean conditions with AND and OR
        • functions with a lot of parameters