How do you choose which framework or library to use in your projects?
There is no absolute "correct" answer here ๐คจ
For me it comes down to:
- Support (when was the last commit?)
- Up to date with latest features of the language or toolchain (e.g. ESM)
- Developer experience (how much setup is needed?)
- Flexible (easy to swap with another library if necessary)
- Type safety (the more the better)
Here are my current choices for web/mobile ๐
Mobile: Cross platform, Flutter vs React native
I have a background in developing native Android apps. That was not fun ๐
Cross platform for my personal work is a not brainer. I use both dart and typescript since a long time.
Therefore: Flutter or React native?
I went with Flutter for the past few years:
- Easier to install and configure
- Faster to compose UI
- More type safe (dart with sound null safety)
Effect (typescript): React native again?
I tried React native in the past. It was not fun ๐
The amount of configuration needed and the lack of features was overwhelming.
Nonetheless, the rise of effect
in typescript and the grow of Expo are pushing me to reconsider React native again.
Alert: Possible React native (with
effect
) project incoming ๐
macro is coming in dart
Wait! Another big update may cause the definitive win of Flutter over React native.
Static metaprogramming ๐
Macro in @dart_lang 3.4 (behind a flag ๐ฉ) Work in progress to start experimenting with macros in dart 3.4 (possibly ๐ค) Example: `fromJson` and `toJson` using `macro` and a method/constructor/class definition ๐
Metaprogramming has the potential to solve all the major issues with dart, mostly related to code generation and build_runner
.
Alert: Incoming project using
macro
once dart 3.4 lands ๐
There is more ๐คฉ
Timeless coding principles, practices, and tools that make a difference, regardless of your language or framework, delivered in your inbox every week.
Web: it depends ๐ค
On the web the battle is more intense.
Some tools are easy to pick:
vite
vitest
eslint
prettier
What about frameworks instead?
For me is all-in on react
, the rest it really depends:
- Mostly
nextjs
(but definitely not always ๐ โโ๏ธ) preact
(smaller projects)- Remix (more control)
- Vanilla typescript (for libraries)
Styling: tailwind (and never look back)
I tried close to all the solutions out there for styling with CSS.
Once I landed on tailwind I never came back ๐ช
I have been using v4 (alpha) for the last couple of weeks. It's mind-blowing ๐
- No more configuration file
- All styles defined in CSS
- Faster (x10)
Type safety: required features
In any language and project:
- Type system (I don't deal with dynamic languages, it's not fun ๐)
- Errors as values (
Option
andEither
) - Pure functions (as much as possible)
- Controlled effects (push IO to the edges)
- Pattern matching
Since not many languages ship these features out of the box, I fallback to libraries ๐๐ผโโ๏ธ
Again, There is no absolute "correct" answer here. As developers we must continuously try new stuff and be open to new libraries, features, and patterns.
That's what makes it fun: everything changes fast and there is no time to get bored ๐
See you next ๐