4 ms·
OOP is nice to stumble through because what's possible for a given object is spelled out. Your IDE can suggest a list of possible methods and you pick the one t
by Buttons840 4y ago
OOP is nice to stumble through because what's possible for a given object is spelled out. Your IDE can suggest a list of possible methods and you pick the one that sounds good. Whereas in Julia there's an infinite number of potential functions that can operate on the value you have, and I haven't seen a good way to list them.
- ssivark 4y agoFair point. I wonder whether this is a good reason to rethink the UI of autocomplete. 1. Instead of operating sequentially as you type, maybe one could type out the variable(s) one wants to use, select them and then have the ask the language analyzer to suggest functions? 2. Another change (possibly more effective) is to stop thinking in terms of data (and completing with functions) and instead start thinking in terms of functions (and completing with data). Just thinking out loud what might be a different thought process… The language (and types/classes) are not there to constrain you; write down the code/functionality you would like, and then find/construct the types you need to have that code be true :-?
- leephillips 4y agoYour #2 makes much more sense to me than your #1 or the GP’s comment. Suppose my data or variable is a floating-point number. How does it help me to have my editor listing the thousands of functions that can operate on a float? Say what you want to do by writing the verb (function) that does what you want, then give it the arguments that you want it to act upon.
- sundarurfriend 4y ago> rethink the UI of autocomplete ... maybe one could type out the variable(s) one wants to use, select them and then have the ask the language analyzer to suggest functions? This wasn't mentioned in this blog post, but the NEWS.md with a more complete changelog mentions a new feature in the REPL > ?(x, y followed by TAB displays all methods that can be called with arguments x, y, .... (The space at the beginning prevents entering help-mode.) MyModule.?(x, y limits the search to MyModule. There's long been discussion of this kind of redesigned autocomplete UI that's suitable for this paradigm, in the Julia community. I really like this solution that they ultimately went with.