PHP or Python ? what should i study ?

0 Comments

“PHP, on the other hand, was never meant for novice programmers. It was designed to be used by expert programmers who have extensive programming experience.”

You clearly have no idea how PHP was developed. PHP succeeded initially precisely because the barrier to entry was so ridiculously low. Any idiot can start writing PHP web sites. (And many did, which is why PHP for a long time had a reputation for bad security; not because the language was insecure, but because so much PHP was written by people with about a week’s experience in coding at all.)

Friendliness toward novices is a major design goal of PHP, as witnessed by, um, any discussion on the php-internals list about how and if to add functionality. And every presentation ever given by PHP’s founder Rasmus Lerdorf. If anything, PHP was *too* focused on novice programmers in its early years, which resulted in some baggage it still carries around today.

Strike one.

“Python has exceptionally well-developed library support for almost all types of applications. PHP comes nowhere close to Python here.”

May I introduce you to our lord and Savior Packagist.org?

There are literally tens of thousands of ready-to-use PHP libraries available, and even a standards body (PHP-FIG) that is working to help make them all more inter-compatible all the time. Python certainly has a massive code library of its own, true, but to say PHP doesn’t is simply flat out ignorant.

The examples you list are all machine learning, advanced-math examples. It’s true that Python’s offering there is stronger, because of tools like NumPy, which are… written in C and bridged into Python. PHP has its own C-based-high-speed library collection (PECL), which does at the moment lack really good advanced-math machine-learning libraries. That’s a fair criticism, but to say that because in that one niche area PHP’s library collection lags that “PHP comes nowhere close to Python” is deliberately and unprofessionally misleading.

Strike 2.

Speaking of math, let’s look at your performance section. You say PHP 7 is 3x faster than Python. PHP 7 is also roughly 2x faster than PHP 5. Doing the math, that would mean PHP 5 was 1.5x faster than Python. (I’ve not benchmarked that, but that’s what your numbers imply.) Yet you say:

“PHP 5.x versions were quite slow, taking a lot of time in execution.”

If being 50% faster than Python is “quite slow”, then I’d hate to use Python for anything where performance mattered! Again, this is your own numbers, which don’t bear out the comparison you’re making.

Strike 3.

“PHP, on the other hand, provides Atom package for debugging.”

Um. What’s Atom? Isn’t that a code editor? What’s that got to do with debugging?

PHP’s debugger is called XDebug. If you are talking about debugging in PHP and *not* mentioning XDebug, it clearly shows that you have never actually used PHP, and thus have no business trying to compare it to anything.

Strike 4.

“The point to be noted here is that there is no significant point where PHP beats Python.”

… Except on performance, where just a few paragraphs earlier you say “Therefore, talking about speed, PHP wins by a significant margin over Python.”

And in the places that you give Python an edge, the only one that isn’t demonstrably *wrong* is availability of machine learning libraries.

Strike 5.

Which… isn’t surprising given that you are working at a machine learning startup, and I’ll lay even money are using Django for it. Which is fine; I’ve nothing against Django, Python’s certainly a capable language, and its machine learning libraries really are better than PHP’s options today. You likely make the right decision using it for your machine learning startup.

But that is no reason to flat out lie about PHP to justify your decision. Your decision to use Python for your startup can and should justify itself; there’s no need to spread FUD about PHP to back it up.

 

“PHP was designed for experts” bit. PHP was literally created for simple personal pages, and as it evolved, it became a really popular language for begginners because of how easy it was to get started and use it for web pages. I get that you probably feel python is easier, but to rewrite the history of PHP is wrong. It also wasn’t a language that has a history of early “design”, they kind of added things as they needed them for a while, which really shows if you use old PHP functions where the param order and function names were super inconsistent for instance. I can tell you as an experienced PHP developer, I never heard that “PHP was designed for experts” argument before and have to constantly remind people of how far it has come as a language, and how it isn’t just a “small pages” language anymore.

Leave a Reply

Your email address will not be published. Required fields are marked *