News for hackers. Stuff that matters.
Re:PHAP: Mobile Apps in PHP by conner_bw on Thursday January 14, 2016 @08:47AM (#10901312)
I'm not sure if this is a joke...
Re:PHAP: Mobile Apps in PHP by gravypod on Thursday January 14, 2016 @08:53AM (#10901342)
PHP gets a bad rap because of the way many of the people who use it program. The language would be very good, in my opinion, with just a few standardization tweaks to the standard library.

It seems this project has retconned the standard library. I'd say this is a perfect application for this sort of language.

Weak typed, simple to read, simple to write prototyping.

Anyone can pick up PHP, that's its beauty.

Re:PHAP: Mobile Apps in PHP by herbst on Thursday January 14, 2016 @10:36AM (#10901983)
Anyone can pickup: Python, Ruby, Lua, whatever. Even the more exotic new ones like Chrystal are very easy to understand. PHP really isnt. A language IMHO cant be simple if you cant derive the method names in the order of the arguments.
Re:PHAP: Mobile Apps in PHP by smt88 on Thursday January 14, 2016 @09:07AM (#10901427)
But wouldn't it be better to have a language/environment where prototyping is simple, but writing complex apps is also simple?
Re:PHAP: Mobile Apps in PHP by gravypod on Thursday January 14, 2016 @09:27AM (#10901531)
Writing complex apps in PHP is just fine. You just need to respect the better parts of the language, just like everything else.
Re:PHAP: Mobile Apps in PHP by smt88 on Thursday January 14, 2016 @09:40AM (#10901609)
I fix PHP apps for a living, and sometimes I write them from scratch if a client is set on using PHP. I strictly follow PSR standards and have tons of mess detector and sniffing rules that keep me mistyping or being less disciplined. I use all the new type hinting features in PHP 7, and before that I was heavily using PhpStorm's excellent support for inferring types from doc blocks.

It's still way, way more painful to write large, complex apps in PHP than in a better-designed language like TypeScript. I actually just rewrote an entire API in TypeScript, and it was like breathing clean air.

I actually realized that having better typing totally eliminates 90% of the tests I was writing for my PHP code. With static typing, you just make sure your inputs conform to the right type, and then you always seem to end up with bug-free code. That's simply not possible with PHP without bending interfaces to suit your needs. You end up with an insane number of unnecessary classes/interfaces instead of simple types that you get in other languages.

It's definitely possible to write complex apps in PHP, especially if you have excellent discipline, but there's a really good reason Facebook created Hack. PHP = Blub