Hacker News new | ask | show | jobs
by simias 1949 days ago
Yeah to be clear it's not the functionality that bothers me, it's just the syntax. Ideally since it's not even a proper variable since it changes after reading it should probably look like a function call.

These ultra terse shorthands make some sense in the shell because it's meant for interactive, write-only commands but a scripting language should be a little more verbose and consistent IMO.

2 comments

I'm a huge fan of preserving knowledge and building on it. Most people, at the time at least, knew what

while (buf = <>)

did. So I didn't want to invent a new syntax, there is way too much of that going on, I like C, I like perl, pull the useful stuff from each and move on.

I freely admit it's not how everyone would do it.

There’s a balance because people really seem to like ? as null coalescing, => for lambdas =~ for regex match, etc..

I think <> as a fancy readline and _ as a default/throwaway variable does really improve readability and lowers the mental load of understanding programs.