News for hackers. Stuff that matters.
Re:Python alternatives for PHP functions by nikcub on Tuesday December 25, 2012 @04:38AM (#4965607)
I know both languages well. Python is much more succinct than PHP because of array literals, list comprehensions, lambda's and better native data types with ways to navigate them (all the functional methods are there). Only PHP 5.4 with a literal array syntax is beginning to approach some of the things you can do in Python.

You think PHP is short because you have functions like xmlrpc_encode_request and the equivalent in Python is 20 lines. What you don't see if that xmlrpc_encode_request is pages and pages of C code and PHP macro's behind the scenes. That function should be in a library, not in a programming language, which is why PHP is more comparable to other web frameworks, not to other programming languages.

Re:Python alternatives for PHP functions by Firehed on Tuesday December 25, 2012 @01:40PM (#4966683)
It IS a PHP library - just one written in C rather than in user-land PHP code. Why is this a problem? The XML-RPC extension isn't even enabled by default.
Re:Python alternatives for PHP functions by emidln on Tuesday December 25, 2012 @10:29AM (#4966169)
xmlrpc_encode_request on this site should probably be fixed to use xmlrpclib.dumps (or loads if you need the other direction). This has existed in Python since version 2.2.

I realize this is beside the point, but I'm willing to fix it myself.