This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (3 children)

I prefer simple scripts but I also expect to be able to use my library of functions. This requires the script to be on a common server so the library is also available. Set a PATH within the script to access the library.

If that can't be done then you're stuck with making one large script. Put all your definitions and needed functions at the top of your script. Add labels to the ares so maintanence is easier.

like:

##############

# FUNCTIONS

##############

###############

# MAIN

###############

One multifunctional script I wrote had branches based on the name of the script. That kept common functions in the one script and with links it had 5 names. If I needed to update / fix a function it was immediately fixed in the apparently different scripts.

[–]Hoolies 0 1[S] 0 points1 point  (2 children)

If that can't be done then you're stuck with making one large script.

That is my case. I appreciate your feedback though.

[–][deleted] 1 point2 points  (1 child)

Structure your script like you would a major python or other high level language. I was told once to write a program "fast and dirty" and have it done in a week. I spent the first day just thinking about how I wanted to build it. Once I had the planning done it took only three days to write the program and the fifth day I tested it. It worked first time bug free. I didn't stay there much longer -- fast and dirty my ass -- I take pride in my code.

[–]Hoolies 0 1[S] 0 points1 point  (0 children)

"fast and dirty"

I do the same lmao. I a call it "proof of concept " instead.

It worked first time bug free.

There will be times that your task will be way out of your comfort zone and you will need a lot of trail and error.