News for hackers. Stuff that matters.
Re:Cold Showers by kevinmchugh on Saturday June 18, 2022 @07:06PM (#31794624)
I can't speak for all Ruby developers but I found that I could read a pull request from just about anyone I worked with a and find a spot where they hadn't covered a possible nil with a test. And yes, we had coverage checks.

A type system can keep you from having to write those tests.

Re:Cold Showers by siwatanejo on Saturday June 18, 2022 @08:38PM (#31795107)
> A type system can keep you from having to write those tests.

Because with a proper static lang (hint: not Java, not C#), nil doesn't exist? Right.

Re:Cold Showers by ebingdom on Saturday June 18, 2022 @10:11PM (#31795514)
Those languages don't have null safety, but plenty of languages do. Rust, Kotlin, Swift, Haskell, etc.

The claim is true: a type system _can_ prevent null-related issues and eliminate the need to account for them in tests. That's not the same as saying every type system does.

Re:Cold Showers by campl3r on Saturday June 18, 2022 @10:51PM (#31795699)
Doesn't C# support this by enabling Nullable?
Re:Cold Showers by creakingstairs on Saturday June 18, 2022 @09:48PM (#31795412)
They all have nulls but a static lang will warn you that the value can be null.
Re:Cold Showers by tene on Saturday June 18, 2022 @10:35PM (#31795621)
This is false. There are plenty of languages without pervasive implicit nullability. Check out Haskell and Rust and Ocaml.
Re:Cold Showers by creakingstairs on Saturday June 18, 2022 @11:53PM (#31796015)
You are right. I should have said some. The point I wanted to make was that having type safety is better for checking null than having no type at all.
Re:Cold Showers by shepherdjerred on Sunday June 19, 2022 @01:21AM (#31796362)
It can if you choose to return Optionals instead of nulls.