3 ms·
It's been a while since I used either C++ or lisp, but for a function that's only used in the same class, isn't it just the function name, argument names and ty
by 6ren 16y ago
It's been a while since I used either C++ or lisp, but for a function that's only used in the same class, isn't it just the function name, argument names and types, and type of return value? You only need to mess around with header files if it will be used elsewhere.
For lisp, you still need the function name and argument names (don't you? or is it common to access them as a list, with cddr etc?) - so it seems the saving is only in the type of return value and types of parameters. That is extra typing, but it doesn't seem much more - I guess it may make a difference at the margin. But if so, this is just dynamic typing. You still choose argument names and a function name.
Or is it more a cultural, idiomatic thing, of what's customary in a language? Which is the author's point, of Sapir-Whorf. I think of course you'll tend to do what's accepted in a language, what's easiest, what its strengths are. But it's also possible to cross-use idioms. It may be a little awkward, but if it really is right idiom for that specific task, it should help.
Or it might be another kind of cultural factor: that the author's C++ is work code, seen by other people (or more likely to be), and so function and argument names need to be fretted over, for others to understand (and also not criticize) them. I'm just guessing here. Why fret over C++ names, but not lisp names?