Replies: 1 comment 2 replies
-
I prefer There's some intuition that It's a better short-term vs long-term tradeoff IMO. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I came across these keywords and was wondering why they were chosen.
As I understand, "fn" is for static typing and "def" for dynamic typing.
The problem I am seeing is that neither "fn" nor "def" express these properties explicitly.
The assumption I assume is that people come from another language and might be able to infer, that "def" functions are dynamically typed (as seen in Python) as opposed to "fn" functions.
What is the reason for not choosing static def vs def as a simple example? It explicitly conveys the properties of the functions. With the static keyword it is explicitly conveyed that the function is statically typed, vice versa.
Compatibility with Python is also not broken as the keyword def is kept and"static def" is added to explicitly convey the static typing property of the function as opposed to "fn" at which the reader is left to guess why there's two kinds of keywords to declare functions. From a language design standpoint I can't understand why "fn" has been used.
Beta Was this translation helpful? Give feedback.
All reactions