What language would you prefer for dynamic websites?
Oh boy. You think it's just script kiddies doing websites in react?
No, my question was honest. What language / libraries / frameworks would you use for dynamic web? I'm interested in your opinion. Familiarity (thus, availability of people who have used the language before, or volume of AI training material) has real value, but not infinite; if something is crap enough, some less known alternative could beat it.
In fairness Typescript is probably the right language for that. With React. Why? It's the most common, the most used, has the ecosystem mass.
It does not make it "good" though. You will no doubt have witnessed the cesspool which is "NPM". Its just one bug security vul nested inside itself. Literally filthy with trojans. CVEs a dozen a day or more. Wide open to exploit and .... nobody has a choice but to keep playing.
I recommend a few things. Lock your npm versions in your package.json. Specify the exact version you ran tests against. Do not use "latest", "stable" or any logical tag. For even higher security focused needs, specify the git commit hash or tag hash of the code version you want, this prevents people simply pushing an exploite to an old version branch and your NPM auto pulling it.
You see as a backend dev, I don't care if your web UI gets hacked, corrupted or writes junk crap code with can't tell if something is a number, an ojbect, an array or a string.... I will validate it at the back end and tell the UI to go away. When they ask me to write that back end in Typescript is when my heckles come up.
Our service is typescript / react. Most of the pain points have been related to state storage design (state mutation logic, storage itself, race conditions), I don't remember much problems with the typing system. I guess most of the problems we have dealt with would have happened in any language.
By "state storage" what do you mean? Can you expand on it. Do you mean "persistence of record" or do you mean "inflight state"?
Storage is always a funnel for race conditions because it is usually where you cross a "clock domain" from sub nano-second timings to milisecond timings. Trains that run down the line in memory don't reveal there are no signals on the track. Those same trains finding themselves entering a slow down for an SSD write make it obvious a red signal was a good idea at least somewhere.
Typescript's other little convention "async/await" is NOT what you think it is. Thus it will tend to hide the problem above right up until it doesn't.
The Typescript runtime is single execution limited. It's a single process. However those keywords amount to "almost threads". Single process execution + threads appears to be "thread safe" until it isn't anymore and then it hurts.
What "await" does is say, "You can skip this, this time, it's not ready to execute". The actual execution thread then moves onto the next thing in the waiting list. Round robin.
So each train is advanced down the line one at a time. Nothing colides. But it does not stop on of trains simply stopping at a station and even though each one is advanced independantly, there are not checks for running in the train in front. It will just produce an error if you are lucky or silently corrupt state in the worst.