readable code is simple - you have primary functions that compose together a bunch of smaller functions
when i wrote elixir this was natural to do
i've realized after years in ts my habits eroded for the following reasons
1. extracting out logic into a function is more overhead because you have to write out argument types. sometimes these are complex inferred types you wouldn't have to articulate when logic is inline
2. lack of pipe operator - having a lot of small functions is less fun when you need to name intermediary variables to name every step
3. camel case - i hate camel case and small functions usually can't be one word. `checkUsage` vs `check_usage`
trying to be more aware of this because it's biasing me towards fat unreadable functions
jay was trying to use claude for some basic frontend work and he said "man this is great if you don't care about details"
that kind of explains the hype - if you suck ai is already producing better work than you
@MichaelArnaldi Backend devs interface with two things they have control over (servers and frontend devs)
Frontend devs interface with two things they don’t have control over (users and backend devs)
JS ecosystem is weirdly a high judgement required stack
- tons of garbage to dodge
- noise from the amount of VC funding pushing confusion
- infinite solutions for every micro problem tempting their way into your codebase
you really need to be good at finding clarity
@thdxr Already ran into similar issues with previous versions of next or nuxt.
If you have a seperate builds for different envs you may end up deploying untested build artefacts to your prod env. Only a matter of time till you break prod! 🧨
PSA 📢: Avoid Barrels
(A barrel is a file that exports code from other files)
Barrel benefits:
✅ Shorter import paths
✅ Support importing many files via one import
✅ "Hide" modules - Only export some modules for the "public" interface
But, I avoid barrels. Here's why:
🚫 Bloats the bundle. Inhibits tree shaking.
🚫 Increases memory usage.
🚫 Slows tooling (builds, tests, linting). Barrels create more modules to parse.
🚫 Slows code navigation ("Find all references" finds the barrel instead of the actual source).
🚫 Barrels shorten import paths and group related imports. Sounds nice, but it's an outdated benefit because I don't write imports anymore - my editor reliably auto-imports.
Fire up the Lambos and meet usePHP. Run PHP in React, with edge SSR. Extracts your PHP code, executes it in WASM, and injects the result into your React code.