4 ms·
Why would you use PHP when Python exists?
by mgaunard 2y ago
Why would you use PHP when Python exists?
- cess11 2y agoIt's a better language. Better performance, better typing, better syntax, and so on. Build an application in Python, then as soon as it becomes pushed by load you're going to need a rewrite. A few small load balancers and virtual web servers doing PHP can handle tens of thousands of requests per second, the database is almost guaranteed to be the bottleneck. Python is a (according to some) nicer bash, it's not a good alternative for implementing non-trivial systems and web services.
- mgaunard 2y agoPython is the world's most popular programming language and a true general-purpose language usable for any application.
- cess11 2y agoIs that meant to be a joke?
- mgaunard 2y agoIt is an undeniable fact, the numbers don't lie.
- cess11 2y agoWhat numbers? The amount of operating systems and drivers implemented in Python?
- mgaunard 2y agohttps://pypl.github.io/PYPL.html https://pypl.github.io/PYPL.html https://www.tiobe.com/tiobe-index/ https://www.tiobe.com/tiobe-index/
- cess11 2y agoSorry, I'm not keen on measuring excellence by polling web search engines. Is this how you choose what web pages to visit? You grab a top five from somewhere and only use those, except when you drop by here? I'm more interested in your claim about "usable for any application". How come all those fancy ML types and learned academics refuse to use Python for the core computations they perform when they try to invent witchcrafts, instead opting for C, C++ and Fortran libraries?
- mgaunard 2y agoHigh-performance numerical kernels are hardly general-purpose programming.
- cess11 2y agoThere is no such thing. Sometimes the algolians are called general-purpose programming languages, as opposed to SQL, functional programming languages, logic programming, and so on. Sometimes anything it's used as an opposite to domain-specific languages.
- mzarate06 2y agoAs a longtime PHP developer, my opinion differs from yours regarding PHP vs. Python syntax. Python took some getting used to, but the more I used it the more strongly I began preferring its lack of things like curly braces, semicolons, even parenthesis in some cases. Because of that, python feels more concise, human-readable, and more efficient to write, than PHP. I like both languages, and still rely on PHP for a lot of web work, but for data science or ML I do end up enjoying my time with python.
- cess11 2y agoPHP syntax makes it relatively easy to do ad hoc code generation, for example. Right, Python has a purpose as a glue language.