|
|
|
|
|
by Rusky
4218 days ago
|
|
It's not just fashion or typing speed- syntax affects how readable code is. Common tokens that don't have a lot of meaning intrinsic to the program being written should be smaller or you get mired in bureaucracy when trying to read it. Which of the following is clearer? plus(new vector(5, 3), scale(3, new vector(7, 3)))
new vector(5, 3).plus(new vector(7, 3).scale(3))
<5, 3> + 3 * <7, 3>
|
|
The last one is least readable IMHO. It's like a regexp. It's the most ambiguous and has the most potential for errors also.
It's hard to typo "function" and have a program still compile/run. It's a lot easier to typo "fn" and still have the program compile/run. Smaller tokens mean more potential errors.