Tag: software development

  • Make It Routine

    The first one is hard. The rest are boring.

    I hear this statement from someone recently, and it sounds like something a technical person would do with a task. It’s often been a goal of mine, or maybe a direction to aim, that I want to make things easier with some script or automation. Sometimes I think it’s more aspirational than actual. I might want to make most things routine and automated, but that doesn’t always work out.

    The first time I tackle something, it should be hard. It’s new work. It’s a new process/code/thought/action/etc. It’s unfamiliar and I spend more time on it than I want. After that, I’d hope I could repeat the thing again in much less time. That’s the goal, and that’s what we aim for in a lot of DevOps work. Make the things we think are hard, less hard. Make them boring by codifying things, using automation, have the computer replicate the things.

    I think the second time I tackle a task is often hard as well. How often have you tried to reproduce something you did and can’t quite get it? Heck, I now depend (and use) SQL History constantly because I will write some code, change it a bunch, and then realize that I can’t reproduce the version that did the thing (or broke the thing) I was working on. I need to rewind things and figure them out again. Usually by the 4th time I’ve done something, it’s starting to become easier. By the 10th its boring.

    Unless I’m playing guitar, in which case, some things take a few more reps than 10.

    I’ve had plenty of developers say never repeat yourself. If you can automate it, you should. In practice, that’s hard. Sometimes I’m unsure of whether I’ll do something again, or often enough to spend the time automating it. There are also times I’m not sure it’s worth the effort. I spent a day once trying to automate a bunch of Outlook appointments, only to realize the whole Office API and deluge of information out there made this much harder than the 15 minutes a year I spend putting in all my Database Weekly reminders.

    I don’t want to discourage you from automating things and making them routine or boring. My database deployments ought to be routine. The daily checks should be so boring and automated that I don’t bother with them because I know the machine is doing the work and will let me know if there is something I should examine. The efforts to refresh dev dbs, or respond to audit requests, or even reset a password ought to be boring and easy. Some of us build ways to smooth these tasks and ease our jobs, and some of us treat every one as an ad hoc thing that we do over and over.

    The over and over stuff is going to be taken over by AI. Maybe soon, maybe in a few years, but a lot of simple stuff that you keep doing, that mindless, tedious stuff that doesn’t require a lot of thought, is going to be handled by AI agents. Either you’ll direct them, or your boss will ask someone else to do it after you leave. AI can handle things like figuring out disks are full and cleaning out old log files, shrinking disks, archiving things, and then writing scripts (and scheduling them) to prevent issues. If that’s your job, your days are numbered.

    Make things routine by thinking about the pattern, how we could reduce or eliminate a lot of labor, and how we can use a computer to handle them. Even better, learn how to guide an AI to do that work and prove your worth to your employer.

    Steve Jones

    Listen to the podcast at Libsyn, Spotify, or iTunes.

    Note, podcasts are only available for a limited time online.

  • Day of Data Baton Rouge Slides and Code

    Thanks to everyone for attending my talk today at Day of data Baton Rouge 2026 (formerly SQL Saturday Baton Rouge).

    The slides are here: Building an API with DAB – Baton Rouge

    The repo for the code and demos is here: DAB-Experiments

    Use the Getting Started folder for the setup and demos as batch files. This is for SQL Server with a user set as JoeUser. Change this in the .env file if you want to alter this. I use Northwind, with a few additions in the .sql files.

    Apologies, it’s not completely organized as I am still working on the flow and structure. feel free to reach out with questions.

  • Using AI for Git Hooks

    Recently I had someone internally ask about whether SQL Source Control supports Git Hooks. Since it was after UK work hours, I decided to run a quick test. One problem, I haven’t setup a Git hook in a few years.

    Could AI help me? See what I did.

    This is part of a series of experiments with AI systems.

    Asking for Help

    Claude is my go-to AI. I don’t have a good reason why I don’t lean on Copilot or ChatGPT or anything else, but I’ve become more comfortable with how Claude works and responds to me. When I have something that doesn’t have any PII or other sensitive requests, I tend to start with the free Claude site.

    Here was my prompt: what is an example of a git precommit hook

    Simple, easy, no punctuation or big setup. I just needed something. I got some code:

    2026-01_0150

    and an explanation. Here’s the’s the text of the explanation (italics from me):

    This hook:

    1. Prevents commits with console.log statements

    2. Catches trailing whitespace

    3. Runs your linter

    To set it up, save this as .git/hooks/pre-commit and make it executable with chmod +x .git/hooks/pre-commit.

    If the hook exits with a non-zero status (like exit 1), the commit is aborted. You can bypass hooks temporarily with git commit --no-verify if needed.

    Many teams use tools like Husky to manage hooks in a project, making them easier to share across the team since .git/hooks isn’t version-controlled by default.

    This shows some bash, which I don’t think runs natively in Windows. That makes sense as a lot of coders are likely using Linux/MacOS for complex stuff and the default training for Claude likely assumes that. I asked about Windows and got two options: Node.js and Husky. Since I don’t like to install things, I went with Node. Here’s the next question I asked.

    2026-01_0151

    I didn’t want to lint or worry about whitespace, since I’m depending on SQL Source Control to create the files, so I asked a different question: can you create a pre-commit hook using node (for Windows) that checks for a commit message between 1 and 50 characters?

    The response is good. I didn’t want this, and reading this, I realize Claude is right. I wasn’t quite thinking through the process here. I also didn’t want the code for a commit-msg hook, so I ignored the code.

    2026-01_0152

    I could see that I was getting generic hooks, mostly for other code, so I rephrased a prompt: I want a sample pre-commit hook for .sql files to test something, what is a good example

    The response was a practical hook for SQL files. The code had a couple of messages printing our errors when I failed things, and the code here isn’t important, but here was the explanation. The bottom of the code is shown, and then the list of things that are checked.

    2026-01_0153

    At the top there is a comment about the hook, and since I’d done this a few years ago, I thought I know what to do, but I asked. I mean, why not ask the AI for more help? I liked that it noted not only do I need to add this to my .git folder, but I need to track this if I want to share it. That’s important. I do want other team member, or in this case, me on another machine, to have this hook.

    2026-01_0154

    Testing the Hook

    I then went to SQL Source Control and made a change. In this case, I added a file that I knew would fail the check. Here’s my code:

    ALTER PROCEDURE dbo.GetAllCustomers
    AS
    SELECT * FROM dbo.customer

    I could see this code change in the SQL Source Control GUI, but no error. I thought this might be staged, and I somewhat assumed the hook would fire on staging, so I asked.

    My new prompt: when does this hook fire?

    The response let me know that I had to commit this to get the hook to fire. It runs on the commit command, as before the commit succeeds. That’s good to know. Thanks, Claude, for helping me learn something.

    2026-01_0157

    In checking from the CLI, I realized that SQL Source Control at this point hasn’t staged the file. It also hasn’t written the file, so there’s nothing to stage. One of the downsides (one fo the few) of SQL Source Control is very limited git configuration. The write, stage, and commit happen at once.

    I tested this and sure enough, I got a failure when I tried to commit. The hook fired and saw my SELECT *, and my lack of a semi-colon.

    2026-01_0146

    I tested this further by fixing these elements individually, and I could correct the SELECT *, but I couldn’t fix the semi-colon. I realized with testing that when SQL Source Control writes the file, it always includes a “GO” at the end. So my hook doesn’t work.

    Asking for Modification

    I decided to see if Claude would fix this, as I wasn’t sure what to change myself. I’m not a Node nor RegEx person, and I’d be googling a bunch to figure this out (or find someone else’s code). Instead I tried this: can you adjust this hook to ignore the missing semi-colon if the file ends with a GO, or check for a semi-colon before the GO

    The response was interesting. The explanation said this:

    Now it handles both cases:

    • File ends with GO: Checks that the line before GO has a semicolon

    • File doesn’t end with GO: Checks that the last line has a semicolon

    The relevant code is here:

    2026-01_0158

    I can read this and it makes some sense, but I would have struggled a bit to get this done in a reasonable time. Instead, it was seconds for Claude to produce this.

    When I re-tested, this passed the SQL Source Control GUI and I had a working git hook looking for a couple of simple silly mistakes I might code.

    Summary

    This is an area that I have a little experience, but not a lot. I’m a junior dev when it comes to Git, and Claude is definitely more skilled. However, I have to know what to ask to get a result and I thought the answers and explanations were good in helping me setup this test in a few minutes rather than the better part of an hour (or longer) if I were searching and trying to assemble code.

    This is one of those areas where AI was very useful to me. It built a fairly trivial coding item I needed, it helped explain things when I had questions, and it was helpful in adjusting code quickly when I realized I needed something else.

    Imagine asking a colleague this, realizing you’d asked the wrong thing, and then asking them again for new code. How slow, and annoying, would this be for both of you? AI is a game changer here, for things that are too simple to work with a colleague on, yet complex enough that you’d waste a decent chunk of time googling.

    That time savings went into me testing the code and testing SQL Source Control. I verified that SQL Source Control can work with git hooks in minutes.

  • Done is Better than Good

    Mary Spender is a musician in the UK who I follow and hope to see live one day. She works hard producing content about music, that business, and, of course, songs. Recently she had a little essay on Instagram where talked about creative time and focus. In it she referenced Elizabeth Gilbert saying “done is better than good.”

    My initial reaction was “that’s right.”

    Then I thought about software, and poor queries impacting database performance, and thought, “No, that’s not right.” My next reaction was to think maybe it’s “done is better than great”. I do see plenty of engineers trying to build great software. Code that would impress their peers or their former professors. Or maybe their future self.

    Then I thought, no, Elizabeth is right. If things don’t get done, then what’s the point?

    At the same time, I think that “done” and “good” (or great) aren’t mutually exclusive. We can get things done and make them great, which is something to strive for. We can also get good things done.

    Sometimes.

    Sometimes we don’t have that luxury of time, for various reasons. If I had to make a trade, I push for good (or quality) as much as possible if the delay isn’t substantial. If it is, then done is likely the choice I’d make. I do try to return and refactor, improve, etc. to raise the quality over time, but I recognize that sometimes getting something done is important. Certainly, on the ranch, I need to fix things to get by, with the aim of doing a better job later. I have mixed success at returning to improve a patch with a better fix later, but so far, that’s worked well. I’d say the same thing has happened while building software or managing systems, with enough success to be comfortable with my choices.

    What about you? What choices have you had to make about being done over delivering something that’s good? Or maybe great.

    Steve Jones

    Listen to the podcast at Libsyn, Spotify, or iTunes.

    Note, podcasts are only available for a limited time online.