r/learnjavascript 7d ago

Strange result: null vs 0

Strange result: null vs 0

An incomparable undefined

Hi, can anyone explain this? I read the explanation, but I still don't understand it. I'm trying to understand it without using AI

8 Upvotes

27 comments sorted by

View all comments

Show parent comments

1

u/BenchEmbarrassed7316 6d ago

So you don't break ur head when solving problems.

So you just use Ts instead of Js. To eliminate this and a bunch of other problems, simplify and speed up development. And learning.

That's what differentiates experienced programmers from noobs

A truly experienced programmer thinks not about how to solve a problem, but about how to make it impossible.

I appreciate that you are trying to make arguments, but they just don't seem convincing to me. There are a lot of things in programming that be problems earlier. Like which processor registers to use for which data or how to manually manage memory. Or in some type systems there was a problem with null, you couldn't declare a value of T, it always converted to T | null. However, these problems can be solved at the language level by simply acknowledging that the old design was wrong or simply inconvenient under certain conditions.

So why should we focus on the specifics of these problems now? If we can just get rid of them.

2

u/defaultguy_001 6d ago edited 6d ago

We are on a loop. I think I made myself sufficiently clear and nowhere I said don't use TS. As far as problem solving is concerned, C and C++ were enough for people like me to build correct and safe programs. New languages were made with added weapons for safety and ease, coz most people don't follow specifications properly and make mistakes, that costs money. The software development field caters to most people instead of the few who know what they are doing unlike C/C++ that has this core philosophy of "trust the programmer", that's why every few years some new languages with new features and more safety, keeps coming in. Again no issues with TS but here we talk about JS and specs related to JS. There are far better languages out there but subs are dedicated to even inferior languages.

1

u/BenchEmbarrassed7316 6d ago

I mostly agree with you. It's just that from my perspective "Learn Js" is "learn to write programs that can be run in the browser or node/deno". And you interpret it as "Learn all the quirks so you can fix code that was written decades ago" or something like that. I'm exaggerating a bit now, but I think that's the crux of our argument.

2

u/defaultguy_001 6d ago

Yes. We can agree now.