4 ms·
Javascript is what PHP should be since day 1.
by revskill 5y ago
Javascript is what PHP should be since day 1.
- cies 5y ago> Javascript is what PHP should be since day 1. ReasonML or ReScript is what JS should have been since day 1.
- revskill 5y agoIt's not fun sir. What's the point of those $$$ mark for variables ? Make no sense at all. Easy adoption for all levels of programmers is what make it work for enterprise applications now.
- bnt 5y agoHey, here’s someone who never saw Perl and doesn’t know how PHP evolved.
- 9dev 5y agoFor one thing, it makes the distinction between language keywords and variables clear - no problems in using `$switch` or `$var`, and even more important, the core devs don't have to take as much care when developing new language features. Not that I usually use variable names like these, but it quickly becomes automatic to use a dollar sign.
- christophilus 5y agoScheme is what JS should have been since day 1.
- cestith 5y agoGuile in the browser would make plenty of sense had someone not shoved the mess that was early JS into the world.
- cies 5y agoThis is in fact an alternative universe I have thought about quite a bit. I'm more on the strong-typed side of life nowadays. But otherwise I think it is a good choice. Also: HTML could be expressed in scheme as well. Scheme all the way down.
- stemc43 5y agoid this why js devs rewrite everything in typescript now?
- revskill 5y agoBecause it's flexible and type-safe. You have both productivity and scalability on both syntax level and infrastructure level. It's suitable for 99% of programmers and the businesses for now.
- progx 5y agoBut now you need a ton of time to type things.
- Tade0 5y agoOnly a problem if you're trying to be too inventive with it. For most cases it's enough to just define interfaces, enums and maybe bundle some of this into discriminated unions. Throw in some generics for good measure. That's not a lot of work. I've seen people do stuff like dependent types, but unless you're writing a library you don't actually need most of the type system's features.
- kaba0 5y agoThere is type inference. And also, it’s not a typing contest, if typing speed is your bottleneck in programming you are doing something really badly, I suggest plugging in the keyboard.
- dotancohen 5y agoI see that you've not used Javascript before ES6. I remember a time when the only thing worse than PHP, was Javascript.