<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Scripting on Backend Engineering Strategy Tools</title><link>https://backend-engineering-strategy-tools.github.io/site/tags/scripting/</link><description>Recent content in Scripting on Backend Engineering Strategy Tools</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Mon, 01 Jan 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://backend-engineering-strategy-tools.github.io/site/tags/scripting/index.xml" rel="self" type="application/rss+xml"/><item><title>Bash</title><link>https://backend-engineering-strategy-tools.github.io/site/public-notes/languages/bash/</link><pubDate>Mon, 01 Jan 2024 00:00:00 +0000</pubDate><guid>https://backend-engineering-strategy-tools.github.io/site/public-notes/languages/bash/</guid><description>&lt;p&gt;Bash is unavoidable in DevOps work — CI/CD pipelines, container entrypoints, system init scripts, and quick automation all end up as shell scripts eventually. Knowing how to write it well saves a lot of pain.&lt;/p&gt;
&lt;h2 id="tooling"&gt;Tooling
&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Linting:&lt;/strong&gt; &lt;a class="link" href="https://www.shellcheck.net/" target="_blank" rel="noopener"
 &gt;ShellCheck&lt;/a&gt;: catches common mistakes and anti-patterns. Run it in CI, or install the IDE plugin. Most of what it flags is genuinely wrong.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;IDE:&lt;/strong&gt; Any editor works. ShellCheck integrations exist for VS Code, IntelliJ, Vim, and most others.&lt;/p&gt;
&lt;h2 id="good-habits"&gt;Good habits
&lt;/h2&gt;&lt;p&gt;Set these at the top of every non-trivial script:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;#!/usr/bin/env bash
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;set -euo pipefail
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-e&lt;/code&gt; — exit on error&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-u&lt;/code&gt; — error on unset variables&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-o pipefail&lt;/code&gt;: catch errors in pipes, not just the last command&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Use &lt;code&gt;shellcheck&lt;/code&gt; before committing. Most Bash bugs it catches are subtle and only surface under specific conditions in production.&lt;/p&gt;
&lt;h2 id="when-to-reach-for-python-instead"&gt;When to reach for Python instead
&lt;/h2&gt;&lt;p&gt;When the script grows beyond ~50 lines, needs associative arrays, JSON parsing, or HTTP calls — switch to Python. Bash is great glue; it&amp;rsquo;s a poor application language.&lt;/p&gt;
&lt;h2 id="resources"&gt;Resources
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a class="link" href="https://www.shellcheck.net/" target="_blank" rel="noopener"
 &gt;ShellCheck&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://www.gnu.org/software/bash/manual/" target="_blank" rel="noopener"
 &gt;Bash Reference Manual&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://google.github.io/styleguide/shellguide.html" target="_blank" rel="noopener"
 &gt;Google Shell Style Guide&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Python</title><link>https://backend-engineering-strategy-tools.github.io/site/public-notes/languages/python/</link><pubDate>Mon, 01 Jan 2024 00:00:00 +0000</pubDate><guid>https://backend-engineering-strategy-tools.github.io/site/public-notes/languages/python/</guid><description>&lt;p&gt;Python is my scripting and automation language of choice. I reach for it when Bash starts getting unwieldy — data processing, API interactions, infrastructure automation scripts, and one-off tooling.&lt;/p&gt;

 &lt;blockquote&gt;
 &lt;p&gt;&lt;strong&gt;2024 note:&lt;/strong&gt; For anything beyond quick scripts I&amp;rsquo;m increasingly reaching for Go instead. Better performance, a single compiled binary, and stronger typing make Go a more honest choice for tools that end up running in production. Python still wins for data work and anything where the ecosystem matters (ML, pandas, etc.).&lt;/p&gt;

 &lt;/blockquote&gt;
&lt;h2 id="tooling"&gt;Tooling
&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;IDE:&lt;/strong&gt; &lt;a class="link" href="https://www.jetbrains.com/pycharm/" target="_blank" rel="noopener"
 &gt;PyCharm&lt;/a&gt;: JetBrains&amp;rsquo; Python IDE. Good for larger projects. For scripts and smaller work, IntelliJ IDEA with the Python plugin does the job.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Formatting:&lt;/strong&gt; &lt;a class="link" href="https://black.readthedocs.io/" target="_blank" rel="noopener"
 &gt;Black&lt;/a&gt;: opinionated formatter, no configuration needed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Linting:&lt;/strong&gt; &lt;a class="link" href="https://docs.astral.sh/ruff/" target="_blank" rel="noopener"
 &gt;Ruff&lt;/a&gt;: extremely fast linter and formatter, replacing Flake8 + isort in most setups.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Dependency management:&lt;/strong&gt; &lt;a class="link" href="https://docs.astral.sh/uv/" target="_blank" rel="noopener"
 &gt;uv&lt;/a&gt;: modern, fast package manager replacing pip/virtualenv for most workflows.&lt;/p&gt;
&lt;h2 id="where-i-use-it"&gt;Where I use it
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Infrastructure automation and scripting alongside Ansible&lt;/li&gt;
&lt;li&gt;Data processing and log analysis&lt;/li&gt;
&lt;li&gt;CLI tooling for internal workflows&lt;/li&gt;
&lt;li&gt;Quick API clients and integration scripts&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="resources"&gt;Resources
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a class="link" href="https://docs.python.org/3/" target="_blank" rel="noopener"
 &gt;docs.python.org&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://realpython.com/" target="_blank" rel="noopener"
 &gt;Real Python&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>