Join the forums now, and start posting to receive access to our Scripts Vault!
Quote from: Harkins on July 08, 2010, 05:09:00 PMBecause it sucks at strings and web coding is, I swear, 80% munging strings by volume.But I gave it my vote because I didn't like that my preferred choices were missing.PHP's interpreter is written in C... So, it can't be any better at processing strings seeing as how they have to go through an interpretive process and then are dealt with in C afterwards.
Because it sucks at strings and web coding is, I swear, 80% munging strings by volume.But I gave it my vote because I didn't like that my preferred choices were missing.
False, PHP adds excellent new abstractions for strings on top of C. If that were true, no language could be better than machine code.
Quote from: Harkins on July 09, 2010, 02:07:23 PMFalse, PHP adds excellent new abstractions for strings on top of C. If that were true, no language could be better than machine code.Were you speaking of something other than in terms of performance? That's how I thought you'd meant it. In that case there is nothing better than machine code. But boy is it a pain to maintain.
My point with C++ was that you got blazing performance (because it's a compiled language which removes the interpretation layer which is a limit to performance of non-compiled languages)
In principle, absolutely.In practice, that's really more a matter of who wrote the interpreter vs. who's writing the compiled code.
The interpreter is generally going to be compiled code, after all, and it's probably going to be pretty highly-optimized compiled code at that, since they're generally written and maintained by people who are damn good at what they do and have been given a lot more time and resources to spend on it than the rest of us get for most of our projects, so there are many cases where interpreted languages, despite the interpretation overhead, will perform better than custom-written compiled code doing the same thing.
So, sure, I could write my own string-handling routines in compiled C which do everything that native Perl/PHP/Python/Ruby strings do, but using native strings in Perl/PHP/Python/Ruby would probably run faster anyhow (as well as eating up a lot less development time).