Just wondering how you go about developing your Moi scripts. I find that I must restart Moi each time I make a code change. This really slows down development. Are there any tricks or workflows that will speed things up?

BTW: I use sublime text editor with node.js to provide a javascript IDE. This doesn't work with Moi code though, if I try and build with Moi commands in the script it throws errors.

Hi dan,
Here are some of my amateur "techniques" :-) on Windows 7, and amateur opinions, for everyone's amusement:-)
I have a subdirectory call SCRIPTS, which contain a subdirectory for each project.
My version control is poor.
I use Notepad++ for editing. Hardcopy printouts are shadowy :-(
In Notepad++, there are two windows, left and right, each of which can hold many files. Cut and paste can be done between windows.
Files can be easily swapped between the windows. File save and undo are easy.
Do not use the .html extension. .html does not work. To save as .htm with the .html save offering, add .htm extension to the end of the file name.
Once started with .htm or saved as .htm, just hit the save floppy icon. There is no reversion to .html.
I usually select an existing script which functions well and has compatible code to the new project, copy it to the project directory, and rename it to the
new project name.
There are several "styles" of programming, Michaels excellent styles, and Max's excellent and tough for me to understand code.
Script in the .htm file lacks "debug" help, and may not work for "peculiar reasons", so it is better to script in the .js file, and later move it to .htm script
section for speed, if needed. There are multiple ways to work with Factories and the Geometry Database.

For the directory library, I created a link to MoICommands subdirectory, to assist copying .js and .htm files from the SCRIPTS sub sub directory to the MoI
program commands directory.

It is very important for me to always work with a functioning program, and make small changes, and tweak them until they function properly, or UNDO them.
Making massive changes which do not work makes it difficult to "debug."
Also, set up a "WorkingSoSo" file and save versions which actually partially function, such as draw some rudimentary curve on the screen.
Then, after making a bunch of changes which do not function, the SoSo version can be reverted to.
Temporary Alerts can be inserted to glean what the new program is doing.
It is important to avoid spelling differences, such as capitalized vs uncapitalized variables, so be consistent with names, and use descriptive names, not single character names. I study Michaels scripts intensively, and try to mimic them, and their "styles." They can be "complex..."
Asking Michael for help is another good method, as he is superb and knowledgeable. I try not to ask for help, until exhausting "permutations."

Another method is to use Visual Studio 2015 community edition, free, which can have a project directory and solution (file?).
Hardcopy printouts are nice. As a new user, VS2015 community edition seems to be particularly difficult to figure out.
.js and .html should not be directly loaded, but should be in the project and/or solution files/directories/?, loaded in some unknown and inscrutable fashion.
(I'll have to read the directions sometime:-)

For getting information about what's going on you put in moi.ui.alert( 'text' ); to pop up an alert dialog. If you need to spew out a bunch more information you can instead use moi.log( 'text' ); which will put the text into MoI's text log instead of popping up a dialog, then the whole log can be shown with a shortcut key with script:moi.ui.createDialog( 'ShowLog.htm' );

And that's about it currently... Definitely doing things in an incremental way like Brian describes helps a lot. In the future I would like to work on making it easier to do this with some kind of integrated script debugger where you could set breakpoints and view variable values and things like that, but I won't know how much work is involved until I dig into it some.

@Brian, re:
> Script in the .htm file lacks "debug" help, and may not work for "peculiar reasons", so it
> is better to script in the .js file, and later move it to .htm script section for speed, if needed.

One of the things that I've changed with v4 is that the script from the .js file will now be run directly in the main thread instead of in a separate moi_commandprocessor.exe process, so there won't be any speed penalty for the .js code anymore. The down side of this though is that it will be easier to lock up MoI if the script goes into an infinite loop or something but that will already happen anyway with code run on the .htm side of things.

When I write bad code which causes a lockup when testing a new script in MoI, I press CtrlAltDelete, hit "Start Task Manager,"
to bring up Windows 7 Task Manager, and under Applications, highlight MoI, and hit End Task. This closes MoI, ending the lockup.
(I don't think good code causes such lockups...AFAIK)