6 ms·
I, for one, would chose PHP8 over Javascript all day, every day. And there seem to be millions like me.
by lpcvoid 5y ago
I, for one, would chose PHP8 over Javascript all day, every day. And there seem to be millions like me.
- rbanffy 5y agoWell... I wouldn't recommend JavaScript. TypeScript is much nicer and removes a lot of the JS pitfalls.
- sdevonoes 5y agoAnd pulling ~67 dev dependencies just to be able to transpile TS to JS? No thanks. https://www.npmjs.com/package/typescript https://www.npmjs.com/package/typescript
- Loeffelmann 5y agoDo these dependencies actually matter when you deploy or are they just used for the actual compiling?
- El_RIDO 5y agoIf they are required for the compile and someone manages to get something malicious into them, they can certainly affect the produced/deployed artifact. See Ken Thompson, Reflections on Trusting Trust, 1984 https://www.cs.cmu.edu/~rdriley/487/papers/Thompson_1984_ReflectionsonTrustingTrust.pdf https://www.cs.cmu.edu/~rdriley/487/papers/Thompson_1984_Ref...
- 0x142857 5y agoThis comment shows perfectly that people has no clue what they're talking about, these dev dependencies will never be pulled into your project, they're just for typescript's own development.
- Ginden 5y ago> these dev dependencies will never be pulled into your project, Please, don't ruin "JS bad" thread with facts. It's rude.
- cardanome 5y agoTypescripts has an insanely complicated type system (at least for the low level of type safety you get), is dog slow to compile and has cryptic error messages. With PHP you can have your cake and eat it too. Have the productivity of a dynamic language, no compile step and a really smooth gradual typing experience with great tooling and linting. I really can't think of anything other that familiarity why one would prefer JS/TS for server side stuff. Maybe async story but PHP 8 got fibers now so it might be catching up soon as well.
- azangru 5y ago> Typescript ... has cryptic error messages. This is very strange to hear. Typescript error messages will show you a type mismatch and explain why one type isn't compatible with the other. What's an example of a cryptic typescript error message?
- cardanome 5y agoHave you ever used Elm or Rust? Maybe you expectation of how decent error messages should look like is just lower. The problem is that the type system in TS can get crazy complex and has many uncommon features like structural typing. You need to have a really good mental model of how TS works to be able to make sense of what TS tries to tell you.
- azangru 5y ago> You need to have a really good mental model of how TS works to be able to make sense of what TS tries to tell you. Won't this sentiment hold true for Rust as well? You need to have a good mental model of how Rust works, with all its borrowings and lifetimes, to understand what its errors are trying to tell you, and especially how to fix the problem?
- cardanome 5y agoActually no. Rust will teach you. The difference is that errors do a great job and telling you what went wrong and how you can fix it. You just fix one error after another and the borrow checker will guide you to the correct solution. For example you get an error like: error[E0433]: failed to resolve: use of undeclared type `Environment` --> src/main.rs:9:19 | | let mut env = Environment::new(); | ^^^^^^^^^^^ not found in this scope | help: consider importing this struct | | use foobar::test::Environment; | You could fix this error without knowing Rust. You obviously need to know the basics of systems programming to effectively program in Rust and some type errors get tricky, still it is a more interactive experience and you can just jump in while in TS just jumping in does not really work and the level of type safety relies on your skills as a developer.
- tored 5y agoTypeScript is nice, the nodejs community is not. It is a shame that such a nice language as TypeScript is stuck in such horrible community.
- mradmin 5y agoCan you give some examples of why the nodejs community is not nice?
- tored 5y agoPerhaps ecosystem is a better word than community. How npm works and the policies by company behind it. PHP composer is much more sane than npm. And all the different package controversies like leftpad. Lots of bogus and malware packages.