|Facebook developing improved PHP|
Fixes some PHP flaws.
Facebook's Hack fixes some of PHPs most glaring flaws (plenty left though).
I prefer to just use something else, but this looks like a good thing to port large existing PHP codebases to.
New features include async support. I always wondered why node.js adocates thought async was something special as every other language can do it to - obviously they were doing what .Net advocates do and comparing only with PHP.
|I prefer to just use something else... |
Just curious, what "something else"?
I feel a bit of a heathen for saying this, as I am aware of the negative aspects, but I have come to really like PHP's "weakly typedness"!
Is what you like weak typing or dynamic typing?
I use Python which is strongly but dynamically typed. See the original wiki: [c2.com ]
I used to use TCL which is weakly typed, and find Python's multiplicity of types very useful - ordered dicts, named typles, sets, queues and more as well as the usual ints, strings, floats, associative arrays etc.
There are lots of really good languages out there, many with decent libraries and frameworks - JVM languages like Scala and Clojure have all the Java libraries for a start. Python has a massive standard library and a lot of third party libraries and frameworks.
|Is what you like weak typing or dynamic typing? |
Yes. :) But yes, I do really mean "dynamically" typed. (This was really in reference to the "Type Annotations" mentioned on hacklang.org that appears to enforce "static" typing.) Not so much a fan of the "weak/loose" typing, would always prefer explicit type conversion whenever possible.
Yes, it is static typing, but it is optional, so you would use it sparingly where it is likely to catch future bugs.
Have you ever tried a language with type inference? I am happy with dynamic + strong, but type inference seems to give you the advantages of static without the verbosity.
Interesting, I have not used a language with "type inference". This would seem to be more suited to certain types of languages(?), or can be implemented partially in more "complex" languages... "In the case of complex forms of higher-order programming and polymorphism, it is not always possible for the compiler to infer as much, however, and type annotations are occasionally necessary for disambiguation." Wikipedia [en.wikipedia.org]
Explicitly declaring types (in the case of statically typed languages) help to self document the code. How do type inferred languages manage this without writing additional comments? Maybe this can be built into the IDE (if this is possible before compilation)? After all, in PHP I do still document the expected types (as I think many do) with PHPDoc-style comments that identify the parameter and return types in function/method signatures.
Type inference seems most common in functional languages. I did not know why but there is an explanation on the C2 Wiki again [c2.com ]
I think the documentation problem is also minimised in these languages as it should also be fairly clear to a human reader of the code what return type is expected.
I like linking to the C2 wiki because everyone forgets it was the original, and for many people wiki is synonymous with The Other One! Not often I get the chance though.