TypeScript and safety-critical paths should not be in one sentence.
Programmer Humor
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
wut ?
Why ?
Genuinely curious to learn from your arguments
It's Javascript with types. You are still using one hundred NPM packages to do the simplest thing. Any string can be JSON. And Node is single-threaded, so if you plan to create some kind of parallel computation, you'd need to run 16 Docker containers of your Node server, one per CPU core, with NGINX or some other load balancer at the business end, and hope that your database engine won't reorder transactions. And yeah, Docker is mandatory, because Node version in your latest Ubuntu release is already outdated.
Okay I see your point
I personnally work in a servesless environment, and doubt many business applications really need parallelism. (Btw, you have to have at deast 1000 IQ to do it properly in C, C++ or Rust) Plus there are other TS runtimes now, so you don't have to use Node
As for strings as JSON, I don't understand the problem. You can do runtime validation to ensure what you're handling is of the right shape.
As for the numerous packages for the most basic thing, how is it different from C, C++ or Rust ? I prefer this approach to Java, where one framework does it all, bc there's innovation going on like crazy in the JS ecosystem and some established solutions feel like garbage now...
Personnally, I fell in love with TS because it's orders of magnitude better than plain JS and because the type system is very well designed. It's good enough for many usecases. Don't get me wrong, I'd love doing it in Rust on a daily basis, but my business needs rarely justify it
JSON-in-a-string is a commonplace method of having a generic or any type when you are too lazy to write a proper structure for it, or want to save an object into a database without creating an additional table. In all fairness it has nothing to do with the language itself, and more with lazy coders. Postgresql even have additional SQL operators to access individual JSON fields inside a record, so yeah, you can dump a whole new unstructured database into a row of your existing database, it's totally an acceped practice.
Oof, bad practice indeed.
Would NOT pass my code review
As for languages that are acceptable for business logic, C++ is lolno, Java is kinda surprisingly okay because so much business logic is already written in it and debugging is trivial, Python is not worse than Java for the same reason when you are using proper linter to catch typos, C# / Go / Ruby are probably the best because they are most modern with the lowest footgun ratio.
So there is apparently a problem with languages such as JavaScript and the solution is to use languages such as TypeScript.
Wut?
Well, yes. TypeScript mitigates one big problem with JavaScript (type safety). That’s why it exists. It’s a dumb idea to choose vanilla JS over TS if you’re starting a new project today, IMO.
Whether or not you should use TS as your core language is debatable and situational, but in terms of using TS instead of JS, yeah, that’s a no brainer.
don't just m-dash
chat gippity
Maybe, but always remember LLMs are trained on real people. Some people naturally use similar styles to some LLM tica as it was stolen from them in the first place.
Don't just state—regurgitate!
Sounds like they want Ada Spark and not Rust.
i laughed pretty hard thinking isn’t that just ada
so we got rid of ada for c++ now from c++ to rust chasing ada lmao