Welcome to WebmasterWorld Guest from 54.198.87.238

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Facebook developing improved PHP

Fixes some PHP flaws.

     
4:53 am on Mar 24, 2014 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



Facebook's Hack fixes some of PHPs most glaring flaws (plenty left though).

[hacklang.org ]

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.
9:48 am on Mar 24, 2014 (gmt 0)

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



Interesting.

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"!
1:04 pm on Mar 24, 2014 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



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.
9:19 pm on Mar 24, 2014 (gmt 0)

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



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.
11:06 am on Mar 25, 2014 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



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.
2:44 pm on Mar 25, 2014 (gmt 0)

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



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.
4:35 pm on Mar 25, 2014 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



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.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month