3 ms·
`...` is the standard. Don't make language features that use three-dot-ellipsis as a keyword. Just like don't make a language where "Hello world" is a special
by Pxtl 3y ago
`...` is the standard.
Don't make language features that use three-dot-ellipsis as a keyword. Just like don't make a language where "Hello world" is a special string with special significance, or where variables named foo, bar, baz, quux, or i have special meaning.
I mean, it's nobody's fault but your own if you make a language feature that breaks industry conventions.
- elaus 3y agoBoth Java and JavaScript use the three-dot-ellipsis `...` (spread, varargs), so I'm not sure if it 'breaks industry standards' if Ruby uses them as well.
- Bootvis 3y agoR and its predecessor from 1988, S-Plus, as well.
- Pxtl 3y agoIt's a lot less confusing when it's only appearing in the function's parameter signature where you're declaring parameter names instead of the method body. It's not common to see educational snippets with ellipsis in the function signatures - they're usually in the body somewhere.
- DylanSp 3y agoGo uses it as well.
- happytoexplain 3y agoThree-dots is valuable real estate. I don't begrudge the various languages that use it - their use cases are usually worth it.
- epcoa 3y agoC has used ellipses for variable arguments ca 1985.