Python or PHP?
I've been a web developer for a long time but I'm still stuck with this one big question. I really love PHP, esp. its fast overall development and deployment cycle. But people I meet have been arguing with me to switch to Python, which I'm yet unsure of. I remember having seen somewhere that Python is even less efficient performance wise. So why should I (if at all) move to Python?
9 comments
[ 4.6 ms ] story [ 32.2 ms ] threadFrom the "≈ CPU Load" we can see that:
- regex-dna - the Python program was written for multi-core the PHP program wasn't
- spectral-norm - the Python program was written for multi-core the PHP program wasn't
- k-nucleotide - the Python program was written for multi-core the PHP program wasn't
- mandelbrot - the Python program was written for multi-core the PHP program wasn't
- binary-trees - the Python program was written for multi-core the PHP program wasn't
So it would be better to compare the programs forced onto one core, and that shows the PHP programs compare well to the Python programs -
http://shootout.alioth.debian.org/u64/benchmark.php?test=all...
How is that fair? Python has true multi process capabilities where PHP does not. You can run Django and other web frameworks in multi process modes that would spread load out better utilizing system resources. This isn't true of PHP, from what limited knowledge I have.
While they're comparable under a single process, PHP does not scale nearly as well as Python does.
What's not fair, is that I seem to have forgotten to investigate why pcntl_fork() stopped working.
> PHP does not scale nearly as well as Python does
Please share your measurements.
PHP and Python both have "true multi process capabilities". It's called forking. I think you are confusing forking with threading.
It never hurts to have more than one language in your quiver. If you're looking for work and are having a hard time finding a PHP gig that suits your fancy, having some other language dialed to the point you can code in it professionally increases your odds of finding (and keeping) a job.
Of course, I make a good living coding PHP for high end websites, and have been for years now. I just don't talk a whole lot about the language that pays the bills since invariably mentioning PHP is your primary language leads to a torrent of hot air from other developers who use "cooler" languages. Personally, I think it's all bullshit and if folks want to play "cool kid" with their language of choice, that's fine, but don't expect me to play along.
Fun fact: the highest paid programmer I've met to date coded exclusively in COBOL. Think monster 1099 rates consulting on legacy mainframe code overhauls.
A lot of programmers really enjoy that additional structure and I have to admit that when it comes to reading someone else's source, Python typically makes for a more enjoyable experience than Perl.
At the end of the day it's up to you to decide if Python has any value for you, and the only way you're going to find that out is to take it for a test drive.