DEV Community

Aleksei Aleinikov
Aleksei Aleinikov

Posted on

๐Ÿง  How to Name Things in Code โ€” 2025 Edition

Bad names cost time. Good names vanish โ€” because they just make sense.
Hereโ€™s what works today:

  • โœ… isVisible, hasAccess, canRetry โ€” clear boolean flags
  • ๐Ÿ” onClick, onClose โ€” event handlers by name
  • ๐Ÿงฉ useToggle โ€” hint that thereโ€™s logic inside
  • ๐Ÿงฎ i, j, x, y, r, g, b, t โ€” short, but always clear in context
  • ๐Ÿงฑ MAX_USERS, DEFAULT_PORT โ€” constants should scream

Naming is the most portable skill in engineering. Use it well.
๐Ÿ“Ž Full write-up โ†’ https://javascript.plainenglish.io/readable-code-in-2025-how-to-name-everything-right-69ebab02e35c

Top comments (0)