dunbarx wrote: ↑Mon Nov 14, 2022 11:28 pm
Why would, assuming that these snippets are LC snippets, anyone leave LC for such a resource?
Craig.
Υou don't leave LC. That is the point you are missing with Dash.
Whatever you do, you'd need to leave the window you're working on to store the snippet, be it in LC or externally.
If stored in LC, what would be your workflow? You'd need to launch the stack/plugin you created, select the snippet and copy/paste it.
Using Dash, you just need to type in LC's script editor and Dash actually fills in the code for you.
Major improvement.
For example, some time back I create a universal function for sorting single- or multidimensional arrays with the help of many in the forum here. I named it it (imaginatively enough)
sortArray, which returns the array sorted as desired (ok let's not get into the philosophy of sorting associative arrays...). I store this function in Dash and gave it the shortcut name
functionSortArray.
If I just type
functionSortArray in the script editor, Dash automatically puts the entire function into my script editor, without ever leaving LC.
I don't even leave the script editor. No searching, copying, pasting.
Does that make sense now?
Replicating this in LC would be a challenge - and why would you waste time re-inveting the wheel someone else has so beautifully crafted, even if it isn't in LC?
And what is this weird mentality that everything has to be done in LiveCode I keep seeing recently on this forum?
Always use the best tool for the job
The other point you may be missing is that 'snippets' aren't fragments of text - what I'm describing above is storing handlers/functions for re-use.
And I wonder how good your handler would be if managing 150 handlers/functions that each may take up to 500 lines?
Would storing these all in single field and somehow divining the start and end of each function/handler really be practical?
Ideally each 'snippet' should also have some meta data: a description/help text, ideally a name/identifier etc. The point is to store your methods in a way that when you come back to them a year later they can still make sense. At the very least these should be stored as an array or database in my mind...
A lot of this is doable in LC - but entering text into the script editor as you type an identifier for the snippet would not be easy and would likely slow it down even more... Ideally I'd like to see LC build this functionality into the iDE - but Dash works superbly if on a Mac...
S.