5 ms·
> there is a good reason people shy away from PHP Please share it. And don't rely on articles that are more than a decade and 3 or 4 versions of PHP old.
by iLoveOncall 4y ago
> there is a good reason people shy away from PHP
Please share it. And don't rely on articles that are more than a decade and 3 or 4 versions of PHP old.
- 5Qn8mNbc2FNCiVV 4y agoAfaik you cannot discern null and undefined. So, not there and "null"? Either that or I'm going to have to have a good talk with my colleague
- iLoveOncall 4y agoGo have your talk [1]. But that's a pretty weak argument anyway given that: 1. Other languages also do not have this distinction (Python for example AFAIK), 2. It's relatively useless. I get the value of it in JavaScript which has a lot of asynchronous code and frontend where the behavior may indeed be very different between null and undefined, but in a server-side application I don't think the nuance is necessary at runtime, and potential programming mistakes involving that can be caught by a linter. [1] https://stackoverflow.com/questions/6905491/how-to-tell-whether-a-variable-is-null-or-undefined-in-php https://stackoverflow.com/questions/6905491/how-to-tell-whet...
- ThalesX 4y ago> Afaik you cannot discern null and undefined. This is a discussion for us tech folks. When it comes to business. Customers don't give a rat's ass about this as long as the product provides them with value. If you're flooded with customers and the tech stack is a pain in the ass, perhaps it would be a good time to start considering this, but until you have this problem, the technical aspects are just wasting investor money and / or engineering time.
- resonious 4y agoWhen I (an average developer) accidentally check for null but not undefined in the code and it causes a bug, the customer might care a lot.
- ThalesX 4y agoThere is always a balance to strike between development and delivery. When creating a system with high potential failure costs, it's important to select a technology stack that minimizes common errors for developers. For most companies, issues like `undefined | null` bugs can be resolved with just a few code adjustments, resulting in only minor inconvenience for customers. As long as problems are addressed and the product provides value, customers will continue to support it. There are CEOs and CTOs that feel differently. I wish them luck.
- skinkestek 4y agohttps://stackoverflow.com/questions/6905491/how-to-tell-whether-a-variable-is-null-or-undefined-in-php https://stackoverflow.com/questions/6905491/how-to-tell-whet... At the language level PHP has about the same problems as JS. Thankfully it looks uglier so people get an early warning before using it for everything.
- lelanthran 3y ago> Afaik you cannot discern null and undefined. So, not there and "null"? So? Don't similar footguns appear in Python and JS? Why single out PHP for footguns when the other languages are no better? While I'm not a PHP programmer, I have used most programming languages, and PHP doesn't seem any worse than the competitors.
- proxyon 4y agoHow about the fact that most of us are experienced and can attest that PHP is the worst language we've ever used in our careers?
- aarondf 4y agoGenuine question, when was the last time you wrote PHP?
- proxyon 4y ago5 years ago and I wish I hadn't.
- chalcolithic 4y agoIt was fine in the late 90s. Very adequate for the hosting landscape. I have not touched it since that time
- jcparkyn 4y agoSpoken like someone who's never used Matlab :)
- itake 4y ago> indexes start at 1 - no one -- Matlab
- MiyamotoAkira 4y agoPascal had indexes starting at 1 too. Starting indexes at 0 makes sense when you want to enable the developer to manipulate memory (for example, C) Indexes starting at 1 matches with a more natural ordinal sequencing.
- haspok 4y ago> indexes starting at... "I don't understand the word 'index'". - a functional programmer
- makeitdouble 4y agoIMHO this very discussion factors in whether you'll want a PHP stack or not. If you're looking for pragmatic devs that don't care much about the trends, the community or peers' general opinion about a technology, going with PHP will get you this type in spades. Especially if you're looking for experienced engineers. If you want devs that care about thoughtful designs, elegant solutions and want to enjoy the community, it will be a lot more difficult (not impossible, but it's an uphill battle) And this has little to do with PHP's viability per se, there's just so much baggage that most devs will self select in one side or another. A language's base design philosophy matters, and it's always better to chose a stack that matches your own philosophy.