Coding Blocks (software development)

We've got a smorgasbord of delights for you this week, ranging from mechanical switches to the cloud and beyond. Also, Michael's cosplaying as Megaman, Joe learns the difference between Clicks and Clacks, and Allen takes no prisoners.

See the full show notes a https://www.codingblocks.net/episode220

 

News

  • Thanks for the reviews! Meskell, itsmatt
  • Leave us a review if you have a chance! (/reviews)

The Show

  • Why are mechanical keyboards so popular with programmers?
  • Is it the sound? Is it the feel? What are silent switches? Are they missing the point?
  • You can buy key switches for good prices (drop.com)
  • Cloud Costs Every Programmer should know (vantage.sh) (Thanks Mikerg!)
  • List of static analysis tools, so you can get with the times! (GitHub) (Thanks Mikerg!)
  • From itsmatt:
  • "I’d love a breakdown of what each of you think are your key differences in philosophies or approaches to software development. Could be from arguments or debates on older episodes, whether on coding, leadership, startups, AI, whatever - just curious about how best to tell everyone’s voices apart based on what they’re saying. I know one of you is Jay Z (JZ?), but slow to pick up on which host is which based on accents alone."

Resources We Like

  • 8Bitdo Retro Mechanical Keyboard (amazon)
  • Hot Swap vs Solderable Keyboard PCBs (kineticlabs.com)
  • Cherry MX Switch Tester (amazon)
  • Keyboard Switch Sample Pack (amazon)

Tip of the Week

  • How do you center a div? Within a div? With right-align text? What about centering 3 divs? What if you want to space them out evenly? If you've been away from CSS for a while, you may be a bit rusty on the best ways to do this. Not sure if it's "the best" but an easy solution to these problems is to use Flexbox, and lucky for you there is a fun little game designed to teach you how to use it. (flexboxfroggy.com)
  • Drop.com is a website focused on computer gear, headphones, keyboards, desk accessories etc. It's got a lot of cool stuff! (drop.com)
  • Have you ever accidentally deleted a file? Recovering files in git doesn't have to be hard with the "restore" command (rewind.com)
  • Have trouble with your hands and want to limber up? Also doubles as a cool retro Capcom Halloween costume. It's a LifePro Hand Massager! (amazon)

Direct download: coding-blocks-episode-220.mp3
Category:Software Development -- posted at: 7:45pm EDT

See the full episode's show notes at:
https://www.codingblocks.net/episode219

Direct download: coding-blocks-episode-219.mp3
Category:Software Development -- posted at: 10:12am EDT

In this episode, we are talking all about GitHub Actions. What are they, and why should you consider learning more about them? Also, Allen terminates the terminators, Outlaw remembers the good ol' days, and Joe tries his hand at sales.

See the full show notes at https://www.codingblocks.net/episode218

News

  • Thanks for the reviews! iTunes: nononeveragain, JoeRecursionjoe, Viv-or-vyv, theoriginalniklas
  • Leave us a review if you have a chance! (/reviews)
  • Allen did some work on his computer:
    • DeepCool LT720 Liquid Cooler (amazon)
    • Noctua Dual-Tower CPU Cooler (amazon)

What are GitHub Actions?

  • GitHub Actions is a CI/CD platform launched in 2018 that lets you define and automate workflows
  • It's well integrated into Github.com and fits nicely with git paradigms - repository, branches, tags, pull requests, hashes, immutability (episode 195)
  • The workflows can run on GitHub-hosted virtual machines, or on your own servers
  • GitHub Actions are free for standard Github runners in public repositories and self-hosted runners, private repositories get a certain amount of "free" minutes and any overages are controlled by your spending limits
    • 2000 minutes and 500MB for free, 3000 minutes and 1Gb for Pro, etc (docs.github.com)
  • Examples of things you can do
    • Automate builds and releases whenever a branch is changed
    • Run tests or linters automatically on pull requests
    • Automatically create or assign Issues, or labels to issues
    • Publish changes to your gh-pages, wiki, releases,
  • Check out the "Actions" tab on any github repository to check if a repository has anything setup (github.com)
  • The "Actions" in GitHub Actions refers to the most atomic action that takes place - and we'll get there, but let us start from the top

