3 ms·
Ask HN: Do you prefer your keywords abbreviated?
For example, different languages use different keywords for declaring functions:
1. function name() { ... }
2. func name() { ... }
3. fn name() { ... }
Which of these do you prefer? Is it the same for other keywords, like "var" or "const"?
- elviejo 6y agoSince functions are a fundamental concept in Programming and you are going to use it everywhere you should use the smallest word possible or better yet no word at all. Like Haskell's: add x y = x+y The same declaration applies for constants: my_constant = "Some value" And there are no variables.
- splox 6y agoI think that a good general-purpose language would support both imperative and functional programming, since some things are easier to just do imperatively and some are easier to reason about functionally. It should be the choice of the developer which to choose. Thus variables should exist, and since they also need explicit declaration, they need something like a "var" keyword.