Question:

What is pascal case?

Pascal case is a way of writing multi-word names in code without spaces, like UserProfile or HttpRequest, where every word starts with a capital letter. Since programming languages don’t allow spaces in names, conventions like this exist to keep code readable.

It’s named after the Pascal programming language, which popularized the style. Today it’s used across many languages, most commonly for class names and type names. In JavaScript and TypeScript, classes are written in pascal case. In C# and Java, it’s the standard for classes, interfaces, and methods.

Pascal case is closely related to camel case. The difference is that camel case starts with a lowercase letter (userProfile) while pascal case always starts with a capital (UserProfile). You’ll sometimes see pascal case referred to as upper camel case for this reason.

The convention isn’t arbitrary. When you see a capitalized name in most languages, you immediately know you’re dealing with a class or type rather than a variable or function. That visual distinction makes code easier to read at a glance.

You might also like