Hacker News new | ask | show | jobs
by ssousa666 753 days ago
my favorite thing about camelCase is that class instances are (typically) named and cased as the inverse of their pascal-cased class.

val somethingRepository = SomethingRepository()

Is much more visually satisfying and balanced to me than:

something_repository = SomethingRepository()

1 comments

I like the latter much more. I can come up with rationalizations, like my eyes having to travel to the beginning of the long identifiers if I want to tell instance and class apart in the first example but not in the second.

But honestly it’s most likely because I was socialized on Python. Feeling lucky personally that Rust follows the same convention.