News for hackers. Stuff that matters.
Re:If I were to invent a programming language for the 21st c... by wool_gather on Saturday November 17, 2018 @04:03PM (#18477395)
Up to a point, perhaps. Say you have both `if` and `unless` control structures. Two keywords where you could have just one, but they're closely related enough that there's not much burden. But what if their grammar was completely different, like say:

    ifStmt := "if" "(" expression ")" statement ( "else" statement )?
    
    unlessStmt := "{" exprStmt exprStmt* "}" "unless" expression ";"
I doubt this additional syntax would be a positive for the language's user. And the divergence will almost certainly make implementation changes more difficult. If we had instead:

    ifStmt := "if" "(" expression ")" statement ( "else" statement )?
           |  "unless" "(" expression ")" statement
           
This smaller amount of syntax is easily understood, increases expressibility, and `unless` will most likely be implemented as simple sugar, just a negation of the expression in an `if`.

There's definitely some sweet spot in the middle, taking scan-ability and symmetry both into account.

Re:If I were to invent a programming language for the 21st c... by fooker on Saturday November 17, 2018 @09:44PM (#18478611)
Would you same the same thing about loops?

You can get away with just providing a 'while' loop (or maybe just goto and labels).

Most languages end up with a for and maybe a repeat-until syntax for the sake of natural looking constructs.