Programming Leftovers
-
Proportional fonts for coding? No thank you
There's some back and forth in the Gemini community about coding with a proportional font. You can pry my monospace font from my cold dead hands.
I've been coding for nearly 40 years now, and it's always been some form of a monospace font, some pretty, like the character set for VGA on IBM PCs, and some not to pretty, like the character set on the TRS-80 Color Computer. Code in a proportional font just looks weird to me.
-
Build an R package: the workshop
With the “Build an R package” workshop, starting from a set of R scripts and functions, you will develop an R package along the way using usethis and devtools packages, you will learn how to deal with package dependency applying renv to the package framework, you will document functions using roxygen2, you will learn about unit tests and how to integrate them in your package using usethis and testthat.
-
Binary formats and protocols: LTV is better than TLV
In my view, LTV — Length-Type-Value — is the better construction. One reason for this is that if you arrange the fields like this, you can define the LTV construction as a composition of two different constructions: [...]
-
Visualizing the FIDE World Chess Championship
The day was structured nicely to help you push yourself to create something even if you haven't done it before. (Which is great, because I haven't!) The general structure was a kick-off call, then some hanging out together while we worked, and at the end we had presentations. The kick-off call was where we could meet each other and ask for help and share ideas. For me, this was a great place to validate that the idea I was working on was valid and interesting. Then in the hangout time, we just shared little updates (I was very excited when I got a line to draw) and could have some accountability by seeing someone else also working. The presentations at the end give you a nice target. They motivated me to finish something, which gave me a nice time constraint.
-
Mastering the Art of Logging in Python: A Complete Guide
Python’s logging module provides a powerful and flexible framework for implementing logging in software applications. With a wide range of built-in features and configuration options, the logging module enables developers to log events at different levels of severity, control the format of log messages, and route logs to different destinations such as files or email. By using the logging module, Python developers can easily integrate logging into their code and ensure that their applications are stable and reliable.
-
Ruff: a fast Python linter
Linters are tools that analyze a program's source code to detect various problems such as syntax errors, programming mistakes, style violations, and more. They are important for maintaining code quality and readability in a project, as well as for catching bugs early in the development cycle. Last year, a new Python linter appeared: Ruff. It's fast, written in Rust, and in less than a year it has been adopted by some high-profile projects, including FastAPI, Pandas, and SciPy.
Linting tools are often part of an integrated development environment, used in pre-commit hooks, or as part of continuous-integration (CI) pipelines. Some popular linters for Python include Pylint, Flake8, Pyflakes, and pycodestyle (formerly called pep8), which are all written in Python as well. Each linter checks whether the code violates a list of rules. Ruff reimplements a lot of the rules that are defined by these other popular Python linters, and combines them into one tool.
-
Namespaces for the Python Package Index
The Python packaging picture is generally a bit murky; there are lots of different stakeholders, with disparate wishes and needs, which all adds up to a fairly large set of multi-faceted problems. Back in the first three months of the year, we looked at various discussions around packaging, some of which are still ongoing. A packaging summit was held at PyCon 2023 to bring some of the participants of those discussions together in one room. One of its sessions was on adding a namespaces feature to the Python Package Index (PyPI). It provides a look into some of the difficulties that can arise, especially when trying to accommodate a long legacy of existing practices, which is often a millstone around the neck of those trying to make packaging improvements.