Stream: ideas

Topic: kebab-case for variable names


view this post on Zulip Sam Mohr (Jan 31 2025 at 18:56):

We've spent a lot of time talking about the right casing convention for Roc (#ideas > snake_case instead of camelCase), and of the popular naming conventions for variables, we agreed that snake_case is the more readable of the naming conventions compared to camelCase. However, during that discussion there we had a few people mention that they would actually prefer kebab-case if it were a choice. Similar discussions on Reddit between camelCase and snake_case see popularity for kebab-case even without it being offered as an option. Even though we've just sunk a lot of work into the snake_case conversion, I think now is maybe our last opportunity to consider switching to kebab-case before Roc users get annoyed by the shifting sands after experiencing stability later this year.

Pros for kebab-case:

Cons for kebab-case:

I think if we ignore the historical precendence here, kebab-case is the better choice, but I might be overly optimistic that the effect on negation is mitigable with good error messages.

view this post on Zulip Sam Mohr (Jan 31 2025 at 19:11):

Also, even though I listed more pros than cons, I would agree that the two cons are both pretty big deals.

view this post on Zulip Richard Feldman (Jan 31 2025 at 19:30):

seems like it's a big weirdness budget cost and the only benefit would be maybe some people having it as an aesthetic preference? :thinking:

view this post on Zulip Richard Feldman (Jan 31 2025 at 19:31):

holding shift seems like a really minor benefit haha

view this post on Zulip Richard Feldman (Jan 31 2025 at 19:32):

same with reassigning, and it's arguably a drawback because foo-bar_ looks like a mistake :sweat_smile:

view this post on Zulip Sam Mohr (Jan 31 2025 at 20:03):

I think I lean more towards snake_case as well, but I try to be conscious of liking anything that Rust does because I generally like Rust already

view this post on Zulip Sam Mohr (Jan 31 2025 at 20:03):

I mainly just think it's good to make sure we've had this discussion before too late

view this post on Zulip Patrick Wierer (Jan 31 2025 at 20:10):

Not on my computer right now, but the first thing that comes to my mind is, that you cannot select the whole word in one go. E.g.: With snake_case and camelCase I can select the whole thing by double clicking, or using the keyboard with Shift-Option-Left/Right etc.
kebab-case breaks that completely. I am obviously not a vim user, so maybe the experience is different for its users. But for me personally the change to kebab-case would completely go against what has been stored in muscle memory for 15+ years.

And just from a very subjective view, kebab-case looks and feels just wrong to me.

view this post on Zulip Anthony Bullard (Jan 31 2025 at 22:52):

I personally love kebab-case (one of the LISPisms that I loved), probably from years of writing too much CSS. But I think for a PL looking to be mainstream it's not a good idea - even if I think reducing the amount of shift holding / chording needed is actually a very big deal for those that suffer from RSI

view this post on Zulip Brendan Hansknecht (Feb 01 2025 at 02:41):

I'm so used to always programming with a symbols layer that they both are equally easy to type. Some reason I thought kebab case required shifting and snake case did not......lol.

view this post on Zulip Brendan Hansknecht (Feb 01 2025 at 02:42):

Anyway, I think snake is reasonable and kebab doesn't really have any major gains on it.

view this post on Zulip Isaac Van Doren (Feb 01 2025 at 04:01):

I do like kebab case aesthetically and with it being slightly easier to type, but not being able to select full words as easily is a dealbreaker for me. I am frequently annoyed by any text that is kebab case because I can't double click it to select.

view this post on Zulip Brendan Hansknecht (Feb 01 2025 at 04:36):

Kinda funny how some archaic technology decision on word boundaries hurts kebab case so much.

view this post on Zulip Ajai Nelson (Feb 01 2025 at 06:27):

As the person who first mentioned kebab-case in that previous discussion, I personally think it's probably not right for Roc. My example was Pyret, but Pyret is intended as a first programming language for new programmers, and it was explicitly created only for educational purposes. So Pyret doesn't have to worry nearly as much as Roc does about the strangeness budget. I agree with others that the difference between snake_case and kebab-case is very minor.

view this post on Zulip Ajai Nelson (Feb 01 2025 at 06:31):

(It's funny because I haven't been keeping up with Roc development much for over a year, but I happened to look today and saw an idea that I had brought up!)


Last updated: Jun 16 2026 at 16:19 UTC