DEV Community

Discussion on: Why is your preferred programming language your go-to?

Collapse
 
buphmin profile image
buphmin

I mostly use PHP and JS as those were the two languages I learned first. I can see how PHP and JS can be abused to write bad code, but so can any language. I recently used Go for a project where I needed plenty of threads and that was awesome, I love how simple Go is. PHP and JS are easy to use and as far as I know the two fastest scripting language (though JS cheats as it is all JIT now). JS has the benefit of being useful everywhere now and a must know for frontend web dev.

I have considered learning python, but I keep thinking there is nothing I can do in python that I can't do in PHP/JS and PHP/JS both run significantly faster in most cases than vanilla python (excluding pypy and cython). JS because it is JIT compiled, and PHP because of heavy caching plus a ton of built in C extensions which are of course very fast.

Collapse
 
david_j_eddy profile image
David J Eddy

Additionally: PHP is a beast of a web language. With the upcoming 7.3 release being 200% faster than the 5.6 release performance is only getting better.

Collapse
 
nicolus profile image
Nicolas Bailly • Edited

It is one of the fastest scripting languages, and it will become even faster when JIT is implemented (like an order of magnitude faster). That won't make a difference in web apps because computing is never the bottleneck (it's usually I/O bound : loading 1000s of classes from your favorite framework and querying an API or SQL server that's not even on the same machine comes at a cost), but it could make PHP usable for domains in which nobody would consider using PHP/Python/Ruby today, like heavy scientific computations, image processing, 3d rendering or IA.

Preloading (coming in 7.4) on the other hand could help quite a bit on the I/O side.

Collapse
 
filips profile image
Filip Š

Main problem with PHP is that it was not so good in the past (before PHP 7 and PHP 5). It was slow and it had some weird functionalities. But with release of PHP 7 (and PHP 8), PSR standards and frameworks like Laravel and Symphony, it has improved a lot. It's very fast and with JIT coming in PHP 8 will be even faster.

Other big problem is that is is very easy for beginners. And beginners obviously don't write so good code. This is also reason why many people think that (all) code in PHP is bad.