We will also need a paste-as-xml command, so that people can paste the xml-version of an outline into an external editor.
Another example: unknownAttributes. In other thread we were seriously discussing possibilities that some user may have some exotic data in uA and what should we do to make this feature most flexible. But where is the evidence that any user would actually use that flexibility? I don't recall that I have ever used uA for any purpose. I can't imagine what would I put in uA and why? As I understand some plugins use this feature. Which plugins? How many of Leo's official plugins do use this feature? What do those plugins put in uA? Do we have ready answers to these questions? Have we ever made a list of this plugins and its uA needs? What if the list had just a few entries and all of them put just strings and numbers in uA? And let me remind you, we had an issue reported when someone used both python 2 and python 3 verisons on the same document that was caused by pickle version protocol. So, some users suffered because we used pickle module for handling uA. It may happen that nobody has ever gained any benefit from such flexibility and yet some of our users had suffered from it. I am not claiming that this is the case. I don't know who uses uA and in what way so I can't be certain about this. But until proven otherwise I doubt this flexibility is required. Given that supporting this feature makes code complex and ugly, I would vote for restricting it. If I am allowed to put a string in uA, then I can encode arbitrary data structure into a string. So I don't think that any user should feel uncomfortable regarding this restriction. Those few who really need some special data to be kept in uA, can encode/decode their own data as they want. But the rest of code should not be further complicated to support some feature that those who need can easy enough achieve even under such restrictions.
I remember the discussion about the book "Made to stick" in this forum several years ago. There is an example described in the book about one project manager who made a wooden block as a model of a handheld PIM device the project was about. Whenever a member of a team had some idea what to add to the device, this manager would take the wooden block in his hand and reply something like: "Great idea, but look there is no space for another button". There is also a rule that most artists honor: "The perfection is achieved not when there is nothing more to be added, but when there is nothing to be removed."
To summarize, I don't think that we should panic. Leo's code has been around for a long time and there is no immediate danger. Leo mostly works as expected. However, if we let FNMW principle to prevail we risk that one day Leo would support so many features that no-one would be able to remember or use just one tenth of them and Leo code complexity would exceed the ability of mightiest human mind to understand. It is already very hard to understand some parts of Leo even with the help of Leo's outlining capabilities.
It may be a good strategy to examine each Leo feature in terms of how often it is used and if the same effect can be achieved through some other features. The questioning should start with those features that introduce most complexity, and give minor value to the Leo. Each feature that complicates much and is used rarely or not at all, should be discarded and code simplified until someone shows up who really needs such feature.
When the code is simple, clean, easy to read and reason about, it is not hard to achieve any missing feature. But when the code is complex it may happen that a feature otherwise achievable, because the complexity of present code base, is labeled as an impossible idea.
Vitalije
Why is it important to allow user to paste outline in another editor?
To make the discussion easier I will name this
[dubious]
design principle "flexibility no matter what" (FNMW).
The same logic should be applied to code design. If you need to achieve some flexibility in a certain part of code, then no effort should be spared to implement it. But if there is no evidence that the flexibility would be used, usually it will make code shorter, cleaner, easier to understand and maintain, and often faster to execute if you forget about that flexibility and make smallest viable product. Keep the energy for more important things.
I can point out to many examples of thisFNMW design principle throughout the Leo code. Many modules, classes, methods and functions are designed as if they were public libraries used by many users for different use cases. But most of those modules are used only by Leo developers and in a very specific way. Those modules could be made much more readable, smaller, more efficient if they were tailored to a more specific task they need to perform and not as a general purpose tool that can be used for many other tasks.
Without any intention to diminish any effort that recently went into making very flexible theme handling code, I still wander whether it was good thing to do. Let me explain a bit. I haven't looked at that code yet, and I have only skimmed through the theme related discussion. So, I may be very wrong about this.
I just can't imagine that lots of users will see or use this flexibility.
Basically qt stylesheets are just plain text files and Leo had already large number of tools for writing text files. Was it really the case that those stylesheets couldn't have been written using only standard Leo features for dealing with external files?
Another example: unknownAttributes. In other thread we were seriously discussing possibilities that some user may have some exotic data in uA and what should we do to make this feature most flexible. But where is the evidence that any user would actually use that flexibility?
I don't recall that I have ever used uA for any purpose.
"The perfection is achieved not when there is nothing more to be added, but when there is nothing to be removed."
we risk that one day Leo would support so many features that no-one would be able to remember or use just one tenth of them and Leo code complexity would exceed the ability of mightiest human mind to understand.
It is already very hard to understand some parts of Leo even with the help of Leo's outlining capabilities.
It may be a good strategy to examine each Leo feature in terms of how often it is used and if the same effect can be achieved through some other features.
Really? What modules, classes, methods and functions trouble you?The actual design principle that I consciously follow all the time is that modules and classes should hide all details about an easily understood idea. In other words, Leo's design is about making modules and classes completely independent from each other. That's what makes Leo stable. To the first approximation, nothing else matters, and certainly not details about kwargs.
Leo is a programming environment. In principle, we don't know how people have already used uA's.
In particular, it must coexist with Leo's configuration code.
We have to support more complicated ways indefinitely.
No way am I going to change uA's without an exceedingly strong reason for doing so.
They are a fundamental part of Leo and they aren't going away.
Some, like @root, are hidden, but they must remain indefinitely because people still use them.
All of Leo's features are the result of specific user requests.
I think uA's are a weak example for your point.
Really? What modules, classes, methods and functions trouble you?
It's not about kwargs, but yes they have made me think and try to describe and define what is it that make things worse than they need to be.
Thanks Vitalije, Edward and Terry for this discussion,
I can go into code details and so, maybe at that level your points are valid. From the user experience, I would say that using trees to setup themes is cumbersome (and preferences and to enable/disable plugins). Maybe there is and important principle there, but exposing Leo potential users to all this complexity (particularly the non-programmers) could result in a lot of incidental complexity. Something with check boxes and scrolling menus and options (like atom and tools alike) could help with settings and plugins use and discovery and may simplify underlying code.
This thread reminds me of the 20K lines of code principle for
human understandability of software systems [1] and the Smalltalk
culture of fighting actively against incidental complexity (see
[3], for example). Of course this is not easy, but any discussion
and action in this line should be visible and supported.
--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.
I would say that using trees to setup themes is cumbersome (and preferences and to enable/disable plugins).
This thread reminds me of
...
the Smalltalk culture of fighting actively against incidental complexity (see [3], for example). Of course this is not easy, but any discussion and action in this line should be visible and supported.
[1] https://news.ycombinator.com/item?id=3291085
[2] http://www.vpri.org/pdf/tr2011004_steps11.pdf
[3] http://cuis-smalltalk.org/