zed icon indicating copy to clipboard operation
zed copied to clipboard

Named function parameters

Open philrz opened this issue 2 years ago • 0 comments

Currently functions in Zed must all be called with positional arguments. A community user recently made a compelling argument that adding support for named arguments would make the Zed language easier for users to learn/remember.

Details

At the time this issue is being opened, Zed it at commit b7d3b41.

In a recent chat, community user @zmajeed pointed out how the Zed language is effectively a DSL, and that DSLs by their nature are used less frequently than other languages. This means users are more likely to forget small details, so they'll always need to have a window open looking at the docs to constantly be reminded of things like the relative position of function arguments. Therefore being able to specify named arguments will should make it easier for users to call functions without looking at docs. It also has the potential to make Zed code more self-documenting.

There's plenty of articles online that discuss the tradeoffs in this topic as relates to other languages, e.g., this one about Python.

philrz avatar Dec 19 '23 03:12 philrz