1 person found this helpful
My two cents:
To standardize style, I use JSHint in the SublimeLinter plugin for Sublime Text 2. I found myself unable to settle on whitespace conventions, brace style, etc. without outside help. A lot of people have problems with the JSLint style, but I'm grateful to have some sort of standard to stick to.
As far as more extensive refactoring of old, working code: this strikes me as worse than useless. I do this only as I need to make extensive modifications to the functionality or when I port it to a new version—in other words, when I would need to test it exhaustively anyway.
sorry for the off-topic, but.. absqua.. THANK YOU!!
i'we been looking for a good js editor, and just downloaded Sublime Text... it is awesome!!
I love it but tend to only use it to clean up or refactor code. I religiously lint my files in it as my last step before committing, which helps prevent a lot of meaningless whitespace noise in diffs, amongst other things. I tried to use it as my main editor but got tired of bouncing over to the ESTK for debugging.
FWIW, I keep a script file open in BOTH Sublime and ESTK.
Any time I save in Sublime, the ESTK religiously notifies me the file was changed and would I like to reload it. Switching back and forth for just for debugging doesn't feel onerous to me.
hm.. since ESTK is scriptable (and i'm sure so is Sublime) there must be a easy/nice way of linking them. even nicer would be a sublime plugin for the Indesign DOM/debugging, but... i'll settle for what i can get
I spent some time putting together a prefs file for JSHint in SublimeLinter that includes all the InDesign globals (or did in CS5). Let me know if you want it.
I have no problem with the look and feel of the code as I am a neat freak and extensively comment as I go along. The refactoring is where I need to focus because when the XML and Templates change to a 'standard style of work' so does the functionality of the code. For example, if the descision was to use 1 table instead of a dozen floating textFrames (this would suit most of my products but not all) I would need to code for tables, columns and cells instead of mapping out co-ordinates and sizes of several textFrames in relation to each other etc. I have solutions for both tables and textFrames (coded very differently to each other) but I'm not sure what the 'best practice' is for stepping myself through the descision making process.
As you said, I may be usesless and I would have to test exhaustively as it's basically starting from scratch...
Again, thanks for the help, it gives me more information to base my descision on. I just hope I can sell it!!!
I finally had a breakthrough in this problem. I've made a spreadsheet of all my XML tags and cross referenced, rationalised, removed obsolete tags etc. This really helped me get the whole project into some sort of meaningful format or datamap.
I then came up with a universal XML format with a set tag naming convention, tag order etc (it doesn't matter if a tag is populated or not if I'm not using it for the product I'm making because it will be ignored by InDesign).
Anyway thanks for the help, it's been a interesting and very challenging process to map out what I need to do, but now the ball is rolling (sometimes I just need to talk things through even on a forum) I should be OK.