5 ms·
If $AnyProgrammingLanguage was German, unary “not” operator would be postfix. if (something == null nicht) { … }
by ivan_gammel 4y ago
If $AnyProgrammingLanguage was German, unary “not” operator would be postfix.
if (something == null nicht) { … }
- prennert 4y agoI think it would be more beautiful that that: If (something nicht null ==) { } I.e. falls (etwas nicht null ist) { },
- lqet 4y agoWhy? It's obviously the == that should be postfix. "Falls etwas nicht null ist" if something not null ==
- danbruc 4y agoFalls etwas nicht gleich null ist. if something not == null Falls etwas nicht ungleich null ist. if something not != null
- tgv 4y agoWe all know that das Nichts nichtet (nothingness nothings; Heidegger), so it should be falls etwas nichtet
- marcosdumay 4y agoSo, just a stack-based language?
- ivan_gammel 4y agoTo reflect the spirit of negating the meaning in simple sentences, not to follow exact grammatical order (but that’s also cool idea)
- fatih-erikli 4y agoin Turkish too if not something if something degilse
- rbonvall 4y agoThere was a formal proposal to adopt a German syntax for Scala: https://www.scala-lang.org/blog/2017/04/01/announcing-skala.html https://www.scala-lang.org/blog/2017/04/01/announcing-skala....
- gdprrrr 4y ago> Some users may have angst about typing characters such as ü and ß, but Odersky dismisses this idea: “Being completely unable to enter half the syntax on an English keyboard may make coding slower, but that never seemed to hold Scalaz back.” Bravo Martin
- colejohnson66 4y agoThat’s an April Fools joke, not a formal proposal
- rbonvall 4y agoThe "formal proposal" part was my December Fools joke.
- colejohnson66 4y agoAh. My sarcasm detector was broken this morning!
- dkdbejwi383 4y ago``` const foo = await getFooAsync(); ``` vs ``` Konst foo = auf bekommenFooAsynchron() warten; ```
- acomjean 4y agoPerl caught me off guard with this. We apparently had a programmer who liked to write Statement unless x; This did not make left to write code scanning me happy.
- zimpenfish 4y agoI have fractionally more sympathy for the post-conditional `if` - `statement if x;` - because at least then you're not trying to invert things at the end of a sentence. Only fractionally because I hate all post-conditionals with a passion. They're the garden paths[1] of coding. [1] https://en.wikipedia.org/wiki/Garden-path_sentence https://en.wikipedia.org/wiki/Garden-path_sentence
- marcosdumay 4y agoHum... The only thing that changes is that the exception comes on its negated form. It doesn't make code scanning any harder, or interpreting it any more convoluted. Personally, I do hate both of those (including the Python's ternary operator). But there is something with the bashism it shares, of `do_it() or die "trying"` that looks quite nice.
- sn41 4y agoRuby has this. Can be surprising to read code ... "Wait.. What? Oh ok."
- Beltalowda 4y agoI like to do that in Ruby. It just reads so natural: $x = foo() unless $y > 10 As with any language feature, you can over-use it, but in general once I was used to it I missed it in every other programming language.