What's the name for hyphen-separated case?

2019-01-04 15:39发布

This is PascalCase: SomeSymbol

This is camelCase: someSymbol

This is snake_case: some_symbol

So my questions is whether there is a widely accepted name for this: some-symbol? It's commonly used in url's.

10条回答
你好瞎i
2楼-- · 2019-01-04 15:58

Here is a more recent discombobulation. Documentation everywhere in angular JS and Pluralsight courses and books on angular, all refer to kebab-case as snake-case, not differentiating between the two.

Its too bad caterpillar-case did not stick because snake_case and caterpillar-case are easily remembered and actually look like what they represent (if you have a good imagination).

查看更多
欢心
3楼-- · 2019-01-04 16:02

There is no standardized name.

Libraries like jquery and lodash refer it as kebab-case. So does Vuejs javascript framework. However, I am not sure whether it's safe to declare that it's referred as kebab-case in javascript world.

查看更多
地球回转人心会变
4楼-- · 2019-01-04 16:04

Worth to mention from abolish:

https://github.com/tpope/vim-abolish/blob/master/doc/abolish.txt#L152

dash-case or kebab-case

查看更多
爷、活的狠高调
5楼-- · 2019-01-04 16:08

I'd simply say that it was hyphenated.

查看更多
戒情不戒烟
6楼-- · 2019-01-04 16:12

It's referred to as kebab-case. See lodash docs.

查看更多
Evening l夕情丶
7楼-- · 2019-01-04 16:14

As the character (-) is referred to as "hyphen" or "dash", it seems more natural to name this "dash-case", or "hyphen-case" (less frequently used).

As mentioned in Wikipedia, "kebab-case" is also used. Apparently (see answer) this is because the character would look like a skewer... It needs some imagination though.
Used in lodash lib for example.

Recently, "dash-case" was used by

查看更多
登录 后发表回答