|
|
|
|
|
by gethly
174 days ago
|
|
Remove all of that noise. Take this: fn fib(n: i32) -> i32 {}
The (n: i32) can be just (n i32), because there is no benefit to adding the colon there.The -> i32 can also be just i32 because, again, the -> serves no purpose in function/method definition syntax. So you end up with simple and clean
fn fib(n i32) i32 {} And semicolons are an ancient relic that has been passed on to new languages for 80 fucking years without any good reason. We have modern lexers/tokenizers and compilers that can handle if you don't put a stupid ; at the end of every single effing line. Just go and count how many of these useless characters are in your codebase and imagine how many keystrokes, compilation errors and wasted time it cost you, whilst providing zero value in return. |
|
Personally, I would like a language that pushes the programmer to write the types as part of a doc comment.
Also think about returning lambda's. Should it look like this?
Of course the IDE could help by showing the typographic arrows and other delineations, but as plaintext this is completely unreadable. You still have to think about stuff like currying. You either delimit the line, or you use significant white space.