No Compromises

  • 00:00 The urge to automate everything
  • 01:49 Document before you automate
  • 02:45 Weighing time spent versus time saved
  • 03:30 Automation isn't maintenance-free
  • 04:08 Types of automation
  • 05:18 The exception to the rule
  • 07:05 An example of using a command to update data
  • 08:00 Silly bit

Creators & Guests

Host
Aaron Saray
Host
Joel Clermont

What is No Compromises?

Two seasoned salty programming veterans talk best practices based on years of working with Laravel SaaS teams.

Joel Clermont (00:00):
Welcome to No Compromises, a peek into the mind of two old web devs who have seen some things. This is Joel.

Aaron Saray (00:08):
And this is Aaron.

Joel Clermont (00:22):
Developers often have this urge to automate things. We do something manually one time and our first thought is, "I should script that. I should automate that."

Aaron Saray (00:33):
Yeah, there's a danger in that though. I've seen that happen, and actually I'm guilty of doing that a couple of times too, where you see a task and you go, "Man, this is such an annoying or painful task that I don't want to do it by hand again, that's for sure." so you go and start to write a script or automate it. And, like I said, there's a danger in that, whereas there's a couple different points why we don't want to necessarily reach for that right away.
First, we may never actually do that task again. Are you sure that we want to do that task again, right? Another one might be, it changes. Just because you had to do it this way the first time doesn't necessarily mean next time you're going to do it. And by automating it, you might be kind of putting yourself in a little box that, "I have to do it this certain way now moving forward."

Joel Clermont (01:26):
And I think it is a good impulse to have. But, like you said, to maybe rein it in a little bit, to make sure it's the right time to do it. At the same token, I know you'd agree with me on this, you don't want to just completely one-off something and never know how to do it again. So documenting the process, probably a good first step before automating it. And then you have a path if you need to automate it later, or if somebody other than you needs to do it manually another time.

Aaron Saray (02:00):
I think automation you can almost look at as a form of refactoring. The first run-through is doing it maybe by hand and writing some documentation. And then if you follow documentation again a second time, tweak that. Because I know I've always written documentation a hundred percent correct each time, the initial time. Never a mistake.

Joel Clermont (02:22):
Story checks out.

Aaron Saray (02:25):
But I think that, you know, if you do it two or three times, it's almost like code refactoring. When you're copying and pasting something two or three times, now it's time to see if I can make that easier, better, faster. Any way that you want to do it.

Joel Clermont (02:39):
I see what you did there. I mean, what do you think about the trade-off too between the time it takes to automate something versus how long it takes to do it manually and the frequency with which you do it? Like, if you spent a whole week trying to figure out how to automate some task that takes you five minutes to do, and you do it once a year.

Aaron Saray (03:03):
Once a quarter.

Joel Clermont (03:04):
Right? Yeah. I mean, that's probably part of how you weigh that a little bit too.

Aaron Saray (03:09):
Yeah. Sometimes you just have to be a little bit more disciplined too as a programmer because it's really annoying once a quarter to have to do this task, but it's really not worth it for the business for me to spend a whole week's worth of programming so I don't have to do that again. Sometimes you just have to do it, just suck it up a little.

Joel Clermont (03:27):
Yeah. I mean, the example I gave was kind of exaggerated example. But sometimes it can be a little harder to determine what the right trade-off is, but keeping that in mind. Also, I mean , automation isn't maintenance free either especially if you are automating something with an upstream provider like AWS, or I know your favorite is Azure, that their API changes. So you're going to go automate your task or run that automation again and now it doesn't work, or it works differently than you expect. If you were just clicking a checkbox or doing a manual process, you wouldn't bump into that in the same way.

Aaron Saray (04:08):
Well, it depends on the type of automation too. It can be really easy just to reach for a Bash Script and write something versus going and installing Ansible and doing a whole process.

Joel Clermont (04:20):
Sure.

Aaron Saray (04:20):
But it's more likely that something like Ansible would stay current with the changes or as your Bash script. You're the only one working on that and you're the only one kind of assigning that functionality. But now that brings up a good point too. I've worked with some clients before where I jumped in and I learned what their server structure was and I immediately reached for something, like Ansible or something like that, to start provisioning stuff from scratch or a Dockerfile, anything like that.
So there's a difference between automating tasks and automating infrastructure. I think that's important to understand because you don't necessarily need to set up a new Docker container by hand each time if you understand the automation process. The difference there is in the configuration, not necessarily the process. I think what we're talking about here is more like unique individual processes that don't already have some form of tooling available to them.

Joel Clermont (05:15):
Okay. Yeah, I think that's a good distinction. Yeah, for sure.