Workflows

  • Workflow is the highest level concept, you see any workflows that a repository has set up (learn.microsoft.com)
  • A workflow is triggered by an event: push, pull request, issue being opened, manual action, api call, scheduled event, etc (learn.microsoft.com)
  • TypeScript examples:
    • CI - Runs linting, checking, builds, and publishes changes for all supported versions of Node on pull request or push to main or release-* branches
    • Close Issues - Looks for stale issues and closes them with a message (using gh!)
    • Code Scanning - Runs CodeQL checks on pull request, push, and on a weekly schedule
    • Publish Nightly - Publishes the last set of successful builds every night
  • Workflows can call other workflows in your repository, or in a repository you have access to
  • Special note about calling other workflows - when embedding other workflows you can specify a specific version with either a tag or a commit # to make sure you're running exactly what you expect
  • In the UI you'll see a filterable history of workflow runs on the right
  • The workflow is associated with a yaml file located in ./github/workflows
  • Clicking on a workflow in the left will show you a history of that workflow and a link to that file (cli.github.com)

Jobs

  • Workflows are made up of jobs, which are associated with a "runner" (machine) (cli.github.com)
  • Jobs are mainly just a container for "Steps" which are up next, but the important bit is that they are associated with a machine (virtual or you can provide your own either via network or container)
  • Jobs can also be dependent on other jobs in the workflow - Github will figure out how to run things in the required order and parallelize anything it can
    • You're minutes are counted by machine time, so if you have 2 jobs that run in parallel that each take 5 minutes…you're getting "charged" for 10 minutes

Steps

  • Jobs are a group of steps that are executed in order on the same runner
  • Data can easily be shared between steps by echoing output, setting environment variables or mutating files
  • Each step runs an action

Actions GitHub Enterprise Onboarding Guide - GitHub Resources

  • An action is a custom application written for the GitHub Actions platform
  • GitHub provides a lot of actions and other 3p (verified or not) providers do as well in the "Marketplace", you can use other people's actions (as long as they don't delete it!), and you can write your own
  • Marketplace Examples (github.com)
    • Github Checkout - provides options for things like repository, fetch-depth, lfs (github.com)
    • Setup .NET Core SDK - Sets up a .NET CLI environment for doing dotnet builds (github.com)
    • Upload Artifact - Uploads data for sharing between jobs (90-day retention by default) (github.com)
    • Docker Build Push - Has support for building a Docker container and pushing it to a repository (Note: ghrc is a valid repository and even free tiers have some free storage) (github.com)
  • Custom Examples
    • "run" command lets you run shell commands (docker builds, curl, echo, etc)
    • Totally Custom (docs.github.com)

Other things to mention

  • We glossed over a lot of the details about how things work - such as various contexts where data is available and how it's shared, how inputs and outputs are handled…just know that it's there! (docs.github.com)
  • You grant job permissions, default is content-read-only but you must give fine-grained permissions to the jobs you run - write content, gh-pages, repository, issues, packages, etc
  • There is a section under settings for setting secrets (unretrievable and masked in output) and variables for your jobs. You have to explicitly share secrets with other jobs you call
  • There is support for "expressions" which are common programming constructions such as conditionals and string helper functions you can run to save you some scripting (docs.github.com)

Verdict

  • Pros:
    • GitHub Actions is amazing because it's built around git!
    • Great features comparable (or much better) than other CI/CD providers
    • Great integration with a popular tool you might already be using (docs.github.com)
    • Works well w/ the concepts of Git By default, workflows cannot use actions from GitHub.com and GitHub Marketplace. You can restrict your developers to using actions that are stored on your GitHub Enterprise Server instance, which includes most official GitHub-authored actions, as well as any actions your developers create. Alternatively, to allow your developers to benefit from the full ecosystem of actions built by industry leaders and the open-source community, you can configure access to other actions from GitHub.com.
    • Great free tier
    • Great documentation https://docs.github.com/en/actions/using-containerized-services/creating-postgresql-service-containers
    • Hosted/Enterprise version
  • Cons:
    • Working via commits can get ugly…make your changes in a branch and rebase when you're done!

Next Steps

  • If you are interested in getting started with DevOps, or just learning a bit more about it, then this is a great way to go! It's a great investment in your skillset as a developer in any case.
  • Examples:
    • Build your project on every pull request or push to trunk
    • Run your tests, output the results from a test coverage tool
    • Run a linter or static analysis tool
    • Post to X, Update LinkedIn whenever you create a new release
    • Auto-tag issues that you haven't triaged yet

Resources We Like

Tip of the Week

  • There is a GitHub Actions plugin for VSCode that provides a similar UI to the website. This is much easier than trying to make all your changes in Github.com or bouncing between VSCode and the website to see how your changes worked. It also offers some integrated documentation and code completion! It's definitely my preferred way of working with actions. (marketplace.visualstudio.com)
  • Did you know that you can cancel terminating a terminating persistent volume in Kubernetes? Hopefully you never need to, but you can do it! (github.com)
  • How are the Framework Wars going? Check out Google trends for one point of view. (trends.google.com)
  • Rebasing is great, don't be afraid of it! A nice way to get started is to rebase while you are pulling to keep your commits on top. git pull origin main --rebase=i
  • There's a Dockerfile Linter written in Haskell that will help you keep your Docker files in great shape. (docker.com)

Direct download: coding-blocks-episode-218.mp3
Category:Software Development -- posted at: 7:44pm EDT

See the full show notes and join in the discussion by heading to

https://www.codingblocks.net/episode217

 

Direct download: coding-blocks-episode-217.mp3
Category:Software Development -- posted at: 6:51pm EDT

In this episode, we're talking all about OpenTelemetry. Also, Allen lays down some knowledge, Joe plays director and Outlaw stumps the chumps.

See the full show notes at https://www.codingblocks.net/episode216

News

  • Thanks for the reviews Lanjunnn and scott339!
  • Allen made the video on generating a baseball lineup application just by chatting with ChatGPT (youtube)

https://youtu.be/i6jSeLvoFmM
Allen made the video on generating a baseball lineup application just by chatting with ChatGPT

What is OpenTelemetry?

  • An incubating project on the CNCF - Cloud Native Computing Foundation (cncf.io)
  • What does incubating mean?
    • Projects used in production by a small number of users with a good pool of contributors
      • Basically you shouldn't be left out to dry here
  • So what is Open Telemetry? A collection of APIs, SDKs and Tools that's used to instrument, generate, collect and export telemetry data
    • This helps you analyze your software's performance and behavior
  • It's available across multiple languages and frameworks

It's all about Observability

  • Understanding a system "from the outside"
    • Doesn't require you to understand the inner workings of the system
  • The goal is to be able to troubleshoot difficult problems and answer the "Why is this happening?" Question
  • To answer those questions, the application must be properly "Instrumented"
  • This means the application must emit signals like metrics, traces, and logs
  • The application is properly instrumented when you can completely troubleshoot an issue with the instrumentation available
  • That is the job of OpenTelemetry - to be the mechanism to instrument applications so they become observable
  • List of vendors that support OpenTelemetry: https://opentelemetry.io/ecosystem/vendors/

Reliability and Metrics

  • Telemetry - refers to the data emitted from a system about its behavior in the form of metrics, traces and logs
  • Reliability - is the system behaving the way it's supposed to? Not just, is it up and running, but also is it doing what it is expected to do
  • Metrics - numeric aggregations over a period of time about your application or infrastructure
    • CPU Utilization
    • Application error rates
    • Number of requests per second
  • SLI - Service Level Indicator - a measurement of a service's behavior - this should be in the perspective of a user / customer
    • Example - how fast a webpage loads
  • SLO - Service Level Objective - the means of communicating reliability to an organization or team
    • Accomplished by attaching SLI's to business value

Distributed Tracing

