3 ms·
I have irrational anger towards := assignment operator, probably because of Pascal course in high school. Interesting if anyone else have such stories regardin
by ivanjermakov 3y ago
I have irrational anger towards := assignment operator, probably because of Pascal course in high school.
Interesting if anyone else have such stories regarding language syntax and features.
- deleted 3y ago[deleted]
- topikk 3y agoI also have this irrational anger, but as a result of PL/SQL. It's also an objectively hideous operator that is inconvenient to type.
- _lvbh 3y agoComing from Go, I got used to :=. I would’ve preferred if it defaulted to const though
- cutemonster 3y agoComing from Pascal, I like := :-)
- CooCooCaCha 3y agoIt bugs me too. Mainly because I don't see anything wrong with "=", plus it's shorter and more intuitive.
- brendanfh 3y agoThe example in the blog post could have been written a little bit better, but in Onyx ":=" is actually a combination of two operations: defining a new variable with ':', and assigning the value with '='. If the type can be inferred on the right hand-side of the assignment, you can leave out the type between the ':' and the '=' and it effectively becomes a single operator. An alternative way to write that could have been 'input: str = "111 110 121 120";'. To assign in Onyx, you only have to use '='.
- xigoi 3y agoAs a mathematician, I see everything wrong with using “=” for something other than equality. Especially when writing something like x = x + 1.
- cgh 3y agoIn Go, when you export function names they are capitalised. Eg MyFunc() would be exported and myFunc() is not. This always looks so jarring to me and I’ve avoided Go largely because of it, which must rank as one of the more snowflake reasons to avoid a programming language.
- mst 3y agoFor brave service in the forces of self-awareness, I hereby award you https://trout.me.uk/medal.jpg https://trout.me.uk/medal.jpg May you wear it with pride.
- ivanjermakov 3y agoYes, I hate it. And in general, capitalized function names break mental model of inferring token kind by its name. In my world, capitalized token is always a type, lowercase is a variable (or property, function, etc). Popular counter-argument is that it can be fixed with syntax highlighting, but for me it's a flaw in the language syntax.
- solarkraft 3y agoI have an irrational (?) hate for having to declare variables at all because it constantly hassles me while testing and copying/modifying code.