Sitemap
1 min readAug 10, 2025

--

Why JavaScript Sometimes Drives Me Crazy!

Consistency is supposed to make code easier to read, right?
But JavaScript doesn’t always play by its own rules.

We’re told:

✅ Variables & functions: camelCase
✅ Objects: camelCase
✅ Classes & constructors: PascalCase
✅ Constants: UPPER_SNAKE_CASE or camelCase
✅ React components: PascalCase (even though they’re functions!)

Get Yousef Fatouraee’s stories in your inbox

Join Medium for free to get updates from this writer.

Let’s face just some of the reality:

⁉️ Primitive values: true, false, null, undefined are examples of primitive values, but on the other hand we have Infinity, which starts with an I, not i.
⁉️ Built-in objects: Why is Math or Number or etc. (with an uppercase M or N) a global object, but window and globalThis, or document are lowercase? Not to mention that Number() is also a constructor function!
⁉️ Promise, Date, Map, Set: Are all constructor-style, PascalCase. But JSON, Reflect, and Intl? Still global but don’t behave like constructors.
⁉️ Acronyms: getURL() or getUrl()? The community leans toward getUrl, but you’ll find both in the wild.

It’s like JavaScript grew organically, borrowing naming ideas as it evolved, and forgot or didn’t want to clean up the mess. And yes, we have to memorize and deal with it.

And yet, I can’t help but love JavaScript! 😁

--

--