Hacker News new | past | comments | ask | show | jobs | submit login

That example syntax has so many potential footguns though.

I’m not someone that subscribes to the notion that saving keystrokes increases productivity (eg function key words being “fn”). I only think it’s worthwhile removing tokens if they add to the cognitive overhead. In the case of trailing semicolons and commas, it’s something you need to remember to add. So why not make it optional?

However using whitespace as a delimiter and having expressions require zero spaces between tokens is adding to a developer’s cognitive overhead. As well as inviting hard to find bugs.




In the case of non-trailing commas it's exactly the same - something you need to remember to add. And remember to (re)move when you move arguments around, that's also buggy cognitive overhead.

Expressions don't require zero spaces, use (), this was just an illustration that there is no need for a comma.


> In the case of non-trailing commas it's exactly the same - something you need to remember to add. And remember to (re)move when you move arguments around, that's also buggy cognitive overhead.

That’s exactly why I’m advocating that trailing commas should be optional ;)

> Expressions don't require zero spaces, use (), this was just an illustration that there is no need for a comma.

You’re example specifically stated using zero spaces for expressions though. So that’s what I’m replying to.

I have no issues with parentheses being used to denote an expression. In fact that largely mirrors how my own language works.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: