4 ms·
Is using PHP bad? I've seen speed comparisons and it is slow. I feel bad so far it's the only back end language I know unless counting JavaScript but don't curr
by ge96 9y ago
Is using PHP bad? I've seen speed comparisons and it is slow. I feel bad so far it's the only back end language I know unless counting JavaScript but don't currently use Node in development.
I just keep seeing it being labeled bad a lot. I guess it depends if you can avoid it right? The current company that I work for (contract hourly) is a LEMP stack built on WordPress. Ideally I could strip WordPress out and get to the core purpose of the web application but it's not at that stage yet. I like the idea of separated services
but
Edit: I saw some infographic saying PHP was too easy to use/get into and resulted in many bad coders who were using it. It's also old, whenever I'm on the manual site and see the comments dating back to 10 years haha. What about machine code running on computers.
- thisrod 9y agoAfter being forced to use PHP, I've come to respect it a lot more than when I'd only looked at it. There is nothing ground breaking in bog-standard imperative control flow, a default data structure of association lists whose keys are numbers or strings, and libraries to parse every format under the sun into that structure and generate it again. On the other hand, that combination is very efficient for the many non-web programmers who occasionally need to do something with a web server.
- ge96 9y agoKind of funny going the other approach, web to non-hardware. Working with Raspberry Pi to hookup an LCD panel and get the local IP on shared network. Man that was challenging, not the python/code but the wiring... Then just include libraries and add to cron. It's cool interfacing sensors/physical with web.
- mtberatwork 9y ago> Is using PHP bad? No, of course not. There is no perfect language that you should be using right now. Like anything in software engineering, it's all relative to what context you are using it in and who is wielding the tools in the final end. Buggy, slow and terribly written code can be done in any language.
- ge96 9y agoOh man that's a good point. One thing I'm working on fixing is code redundancy, making global functions. I start to see it/get annoyed by it like ahh, should not be doing this (when I copy/paste a whole block of code into another place)
- kowdermeister 9y agoSlow is a meaningless word without context. You'll run into performance issues with any language and the answer is sooner or later will be caching. From that point is doesn't really matter what you use for static content generation.
- ge96 9y agoThe slow thing it was a comparison of loops/sorting I think, using PHP, Python, Go... Maybe others. It would probably make sense that something "closer to the metal" would be faster. One thing I find difficult is passing onto another language functions/processes. One example use would be encryption/dectryption I used a library (defuse/php-encryption) not complaining about and I'm probably guessing here, but hearing about Go's speed, one thinght was what if I passed the data to be encr/decr into Go as a separate process. But how do you get a call back if you needed one. It's an interesting problem. I like that separate processes idea.
- aczerepinski 9y agoThe thing I disliked most about PHP is all the extra boilerplate and key strokes. In most languages, foo.bar requires 7 keystrokes. In PHP it would be $foo->bar, or 11 keystrokes. Expressing the same idea in PHP vs Ruby or Python always requires more typing.