logoalt Hacker News

ngruhntoday at 2:24 AM2 repliesview on HN

> New operators — !, //, %%, =~, |>, .new(), and more Reactive operators — :=, ~=, ~> as language syntax

I my mind, this is such common mistake in language design. For people familiar with the language, adding just-one-more operator is very enticing: it's succinct and avoids naming things. But do that a few times and the language becomes a cryptic mess where everything has a random !,*,#,$,# attached somewhere. Looking at you JavaScript and C++. It can get even worse when operators can be defined in userland like in Haskell. Props to Python for keeping it mostly at bay.


Replies

jampekkatoday at 7:30 AM

I think those are mostly well justified and substantially add to ergonomics. Await and the reactive operations are used very heavily in many codebases, and especially the reactive code is quite verbose with useState et al. .new allows constructor chaining. Python has // too, and it makes many indexing operations a lot easier to read.

One missed opportunity here is using the bitwise operators for more common use cases. They are very rarely used in this high level languages, and are a bit weird C remnant in them.

burkytoday at 3:31 AM

This made me think of Perl.