4 ms·
It is common in term of frequency of new languages using it, perhaps, but not otherwise. And again, the point is that Kotlin brings along extra characters AND
by RedComet 2y ago
It is common in term of frequency of new languages using it, perhaps, but not otherwise.
And again, the point is that Kotlin brings along extra characters AND variation. What's next, `fnctn myFunction(x : Int)~ Int { /* code */ }`?
Why? Just to be quirky? To avoid some hypothetical lawsuit?
- int_19h 2y agoThere are plenty of old languages using it. Pascal/Delphi, Ada etc. That's where the current crop of languages got that syntax from, it's not like it came out of the blue all of a sudden. And I already explained the reasoning. No, it's not to avoid the lawsuit, it's because many people genuinely find it more readable for various reasons. Which is why it keeps showing up in all kinds of languages that are otherwise wildly different syntactically.
- RedComet 2y agoYes, there are older languages using Pascal style declaration, but any of C,C++,Java dwarf it in terms of popularity and general exposure (thus my use of the term "common"). And again, in the latter part I'm talking about Kotlin's use of 'fun' and ':'.