Month summary - February 2022

Posted by Tobiasz Kedzierski on 28.02.2022

February 2022

I am aggregating here some more or less interesting stuff of various IT related materials which I came across this month. Some of them are strictly related to the things I did or am currently doing.

Some thoughts

I watched a very nice talk about structuring a Django application (Radoslav Georgiev - Django structure for scale and longevity) and analyzed the repository complementary to that talk (Django Styleguide). TLDR/TLDW: the whole idea behind it is that all business logic should NOT live in:

  • APIs and Views.
  • Serializers and Forms.
  • Form tags.
  • Model save method.
  • Custom managers or querysets.
  • Signals

but in:

  • Services - functions that mostly take care of writing things to the database.
  • Selectors - functions that mostly take care of fetching things from the database.
  • Model properties (with some exceptions).
  • Model clean method for additional validations (with some exceptions).

This seems to be a pretty awesome idea. Often, the business logic is spread across Django in views or serializers and with a growing project it is easy to fall into some redundancy here and there. Afterwards, with updates and further growth it is getting harder to keep track of where scattered logic parts live. The proposed structure helps to keep all crucial logic in an intuitive place (like service) and reuse it in views, serializers etc. This Django Styleguide speaks to me since I had the pleasure to work on a project which was written in Flask but also facilitated services. For more details watch the talk and check the repo.

Other highlights of the month: I made some improvements to my GitHub Action TobKed/github-forks-sync-action. In addition to bug fixes I put together an example of syncing multiple branches. It emerged from the discussion on the issue.

Python

cmd

The Cmd class provides a simple framework for writing line-oriented command interpreters. These are often useful for test harnesses, administrative tools, and prototypes that will later be wrapped in a more sophisticated interface.

Django

Django Styleguide

Django styleguide that we use in HackSoft.

  1. We have a Styleguide-Example to show most of the styleguide in an actual project. 2, You can watch Radoslav Georgiev's Django structure for scale and longevity for the philosophy behind the styleguide.

Tools

Lurnby

A tool for active reading and personal knowledge management.

gitstats

git history statistics generator

Go

How We Write GitHub Actions in Go

Below, we’ll share the set of unique challenges for running and releasing actions written in Go and outline our strategies for solving these problems.

github.com/fatih/vim-go

Go development plugin for Vim

Other stuff

The Missing Semester of Your CS Education

Classes teach you all about advanced topics within CS, from operating systems to machine learning, but there’s one critical subject that’s rarely covered, and is instead left to students to figure out on their own: proficiency with their tools. We’ll teach you how to master the command-line, use a powerful text editor, use fancy features of version control systems, and much more!

Videos

Marty Lobdell - Study Less Study Smart

Radoslav Georgiev - Django structure for scale and longevity

Inside Security - S01E17 | The creator of Curl, Daniel Stenberg, joins the show for an interview