3 ms·
There are other languages receiving way more praises like Python that at the end of the day are just lacking so many features that php gets right but still php
by thinkindie 7y ago
There are other languages receiving way more praises like Python that at the end of the day are just lacking so many features that php gets right but still php is the bad guy.
- deragon 7y agoLike what features?
- thinkindie 7y agotypes? interfaces?
- deragon 7y agoTypes, sure. PHP 7 does those better than python, mainly due to the fact that the main implementation actually checks the types. Python seems to rely on 3rd party tools for that for some reason. Dunno if they're gonna change that or if they designed it like that. Interfaces, hmm. PHP took its whole OO almost directly from Java, which is an odd thing to do given how different the typing disciplines of Java and PHP are. Python's OO system is much more in-tune with the dynamic aspect of the language.
- thinkindie 7y agolet's say that the only advantage of python over php are ML libraries but porting a library is far different job than creating an ecosystem
- thinkindie 7y agoyet if you want to start using python for large projects you have to come up with some hacks to make sure certain things are in check. With python is as easy as php to create spaghetti code and the language itself doesn't even help with that, however php is the only one taking the blame
- fleetfox 7y agoPython doesn't need interfaces because it's duck-typed. If by types you mean type-hints you can have em since 3.5. It's not as pretty as TS or even PHP with strict_types=1 (even though you can describe things that you can't in php) but it works. What Python has over PHP is strong typing, meta programming, data science and ML libraries. And from what i've seen better overall code quality if you pick random library from pypi compared to packagist
- rokalakt1337 7y agoWell, many of the Python fans are fresh graduates. They have been taught python because it's an easy language - no proper classes, little use of design patterns, coding standards and so on. The reality is PHP is still a thing, and will be a thing for a long long time. There is a package for anything you need in composer, and unlike most python libs, these have been tried and tested in production far longer.