Was looking through some code today, and found something that highlights my biggest struggles in programming, it’s compound words and casing. Had identifiers such as…

strikeThroughOffset
whitespaceWidth
lineSpacing
underlineOffset
outlineThickness

I can keep in mind “strike through off set”, but then I struggle to remember, is it strikethrough or strikeThrough? What about Offset or OffSet? Why are offset, underline, and outline, all one word, but strikeThrough isn’t? I think of it as one compound word, many people apparently do, but I guess someone who wrote this code doesn’t.

Or… is this just a me problem? Does anyone else struggle with this sort of thing? Am I missing something or should I “just get good”? My best solution so far is just keep everything always lowercase, personally I find that more readable and memorable, but that’s a lot to ask of literally every other programmer in the world…

  • upstream@beehaw.org
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    I see this a lot with a significant portion of my colleagues, maybe around 30%.

    Personally I don’t feel like it’s a big issue for me, but on the other hand I’ve been working mostly in Python (snake_casing) for the last six years.

    That said I do see people having issues with it even in Python, so it’s not like snake casing cures the issue.

    Always lowercase gets a downvote from me though.