Aaron Saray (05:18):
There is kind of one caveat to... You know, all rules are like, "Hey, it's a hundred percent except for this one sort of thing," you know? I think that has to do with data management. I know there's been many, many times when someone said, "If you just tweak this little thing into MySQL database everything is fixed." Or, "If you just add one or two more rows," and I reach for MySQL Workbench or TablePlus or something like that. I'm just like, "Oh man, it's going to be three minutes and I'm done and I can go have a nice weekend." But instead, when we look at stuff like that, we have to remember that we want to have an audit background, we want know why this data changed because it's not great practice to be editing that data by hand.
That's one specific scenario where you might do some sort of automation, whether it's data migration or a onetime console script of some sort in your chosen framework or language, or something that we can version control. Even if we delete it right after, we still have it in the history of our version control, then, what someone did that was out of the norm to modify that data.

Joel Clermont (06:30):
Yeah, that is a good point. I'm that guy who would just be like, "Let's just do it in three minutes." Or, Aaron, I know you love it when somebody fires up Tinker in production because they don't even want to do it in MySQL Workbench, but it's like, "Oh, I have all these relationships and stuff and I can do a one-liner in Tinker."

Aaron Saray (06:51):
Because no one's ever made a typo or made a mistake in production with Tinker, so.

Joel Clermont (06:56):
No, never. Definitely not. Yeah, that's a good point. And sometimes too, if you do something as a one-off and then you need to do it again, well, now you have that script. I mean, just a recent example, we had one of our clients that had to mass cancel events, never a feature they needed before. I could have just gone in there, because they said, "Well, let's cancel the next two weeks." I could have just manually done that but I wrote a command so I could do it from Artisan to do it by day. So now when it extended from two to three, to four, to five and beyond that many weeks, the command was there and could easily run it. And in the future, if it became a feature we could just take that command and make that accessible from UI or refactor that in a different way.

Aaron Saray (07:40):
Yeah, that's a good point. It wasn't even wasted work, it's possible that we might use that in the future.

Joel Clermont (07:46):
Yeah, for sure. All right, well, I'm going to go automate everything now.

Aaron Saray (07:51):
Yeah. Can you go automate the upload process for this podcast? That'd be great.

Joel Clermont (07:57):
All right.

Aaron Saray (08:04):
There are things that they told us as a kid that I really thought was going to be true or really part of our life, that just are false. I wanted to see if you have any of those on top of your mind. For example, things that I did not know until I became an adult. Camel�s humps aren't full of water.

Joel Clermont (08:24):
Mmm.

Aaron Saray (08:24):
I just assumed that if they're in a desert that's where they put their water. That if you eat an apple seed somehow something grows inside of you that's weird.

Joel Clermont (08:34):
You were afraid of that?

Aaron Saray (08:35):
Well, I think it was threatened. Or the gum, if you swallow gum-

Joel Clermont (08:39):
Oh, yeah.

Aaron Saray (08:41):
... it'll be there for seven years. I guess a lot of mine has to do with eating, being a hefty fellow. Or, the one thing that I think probably people have thought about a lot as adults and turns out it's just not something that's a big deal, is the amount of quicksand that's around. I remember being a child and just being very much afraid of quicksand. And I have yet to run into any quicksand in my life so I blame Looney Tunes. What about you? Is there anything from childhood kind of you realize is no longer true?

Joel Clermont (09:13):
I thought the gum thing was true. So I guess there's some that I'm just becoming aware of right now. Yeah, the one about you're not supposed to look at the sun or it'll burn your eyes. Total lie. You can stare at the sun as long as you want.

Aaron Saray (09:30):
I don't think that's true.

Joel Clermont (09:30):
Okay. If you need some sort of legal disclaimer along with this episode. No, nothing is coming to mind for me. My parents would never have lied to me. How dare you even suggest that?

Aaron Saray (09:47):
Yeah. I mean, Santa Claus. I mean, that's kind of weird. You know, someone who's always watching you.

Joel Clermont (09:54):
Aaron.

Aaron Saray (09:55):
It's cool if Santa Claus does it, but if I do it it's a crime, right?

Joel Clermont (09:59):
Yeah, exactly. My parents didn't tell me about Santa Claus, I don't celebrate Christmas.

Aaron Saray (10:03):
Oh, yeah. Okay.

Joel Clermont (10:04):
So I think what's happening here is our family backgrounds are coming out as dirty laundry for everybody but...

Aaron Saray (10:14):
All right. Well, if you know something that maybe was true as a kid to you and it's no longer true, find us on social and let us know.
Do you struggle with knowing what to automate or making sure automation gives you a nice return on your time investment?

Joel Clermont (10:31):
We can help. Get in touch for a free consultation at our website nocompromises.io.