An important rule of software design: strings are not your friends.
We are taught to avoid strings when working with databases, but there are even better examples. Concatenating operating system paths is a simple operation where careless string manipulation can lead to security issues and serious bugs.
Use standard libraries for creating paths whenever you can.
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!