To truly understand what distributed tracing is, there's a few parts we have to put together first

  • Logs - a timestamped message emitted by applications
    • Different than a trace - a trace is associated with a request or a transaction
    • Heavily used in all applications to help people observe the behavior of a system
    • Unfortunately, as you probably know, they aren't completely helpful in understanding the full context of the message - for instance, where was that particular code called from?
    • Logs become much more useful when they become part of a span or when they are correlated with a trace and a span
  • Span - represents a unit of work or operation
    • Tracks the operations that a request makes - meaning it helps to paint a picture of what all happened during the "span" of that request/operation
    • Contains a name, time-related data, structured log messages, and other metadata/attributes to provide information about that operation it's tracking
    • Some example metadata/attributes are: http.method=GET, http.target=/urlpath, http.server_name=codingblocks.net
  • Distributed trace is also known simply as a trace - record the paths taken for a user or system request as it passes through various services in a distributed, multi-service architecture, like micro-services or serverless applications (AWS Lambdas, Azure Functions, etc)
    • Tracing is ESSENTIAL for distributed systems because of the non-deterministic nature of the application or the fact that many things are incredibly difficult to reproduce in a local environment
    • Tracing makes it easier to understand and troubleshoot problems because they break down what happens in a request as it flows through the distributed system
    • A trace is made of one or more spans
      • The first span is the "root span" - this will represent a request from start to finish
        • The child spans will just add more context to what happened during different steps of the request
      • Some observability backends will visualize traces as waterfall diagrams where the root span is at the top and branching steps show as separate chains below - diagram linked below (opentelemetry.io)

To be continued…

Resources We Like

Tip of the Week

  • Attention Windows users, did you know you can hold the control key to prevent the tasks from moving around in the TaskManager. It makes it much easier to shut down those misbehaving key loggers! (verge.com)
  • Does your JetBrains IDE feel sluggish? You can adjust the heap space to give it more juice! (blogs.jetbrains.com)
  • Beware of string interpolation in logging statements in Kotlin, you can end up performing the interpolation even if you're not configured to output the statement types! IntelliJ will show you some squiggles to warn you. Use string templates instead. Also, Kotlin has "use" statements to avoid unnecessary processing, and only executes when it's necessary. (discuss.kotlinlang.org)
  • Thanks to Tom for the tip on tldr pages, they are a community effort to simplify the beloved man pages with practical examples. (tldr.sh)
  • Looking for some new coding music? Check out these albums from popular guitar heroes!

Direct download: coding-blocks-episode-216.mp3
Category:Software Development -- posted at: 7:55pm EDT

See full show notes at:
https://www.codingblocks.net/episode215

Direct download: 215_Software_in_Audio_and_How_to_Lead.mp3
Category:Software Development -- posted at: 2:31pm EDT

In this episode, we're talking about the history of "man" pages, console apps, team leadership, and Artificial Intelligence liability. Also, Allen's downloading the internet, Outlaw has fallen in love with the sound of a morrvair, and Joe says TUI like two hundred times as if it were a real word.

See all the show notes at https://www.codingblocks.net/episode214

News

  • Thanks for the reviews!
    • itunes: michael_mancuso
  • DevFest Florida is a community-run one-day conference aimed to bring technologists, developers, students, tech companies, and speakers together in one location to learn, discuss and experiment with technology. (devfestfl.org)

What are (were?) man pages?

  • "man" is a command-line "pager" similar to "more" or "less" that was designed specifically to display documentation - ahem, "manuals"
  • "man" pages would show you documentation for many apps in a (mostly) consistent manner that was available offline
  • Do people still use them?
  • People would print these out in the 70's and beyond!
  • How do you create a man page? (allthings.how)
  • Uses an old markup language named "roff"
  • Install to the proper location, typically /usr/man/man: (tldp.org)

Software Engineering at Google: Lessons Learned from Programming Over Time (amazon)

How to Lead a Team (Anti-Patterns edition)

Software Engineering at Google: Lessons Learned from Programming Over Time (amazon)

  • Hire Pushovers
  • Ignore Low Performers
  • Ignore Human Issues
  • Be Everyone's Friend
  • Compromise the Hiring Bar
  • Treat Your Team Like Children

Terminal UIs

  • A new frontier in programming?
  • The Good:
    • Keep your hands on the keyboard!
    • Easily install on remote servers
    • Often built by devs for devs
    • Low overhead
    • Purpose-built for their purposes (as opposed to IDE extensions)
    • Looks ancient
  • The Bad:
    • Looks ancient
    • Scriptability
    • Each has it's own learning curve

