top | item 34223620

(no title)

elzr | 3 years ago

Have you checked the interface that Google Sheets came up for custom functions? It's in the menu of every spreadsheet in Data > Named Functions. It's pretty good and encourages not only extensive naming but documentation & examples of the function and each argument. These descriptions are then displayed piece-meal as you edit a formula, just like native documentation.

I also love good names! I hated not being able to have names in formulas and the name part of Named Functions is alone a big quality of live improvement for me.

As to lambdas, perhaps calling them anonymous functions is giving the wrong impression here. What lambdas really are is a simple, native way to create a context with local names. They can be a great boon to clarity through naming!

Spreadsheets have been historically so limited that programmers have resorted to hacky ways to have names/comments. The N function for numerical values is used sometimes for this since N of a string defaults to 0: so N("Name/comment") = 0 and can be added to a formula without changing it.

As to the cultural practice of ultra-short, likely meaningless variable names, like single letters. I do agree it's a "mathy" thing and can quickly descend into maddening opaqueness. The trick though is that sometimes it's very useful to have as compact a symbolic representation as you can manage (such a process of abbreviation gave us algebra!). Naming things is hard, perhaps one of the truly hard things in thinking/programming as the saying goes :)

discuss

order

No comments yet.