LearnNewsExamplesServices
Frontmatter
number3199
titleINFOREQ: PascalCase in namespaces
authorThorstenSuckow
categoryGeneral
createdAtJun 25, 2022, 5:33 PM
updatedAtJun 29, 2022, 6:15 AM
closedOpen
closedAt
routingDispositionSchemaVersiondiscussion-routing-disposition.v1
routingDispositionundetermined
routingDispositionReasonuntrusted-or-unclassified-root-author
routingDispositionEvidence[]
contentTrust
projected
quarantined1
signals[]

INFOREQ: PascalCase in namespaces

GeneralOpen
ThorstenSuckow
ThorstenSuckowopened on Jun 25, 2022, 5:33 PM
As a follow up to [QUARANTINED_URL: github.com] I wanted to understand the reasoning behind the usage of PascalCase instead of camelCase with namespace parts, since this is something you rarely see nowadays. @tobiu can you shed some light on this?
tobiu
tobiucommented on Jun 25, 2022, 8:39 PM

As mentioned inside Slack, it is mostly PascalCase for namespaces and class names, the rest is lowercase.

examples:

  1. Covid.view.country.Helix
  2. Neo.data.RecordFactory
  3. Neo.main.addon.LocalStorage
  4. Neo.table.Container
  5. RealWorld.view.user.ProfileComponent

Makes sense or would you do it differently?

ThorstenSuckow
ThorstenSuckowcommented on Jun 28, 2022, 4:54 PM

Okay, got it. Some companies like to use abbreviations for their app names (first namespace part) and I'm more used to camelCase all along except for PascalCase for class names. Does it make sense to make first and last part of the fqn PascalCase? I guess this is just personal taste and does not affect functionality though:

import com.domain.namedPackage.MyClass;

vs.

LoginHelloWorld.view.LoginFormContainer

as a valid example for current conventions - although the app name might be chosen badly - leaves me visually confused... 👀

Is the PascalCase for the app-name a SHOULD BE or a MUST BE?

tobiu
tobiucommented on Jun 29, 2022, 6:15 AM

Hi Torsten,

PascalCase for app names is optional. Neo is storing app names inside a json file, since the build programs will make the app folder lowercase => we can figure out, how the internal namespace should be. Of course you could rename the folder, in case you want to use camelCase or whatever.

Inside the framework, I am using lowercase for all folder names, but this is optional as well. From a consistency perspective, we should keep it this way (or create a new concept and change it everywhere). inside the app / workspace scope, you can name folders however you like to.

I definitely agree that our workshop demo app name is not a good choice @davhm. Way too long.

tl-br: should be and NOT must be.