Examples:

Meta AI

  • Meta has been making serious strides in AI with LLAMA and...it's open source! Does that make them any more or less liable for the information? Does "publically available information" change things

Resources we like

Tip of the Week

  • Want to learn something new while also making your life easier? Why not try writing a TUI!? Here's an article that will kindly introduce you to terminal user interfaces, libraries like "Clap", "TUI", and "Crossterm" that people are using to write them, and…you can get some XP with Rust while you're at it! (blog.logrocket.com)
  • Are you looking to upgrade your Kubernetes cluster? Check for API problems first!
  • Are you a browser tab fiend? Did you know you can reload all your tabs simultaneously with a simple shortcut? (groups.google.com)
  • No more nasty wiring jobs, get yourself to the hardware store website and pick up some wire and splicing connectors. Keep things nice, tidy, and organized. (wago.com)
  • Matt’s Off-road recovery channel is amazing if you're into cars or... beautiful-sounding things.
  • Are you tired of manually correlating logs and events? No more! Check out the Open Telemetry project for your distributed tracing and analytics needs! (opentelemetry.io)

Direct download: coding-blocks-episode-214.mp3
Category:Software Development -- posted at: 7:55pm EDT

See the full show notes at:
https://www.codingblocks.net/episode213

Direct download: 213_Better_Application_Management_with_Custom_Apps.mp3
Category:Software Development -- posted at: 6:55pm EDT

In this episode, we're talking about lessons learned and the lessons we still need to learn. Also, Michael shares some anti-monetization strategies, Allen wins by default, and Joe keeps it real 59/60 days a year!

The full show notes for this episode are available at https://www.codingblocks.net/episode212.

News

  • Thanks for the review rioredwards!
  • Want to help us out? Leave a review! (/reviews)

Exceptions vs Errors in Java

  • Exceptions: Unwanted or unexpected events
    • NullPointerException
    • IntegerOverflowException
    • IllegalArgumentException
  • Errors: Serious problems that you should try not to catch - generally no recovery
    • OutOfMemoryError
    • StackOverflowError
    • NoClassDefFoundError
  • What happens if your code runs in a background thread?
    • Thread gets terminated, but the application keeps running
    • Resources are released, dependent threads are terminated
    • It's up to the owner of the thread to handle the situation
    • The best practice is to attempt to handle these situations by validating at startup

Question from Twitter: (thanks jvilaverde!)

How do you guys keep up with your data sources?

  • Coding Blocks Slack (/slack)
  • Hacker News

StackOverflow Survey (thanks mikerg!)

  • 70% of all respondents are using or are planning to use AI tools in their development process this year
  • 82% of people learning to code plan to use AI
  • 30% don't plan on it
  • 40% of devs trust the accuracy of AI
  • Highest paid languages? Zig, Erlang, RB, Scala, Lisp, F#
  • Lowest paid? Dart, MATLAB, PHP, Visual Basic, Delphi
  • Warning: remember the audience!
  • Web Frameworks: React 40% Angular 17%, Vue 16%
  • Other frameworks: .NET, NumPy, Pandas
  • What does this tell you about the demographics?
  • Docker 51%, Kubernetes 20%

Unit Testing Principles, Practices, and Patterns: Effective testing styles, patterns, and reliable automation for unit testing, mocking, and integration testing with examples in C#

Resources We Like

  • StackOverflow 2023 Survey Results (survey.stackoverflow.com)
  • We <3 Kubernetes (episode 147)
  • Is Kubernetes Programming? (episode 141)
  • Chik-Fil-A A Kubernetes Success Story (appvia.io)
  • How to write amazing unit tests (episode 54)
  • Zig Language (ziglang.org)
  • Unit Testing Principles, Practices, and Patterns: Effective testing styles, patterns, and reliable automation for unit testing, mocking, and integration testing with examples in C# (Amazon)





Direct download: coding-blocks-episode-212.mp3
Category:Software Development -- posted at: 7:50pm EDT

You can find the full show notes at:

https://www.codingblocks.net/episode211