Untangled Development

Home ·  Blog ·  About

Gemfinder Q4 2021; What is Software Engineering?

Articles I’ve encountered in Q4 2021 that struck a chord. Very late, I know! Tried to organise them in these sections:

Software Engineering

Software Engineering Is Programming Over Time

By Adam Johnson, is about Adam’s insights his experience reading Software Engineering at Google: Lessons Learned from Programming Over Time :

Software engineering can be thought of as “programming integrated over time.” [..] Time brings changes, both to the program and its environment. And these changes require answers to questions [..] Many software engineering practices exist to help solve these questions [..] The longer your program lasts, and the more valuable it becomes, the more you will need software engineering practices.

Selecting a programming language can be a form of premature optimization

I found this an enjoyable read. The author, Brett Cannon, couldn’t have said it any better:

Consider optimizing for developer time, not computation costs.

Python is easy-to-learn and widely-used. I.e. a good language to start a project with.

Al Klein’s answer on Quora

Question is this:

As a software developer who is not good at programming, how do I hide myself in a tech company and not get caught out?

Full answer in the link above. What struck me is Al’s definition of what programming is:

I don’t know why everyone wants to be a programmer, and everyone thinks that anyone can learn programming, just like everyone can learn proper grammar. It’s more like art - if you’re not artistic, you’ll never “learn” to be artistic, you’ll keep squeaking through art classes without learning much. The same goes for programming - if you’re not analytical, you’ll never learn to be analytical, so you’ll always be a programmer looking for someone to show you how to solve the problem you’re working on.

Al goes on to define what he means by analytical:

Survival is mainly “fight or flee”. If a lion came at you, 50,000 years ago, you didn’t analyze things, you just hoped that he’d run out of strength before he caught you. Analyzing him for a few minutes didn’t get those “analysis genes” passed on, they became lion food. Humans are pattern-seeking animals. We’re also non-analytical animals. Programming is analytical, so not many of us can actually do it. Code something that someone shows you how to do? Yes. But analyzing the problem to come up with a solution? That’s not common. But what it is, is programming.

I agree that being analytical is a trait. All the great engineers I worked with are to some degree analytical. However I have some questions:

  • How do you determine if a person is analytical?
  • Is it that black and white a trait? Can’t a person become more analytical? With time and experience?

I have no answer to these, yet. But somehow I don’t see it as a “zero or hero” situation.

Also such argument can be used for gatekeeping. Which is always bad.

Databases

Five Tips For a Healthier Postgres Database in the New Year

Great post by Craig Kerstiens, with five actionable tips:

  1. Set a statement timeout. This can save you from your DB going down (or CPU up!)
  2. Ensure you have query tracking. Feat. pg_stat_statements.
  3. Log slow running queries. Feat. log_min_duration_statement.
  4. Improve your connection management. Optimise your framework/ORM’s default connection pool to your database.
  5. Find your goldilocks range for indexes. An index can become more a liability than an asset over time.

Full details in the linked post.

Python & Django

The Well-Maintained Test

Are you familiar with Joel Spolsky’s “Joel Test”? It consists of twelve yes/no questions to judge a team’s processes. Or as Adam puts it, to check “a software engineering team’s technical chops”.

One of the best aspects of working with Django is its third-party package ecosystem. In fact all Django engineers have their few favourite packages. I myself have mine that I don’t imagine myself working without.

This also means that I have worked on projects that relied on a package that became out-of-date. It’s not an easy situation:

  1. need to find a replacement, usually a fork
  2. or code your own solution

Unless you decide to somehow take charge and maintain the package yourself. Which, if you’re freelancing, good luck getting paid for that!

So judging whether a project is well-maintained is important. Adam came up with twelve checks to ask when adding a third-party package to your project:

  1. Is it described as “production ready”?
  2. Is there sufficient documentation?
  3. Is there a changelog?
  4. Is someone responding to bug reports?
  5. Are there sufficient tests?
  6. Are the tests running with the latest version?
  7. Are the tests running with the latest version?
  8. Is there a Continuous Integration (CI) configuration?
  9. Is the CI passing?
  10. Does it seem relatively well used?
  11. Has there been a commit in the last year?
  12. Has there been a release in the last year?

Motivation for each “check” in Adam’s post. This post was followed up by a command-line app by Ryan Cheley!

Django Celery Multiple Queues, when and how to use them

Do you need a task queue in your web app? This is a nice post on when to start using multiple queues in Celery, and how to do it.

The definitive guide to modeling polymorphism in Django

In this article Michael Karamuth goes through a variety of approaches to model polymorphism in Django models.

Whether you agree with each or not, it is a nice refresher of the variety of modeling approaches the Django ORM offers.

My preference is the contenttypes contrib module. Docs here.

So much buzz around htmx lately. Two links I might need to refer to soon:

Ops

More like “oops” section this time:

Worst Case

Though experiment by Tim Bray.

Abstract:

Suppose you’re running your organization’s crucial apps in the cloud. Specifically, suppose you’re running them them on AWS, and in particular in the “us-east-1” region? Could us-east-1 go away? What might you do about it? Let’s catastrophize!

Enjoy!