How Clean Scripts Help Teams Work Better
If everyone kept things in the same place, finding them would be easy
While the beef is frying, my back is turned against the stove as I'm busy cutting ginger for the rest of the dish. I reach down to the drawer on my right to get a bowl, but it isn't there. Right, I'm not in my kitchen, I'm in Sharon's. She had graciously offered to host Lunar New Year dinner, but since she wasn't comfortable cooking for a group, I volunteered since it's one of my favourite hobbies.
But, I need a bowl to make the sauce and I don't know where it is. The top cupboards of the stove didn't seem to have any. Neither did the drawers under the sink. I even checked the freezer, you can never be too sure where people keep things, but it wasn't there either. My beef was about to burn and if I don't make the sauce and get this ginger in there soon, this dish is ruined.
Normally, I would have just asked Sharon where she keep the bowls but she was minding her two-year old son, and honestly how hard can it be to find a bowl in a kitchen? But, I gave up and called Sharon from across the hall for help. She rushed over to help me but her son was already punishing me for making his mother leave. Sharon looked through a few cupboards and drawers for the bowls, not caring for how hard she was slamming things shut.
Try as we might this bowl did not want to be found. Luckily, I turned off the stove, and after a lot of slamming and banging, we found the bowls in the far right corner above the fridge. I mean who keeps a bowl there ? Sharon even forgot the bowls were there. Anyways, she ran back to her punishing son and I got back to saving this dish.
Luckily the kitchen didn't burn down and we got to have a nice dinner in the end. It made for a good story too. Sharon explained why even she couldn't find her bowls. It turns out it used to be near the stove but she doesn't cook much so she prefers it near the fridge where it's closer for her daily cereal. But she just came home from a trip and forgot she moved it there.
It's weird, I prefer my bowls close to the sink because I cook a lot and need them there. Sharon doesn't and prefers to have it closer to the fridge. Neither locations are wrong but without understanding Sharon's process, it didn't make sense to me.
Okay, but, why am I telling you all this ?
Well, it's because going through someone else's Grasshopper or Dynamo script is exactly like cooking in someone else's kitchen. The script may work well but if don't understand the person's logic, you're left opening every panel and checking every component hoping to find what you need.
If you can't remember or know your own script, how would others ?
A clean script invites others in
Unlike a kitchen where things are hidden behind cupboards, scripts give you the ability to colour, label and group things. Even if people aren't familiar with your process, organizing your script will help guide people through your process.
Like that night at Sharon's would have been a lot less stressful if there were sticky notes outside each cupboard telling what was inside it.
I still have to search for the bowls but it would have saved me a lot of rummaging. You can actually do this with scripts too. By labelling, colouring and grouping them, you make the different components of your script clear to others.
Now, compare this to the templated version of the script.
When we take time to organize our scripts, we're creating a map that others can follow. It's like breadcrumbs to help people understand your thought process. Scripts are already quite overwhelming, keeping it organized and clean helps reduces that feeling and invites people in.
By organizing, your scripts also becomes self-documenting. Which means you can spend less time explaining your work to others. Like me not needing to bother Sharon when she was busy with her son.
A clean script is a clean mind
The organizing process also helps bring some much needed clarity to our own thinking. It's easy to lose yourself in the details of a script. I could spend countless hours on a script and still wouldn't be able to tell you how it works. Organizing it forces you to step back and evaluate the big picture, to really understand it's running as a whole.
Standardizing scripts
The other benefit to organizing you scripts is that you can start standardizing the look and feel of your scripts. Fields like structural engineering or software development already have these standards in place. It creates a common ground for people.
There's a saying used in commercial kitchens, "mise en place". Which means everything in it's place. It's the concept of ensuring all ingredients are prepared and organized before any cooking begins. The idea is to make components look and feel the same in any script you open.
This could mean :
Defining standard color codes for different types of operations
Establishing conventions for wire management and grouping
Creating templates for common script patterns
Developing naming conventions that clearly indicate component purposes
You can actually find my templates here : Grasshopper Template and Dynamo Template.
This is very similar to coding style guides that most companies have to ensure their code looks consistent regardless of it's function.
These standards aren't about restricting creativity, they're about creating a common language that makes scripts more accessible to everyone. When your team knows that blue groups always handle data input and green groups handle geometry operations, it makes any script they open much easier to understand.
Final thoughts
The time spent organizing scripts, like the time spent organizing a kitchen, is an investment that pays dividends in efficiency and reduced stress. A well-organized script becomes a valuable resource that others can understand, modify, and build upon. It transforms what might otherwise be a personal solution into a collaborative tool.
More importantly, it shows that we aren't here to just solve problems, we need to solve them in ways that others can understand and build upon without our input. Whether we're cooking in someone else's kitchen or working in someone else's script, clear organization makes everything flow more smoothly.