NoRaincheck

Python & TypeScript - in Review (2024)

Python & TypeScript - in Review (2024)

December 2024

One thing that I like to stress is the importance of tooling and relying on defaults. By being able to speak consistently within ones own projects or using commonly seen patterns reduces the mental overhead. These could be folder structures or idioms, especially things which permeate across different programming languages or frameworks.

Here are some of my thoughts on Python and TypeScript; coming from someone who is predominantly a Python developer and does minimal front-end work.

Python

As a general trend, I’ve gone all-in in [astral](https://astral.sh/:

General setup

1brew install uv
2uv init <project>

with options in pyproject.toml

1[tool.ruff]
2line-length = 120  # changed from 88
3
4[tool.ruff.lint]
5select = ["E4", "E7", "E9", "F", "I001"]  # added isort option

In general using ruff format and ruff check --write make for good developer experiences

On “default” libraries, I do find myself trying to rely more and more on stdlib instead of particular frameworks. This is probably more a reflection of trying out https://cosmo.zip/ for trying out portable scripting as a default.

Enterprise library recommendations:

Patterns

In terms of enterprise building patterns, I still recommend Cosmic Python, in particular working with Domain Driven Design.

TypeScript

I’m very new to TypeScript, and have not used it in anger in enterprise settings. Infact modern web development is still very daunting and the tooling still doesn’t “make sense” to me. The general webdev space feels like there was a lot of tacit knowledge that was in-built in the ecosystem and non-obvious for how a beginner should proceed.

Since I use TypeScript more as a hobbyist, I do find myself gravitating towards patterns which allow me to “deploy” applications straight to static hosting solutions like github pages. In the past, I have tried solutions like Gatsby Vite though they haven’t quite clicked for me.

General Setup

In general bun defaults work well. I would generally push source code to the src folder and use rolldown to push builds to dist with separate html files for testing the webserver. Hopefully in the future I get the whole software development cycle seamlessly working (n.b. I know bun supports watch mode supports watching)

Hopefully in the new year I get more acquainted with the appropriate patterns for TypeScript development. I may try doing more work with bun repl and scripting as a replacement to Python to practise my coding chops.

<< Previous Post

|

Next Post >>

🎲 Random post

|

All posts

#Production #Python #CLI #Tooling #FastAPI #ML