When developing software, decisions often come down to trade-offs between simplicity, readability, and maintainability. One recurring choice is whether to use a function or a class for a task. While both have their place, I often lean toward functions for many scenarios. Here’s why they can be a great option.
Functions tend to be straightforward: they take inputs, produce outputs, and avoid hidden states. This simplicity makes them easier to reason about and debug. If something breaks, you don’t have to untangle a web of interdependent attributes to locate the issue.
When testing, pure functions shine. They’re predictable: give them valid inputs, and they’ll always produce the same outputs. This predictability simplifies both writing and maintaining tests.
Read full postComing from Node.js async code is the norm, and when async/await was introduced a big shift happened since it was competing with the callback approach where you could archive the same.
In Python it is not the same, Python is by default sync and webservers relies on WSGI (Web Server Gateway Interface) like gunicorn to handle multiple connections on a server.
So python tutorials does not normally talk or show async code examples, so learning it in python is defenitely harder.
This package includes a lot of the functionality on how to control flow in your now async code. This blog shows really well the different methods like async.create_task
, asyncio.wait
, asyncio.gather
and how to use them.
I have been creating a new Python project and when you start a project you always have the possibility to do things smarter than last time.
I have previous used pyenv or venv, but they never felt good for many reasons. The Python ecosystem feels more fragmented and powerful. For beginners it feels like the jump from simple dependency management to advance is a large gap.
UV feels like the right package manager for beginners now. It takes many of the good things from the popular Cargo in Rust and brings it to Python.
Read full postIf you have to have multiple GitHub accounts, you end up with the problem of you having multiple SSH keys.
The problem when arises that you can't have multiple keys tried when doing git clone
, so that command will fail.
If you google on the internet you will find solutions like changing your git config file ~/.ssh/config But that is not a great solution, because they suggest changing the hostname, so now you can not do a git clone without remembering the fake domain you said in your git config.
There has been a few platform shifts in the past 10 years.
The next cloud platform to go big will be Cloudflare with their Workers product.
Read full post