Do we have a common naming scheme for Roc app filenames? In the recent camelCase cleanUp PR from @JanCVanB he renamed camelCase apps to snake_case, e.g. roc_loves_zig
. I feel like I've seen more kebab-case for script file names on Roc. I don't think it's good to enforce anything about file naming, but we should probably agree on and document a convention. I'd vote kebab-case given the choice.
Yes, kebab is the convention
That thread is private lol
Okay, then until this discussion leans away from kebab-case, could you update your PR to use kebab-case @JanCVanB
When you get the chance
It seems that thread decided kebab>camel, but I do propose snake for consistency.
You're gonna make me propose we use kebab-case for variables, aren't you?
Well, if you twist my arm...
Anyway
The benefit of camel-case is that I think it's the closest to English-reading of the cases, and it works well for SEO
But I agree that Roc currently has exactly two cases in the language: PascalCase and snake_case
app
s expose snake_case defs, and Module
s expose PascalCase and snake_case defs. Module file naming convention is PascalCase, so it seems app should be snake_case
You make a compelling argument
Can someone give me perms to read that thread? If you'd rather not, that's fine
12e6868b-a67d-4e1e-b1cf-30e9244865c6.png
So I'm definitely onboard with consistency trumping other factors, so we should use snake_case if that's what we use for variables.
A smaller motivation is that in many unrelated ecosystems I see kebab-case for directory names and anything else for file names.
And because of that, you think that having either PascalCase or snake_case for file and folder names would give Roc projects a cleaner file structure?
Also, the argument from @Brendan Hansknecht in that thread is that some filesystems like OSX don't care about casing, which means camelCase can be a footgun. kebab-case or snake_case should work equally well, including in URLs
Sam Mohr said:
either PascalCase or snake_case for file
and foldernames
:point_up:
In general I like kebab-case for folders, but idk what to think about dir naming conventions in Roc - in our Rust platforms we seem to like snake_case dirs. I have no opinion/proposal for dirs right now.
Also, if we want to intentionally have no convention, I'm happy to mix it up like roc_loves_rust.roc
+ roc-loves-zig.roc
I think snake case makes more sense now
previously we only used camelCase in source files, so using snake_case could have been confusing as to what the convention was - whereas kebab-case would be subtraction in source files, so no confusion
but now that we have snake_case in source files, it makes intuitive sense to me to keep that convention for filenames
it's really annoying to me that in Rust some crate names are snake_case and some are kebab-case
let's just never use kebab and have it never be confusing :big_smile:
Another related annoyance with kebab. A lot of systems do kebab for file names or package names, yet as imports they are snake case. It is really annoying. Super minor, but really annoying.
So whatever we do, I think it is nicest to do it in a very clear way.
So I would probably vote PascalCase for all files, folders, and package names (cause that matches modules and imports). Maybe with a special exception for applications.
Last updated: Jul 06 2025 at 12:14 UTC