HACKER Q&A
📣 edmqkk

What Are Your Programming Pet Peeves?


I think my biggest programming pet peeve is people shooting down my long variable names. I don't make all my variable names long. IMO, I make them all long enough, and I hate when people tell me to shorten them, as those names are often some of the things I've thought the hardest about in my PR.

Consider these two names:

    car_to_base_new_car_from

    base_car
What's the difference? Do they have the exact same connotation to you?

I would agree that they're pretty much the same, but I think they have slightly different connotations. `car_to_base_new_car_from` to me hints that a new car could be based on any other car whereas `base_car`, although it could mean that, doesn't necessarily nudge me in that direction (Maybe it's a mostly empty skeleton car that is used in all situations--who knows).

Note: I also think that in certain situations `k`, `v`, and `i` are perfectly acceptable names (obviously depending on your team and language community).

This is all very situation specific, and, although it kills me sometimes, I typically don't push back too much on this type of feedback.


  👤 drost Accepted Answer ✓
Dependency Injection frameworks. It's not very difficult to manually build your composition root and a composition root makes the codebase easier to understand and navigate, especially for new people.

Letting `null` into the program. I really hate having to consider whether some value can be null


👤 joshxyz
That.

users_get_users could be users__get_users.

Also not using linters and being trigger happy about adding third-party libraries in the package.json.


👤 higgins
Huge pull requests in poorly structured commits with little context in the PR description.