News for hackers. Stuff that matters.
Re:Tor in a safer language: Network team update from Amsterdam by kazinator on Friday April 07, 2017 @03:06PM (#14062603)
Even original Vi from AT&T Unix (never mind Vim) better supports outside parentheses:

If the cursor is here

   (foo bar)
           ^
I can cut the whole thing using just d%: combine d)eletion with the % cursor movement (jump to opposite parenthesis). Then you can paste it elsewhere with p.

It's a POSIX-standard feature: see here: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi...

That's just a crap editor for sysadmin tasks I wouldn't use for development.

If the syntax is:

   foo(bar)
          ^
then we jump only over the argument list, not the whole expression.

Another thing is the damned comma disesase in f(x, y) languages. Say we are in Vi:

   (foo abc def ghi)
           ^
We want to swap the last two parameters. Easy: type deep. Done! d)elete to e)nd of word, go to e)nd of word, p)aste.

Now try it with

   foo(abc, def, ghi)
           ^
Annoying!

Imagine if your operating system shell forced you to use commas between command line arguments. Nobody would use such an idiotic thing. Why do we put up with languages that do that?

    $ ls, -l, *.foo  # just kill me now

Move second argument to third position: "parens outside" together with "no commas between arguments" makes it a breeze:

    (foo (a b c) (d e f) (g h i) (j k))
                ^
Instead of deep we just do d%%p. Done.

    (foo (a b c) (g h i) (j k))
                ^ d%

    (foo (a b c) (g h i) (j k))
                       ^ d%%


    (foo (a b c) (g h i) (d e f) (j k))
                               ^ d%%p
Re:Tor in a safer language: Network team update from Amsterdam by JepZ on Friday April 07, 2017 @06:45PM (#14064043)
Thank you very much for your explanation, I see your point.

I think I will still prefer the C style for parenthesis (as I would care more for the LOOK than for the FEEL ;-), but regarding the commas, I agree that skipping them would make the life a easier. I mean besides lisp and bash/shell other languages have done so too (e.g. Smalltalk) and spaces aren't allowed anyway inside parameter names.