by noncoml · 8y ago · 0 comments
What are the alternatives if you want something with type checking? Java? No, thanks. Haskel? Where are the libraries? C/C++?
I guess Typescript is the only alternative
> Haskel? Where are the libraries?
Well, I suppose the same drawback would apply to Pony. :)
As for libraries, what matters is if the desired use case is covered, not winning the App Store count.
There's Nim and D too, but I get the lack of big commercial backing could disqualify them.
https://github.com/PatrickLouys/professional-php-sample-code
What libraries are missing? The only issue I've had with libraries are that some client libraries are wrappers over C libraries and this makes static linking difficult (or seemingly impossible on a Mac)
A few years ago there was a lack of libraries in some areas but that's not the case these days.
But yes, if you're working on a modern PHP project, there's a lot to love: A solid module system, an enormous sea of high quality libraries, type checking, a really nice deployment and scalability story, decent performance, good tooling (IDEs, debuggers, etc.), a servicable C-style syntax. For many purposes (not all!) it's ten times better than, eg, nodejs. (Which might seem like a low bar, I admit...)
It's still the same as C, which is _not_ a solid module system.
Though it has improved dramatically.
The VO's I use trow exceptions when you construct them with some bad value. This is great because when you use for example a natural positive integer object you are sure it is one.
So now I have 'type checking' and more secure code in PHP.
http://php.net/manual/en/functions.arguments.php#functions.a...
And it is still the case with type declarations, that they make your code actually slower, because the runtime adds asserts in your code which gets evaluated at runtime?