7 ms·
Just for the sake of argument – any reason why not PHP?
by olssonm 13y ago
Just for the sake of argument – any reason why not PHP?
- shalmanese 13y agoFor a bank? I can think of lots of reasons. * You're exposed to any upstream bugs in the language and interpreter * Dynamic typing and silent errors mean you're far more likely to make a mistake and not realize it * It's missing a lot of battle tested libraries and frameworks * It's PHP
- Gigablah 13y agoMaybe someone would like to post a link to the veekun article for the umpteenth time.
- ColdHawaiian 13y agoI'm assuming that you're referring to "PHP: a fractal of bad design"[1]? [1]: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/ http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de...
- mappu 13y ago> You're exposed to any upstream bugs in the language and interpreter How would you mitigate that, and how is the mitigation process any different for PHP?
- someone13 13y agoNot to say whether PHP is in fact a good idea or not, but at least in a statically-compiled language, once you've got a "working binary", however you accomplish that, it will presumably continue to function that same way indefinitely. Obviously barring OS-level problems, of course :)
- nodesocket 13y agoWould you consider Python and Ruby strongly typed? Because I happen to know two very large payments company using them. However if that is indeed their code, it makes me cry and cringe, even though PHP is my strongest language and I'm proud to admit it.
- dan15 13y agoAnything in particular about this code that makes you cry and cringe?
- nodesocket 13y agoLot's, but perhaps most obvious, not using a routing engine or framework, simply spaghetti code case statement: public static function _Route_getStats($path) { switch($path) { case 'version': ...
- eurleif 13y ago>Would you consider Python and Ruby strongly typed? Did you mean statically typed? There are two dichotomies: static vs. dynamic, and weak vs. strong. Ruby and Python have strong dynamic typing. PHP has weak(-ish) dynamic typing.
- _pmf_ 13y ago> Because I happen to know two very large payments company using them. For the purpose of short selling: who are they?
- nodesocket 13y agoI bet you can guess, both bay area YC companies.
- xytop 13y agoStripe?
- 13y ago
- RossM 13y agoAn argument, since it's Monday and I'm grumpy: 1. As in any language, 2. As in any interpreted language. Yes PHP has the gag operator (@) but it's use is discouraged (and not used in this example), 3. Not in my opinion. The Symfony framework alone has a ton of well used packages[0]. It does look like someone's decided to build their own framework from this example though, 4. Opinion. [0]: https://packagist.org/search/?q=bundle https://packagist.org/search/?q=bundle
- bunderbunder 13y ago> 2. As in any interpreted language. Scheme, Standard ML, very early versions of Java, and BASIC come to mind. Static typing really does seem particularly important in this domain, to the point that if an engineer is unable to find a suitable interpreted static language then the prudent choice would be to start looking at compiled langauges before relaxing the static typing requirement. Even implicit type conversion seems like a pretty questionable idea in this sphere. You really would want to be keenly aware of when you're doing something that might add or remove numerical precision.
- antocv 13y agoIt looks $ugly, $code is read more $often than its $written. This $ everywhere hurts the eyes. Its syntax is bad and inconsistent, before 5.4 you couldnt have a function return an array and call it and access array contents like this funcName()['blah']. What the. PHP only has one data type for structures, array, which in various ways pretends to be every data type, stack, queue, tree, hashmap, list, fuck it all, lets just call it array everywhere! Anyway, everything else is implicitly converted as well, strings, integers, fuck it all, lets ouput 0 or 1 who cares. PHP is basically not a language, its a clusterfuck of copy-pasted code everywhere, I bet its runtime, Zend, is as a copypaste of various C-libraries cobbled together. I feel sorry for all the PHP lovers, must be stubborn ones, just like VisualBasic people 10 years ago when it was dying. PHP-lovers have the same argument now as VisualBasic did 10-15 years ago. EDIT: Where and when I would use PHP. Never. There is always a better alternative. This talk about how easy it is to host, blah blah, then you never had to compile php and set its config flags and include dumb oci8 modules, pear or pecl files or whatever, or see it fail and no logs anywhere but you have to have system-level access to some ini files. Ugh... I think people have just learned to live with that crap, and the more sane languages and web frameworks like Flask or Grails are much easier.
- brianpgordon 13y agoZend is, indeed, infamously a mess. HipHop is supposed to be better. https://github.com/facebook/hhvm https://github.com/facebook/hhvm
- dan15 13y agoYeah, Hack for HHVM adds a bunch of stuff to PHP to make it better, including: - Collection classes like Vector (which is like an array in every other programming language ever) and Map (associative array or hashtable) - Generics - Lambda functions - Asynchronous functions - Type hinting for intrinsic types (int, string, bool) Not much public documentation yet, but most bits are in the open source HHVM release, and there are a few blog posts on it (eg. http://www.sitepoint.com/hhvm-hack-part-1/ http://www.sitepoint.com/hhvm-hack-part-1/)
- jasey 13y ago
- cognivore 13y agoThere are a lot of great responses (and counter responses) here already as to why PHP is a surprising choice, but primarily my objection is one of misapplication. PHP is a scripting language for fast creation of web sites. It grew organically and consequently has a lot of weird gotchas that make it easy to write in bugs. Its floating point is poor, which you would think would be a detriment in financial use. Want to get a web site up like right now, get some PHP. Want to run the largest Bitcoin exchange in the world, maybe not so much.