News for hackers. Stuff that matters.
Re:So many bad takes. Learn from the Prime Video microservic... by 5Qn8mNbc2FNCiVV on Sunday May 07, 2023 @05:14PM (#35855656)
Afaik 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
Re:So many bad takes. Learn from the Prime Video microservic... by iLoveOncall on Sunday May 07, 2023 @05:37PM (#35855854)
Go have your talk [1]. But that's a pretty weak argument 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-whet...

Re:So many bad takes. Learn from the Prime Video microservic... by ThalesX on Sunday May 07, 2023 @05:57PM (#35856001)
> 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.

Re:So many bad takes. Learn from the Prime Video microservic... by resonious on Monday May 08, 2023 @02:18AM (#35858671)
When 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.
Re:So many bad takes. Learn from the Prime Video microservic... by ThalesX on Monday May 08, 2023 @03:11AM (#35858931)
There 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.

Re:So many bad takes. Learn from the Prime Video microservic... by skinkestek on Monday May 08, 2023 @12:31AM (#35858108)
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.

Re:So many bad takes. Learn from the Prime Video microservic... by lelanthran on Tuesday May 09, 2023 @01:15AM (#35870426)
> 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.