Poll: Would you rather create small scripts for ea...
# suitescript
s
Poll: Would you rather create small scripts for each functionality or consolidate everything in one large script? Why so?
n
Better for your code to be small scripts/functions that you can call from a main script. This is modular style programming. It is much easier to debug...
s
Thanks for sharing your thoughts @NSObsessed
Would like to hear thoughts from the masters too @creece @erictgrubaugh @mattdahse @igorp @alien4u @darrenhillconsulting
a
Well I'm not a master but I think is not black and white thing: - To Large = Hard to Maintain/Debug. - To Many smalls scripts = Hard to Maintain/Debug. You need to find a balance... there is to many different ways to do it...I do per record type which may not be the best way but it work decently for me...
i
What I usually do is grouping the scrips by abstractions and type. Meaning, I have 1 script per transactions server side, 1 per transactions client side, 1 per entity server, 1 per entity client, 1 per custom records server etc'. The common and shared functions go to modules. Processes that are stand alone, such as scheduled scripts, map/reduce etc' have their own script. Regarding the size of the script, it has importance mainly on the client scripts.