|
|
|
|
|
by CookWithMe
3985 days ago
|
|
What is so ugly about it? Swift tries to be somewhat close to the usual C-syntax (it's supposed to be the successor of Obj-C, after all). For someone used to C-syntax, I guess the main deviation is that the return type is in the back and that there's a func keyword. As for the operaters, there is the addition of generics (what is wrong about <> ?), -> to describe signature of a function (a very sensible choice IMO) and ? for Optionals (again, fine for me). I don't really see how a statically typed language can substantially improve this, but I'd be happy if someone can proof me wrong :-) |
|
That's the only thing I think could be substantially improved, though. Personally I find the style where you separate the type signature from the function definition easier to read, for example
How about
or even which is already pretty close to the Haskell equivalent Arguably, Haskell syntax could be improved with more built-in syntax though I haven't thought about what this means for parsing the language.