Clones are really really good for creating task specific views ofcode, by gathering together all the nodes relevant to a particular development task, so you don't have to constantly scroll up and down the outline to get to the relevant pieces.
"Code" could be a manuscript or other non-computer related document that requires editing in multiple places.
Who uses them that way? Well, Edward, certainly, and probably a lot of other people. Clones are fairly safe to work with in this role, although I'm sure there are still ways they can have unexpected side effects.
In this role, you typically only have one occurrence of each clone in a @file, the rest are in the Leo outline itself, but not in places written to external files. This makes them less likely to bite.
What else do people use them for? Template / snippet replacement for recurring elements like headers and footers in websites, blogs, and in code. This seems to be the context that people most often (a) get lyrical about how unique Leo is for providing this great workflow, and (b) run into trouble because of the tricky nature of cross file clones.
I can see why people are attracted to clones for this second category of uses, but I'm really not sure they're the best choice. In code, wanting to repeat things may indicate bad design, you can usually define something somewhere and reference it by name in the manner appropriate to the language you're using. For things like website headers / footers, there are a lot of other ways without the extra load of avoiding cross file clone pit falls. Websites typically use some kind of templating system like http://jinja.pocoo.org/docs/dev/. And you can still leverage Leo to handle things like website headers / footers without clones. A *small* script could run through an outline generating web pages with common header / footer content pulled from Leo nodes.
Finally, for the task specific code view case, I prefer alternatives which may not be *quite* as fluid and seamless as clones (mainly for UI reasons), but have no sharp edges you need to be wary of. The bookmarks, tagging, and backlinks plugins are all options in this case, with the first two being particularly usable.
I'm quite rusty when it comes to programming code and writing scripts (my last actual programming was 20 years ago in Pascal, never learned Python).
I wouldn't even know where to start writing a script to go through an outline and replace all instances of a block of text with an updated version of same.
So for me (at least for now), I will continue to rely on clones until and unless I can find a better alternative. Having said that, I always need to be aware of situations where clones can 'bite' (cross-files and @auto... as I mentioned in another post). Regards,
On Tue, Dec 6, 2016 at 12:47 PM, 'Terry Brown' via leo-editor
<leo-e...@googlegroups.com> wrote:
> (How I feel about clones, YMMV)
>
...
> I can see why people are attracted to clones for this second category of
> .... In code, wanting to
> repeat things may indicate bad design, you can usually define something
> somewhere and reference it by name in the manner appropriate to the language
> you're using....
>
IMHO, only issue case in coding ;-)
'''... repeat things may indicate bad design''' ~ can not agree more
but, this feeling just only base the release stage of project,
in software more than 80% stage is in chaos,
every things be try/testing/adjusting/etc.
so Leo can very happy ctrl. all kinds of chaos code block,
with section/@others/clone/etc. the software big picture, always under
us design.
for me in coding , clone usage:
- in-sync same config/information in difference file/dir/proj.
- in-sync function code block, but not yet extract as function/class/module
- in-sync temporary demo data, not necessary as data file
- ...
for fix `repeat things`, every cloned node just the target will
replace with one function,
but not in beginning, just with project developing, natural/slowly/one
by one replaced.
PS:
lamentable...most project will die,
before all cloned nodes replace with good look function....
Python is way too good a language to ignore. Don't be afraid of it.