Google to make Dart language a null-free zone

Retro

Founder
Staff member
Joined
4 Jun 2021
Messages
2,403 (3.91/day)
Here's one for NerdZone's budding programmers.

I found the null data type very useful for things like error trapping and bounds checking when I did programming, so it seems strange to remove it. However, it seems to have caused more trouble than it was worth according to this Register article, which goes into detail.

How do you feel about null in your programming language of choice and its removal in Dart?

When the third major release of the Dart programming language debuts in mid-2023, null values will no longer be allowed where they're not expected.

Null in this context is an assignment value indicating the absence of a value or referenced object. Null references date back to around 1964 when British computer scientist Tony Hoare introduced the concept in the ALGOL family of languages. He considered them his "billion dollar mistake" for the amount of time and money they've cost in error repairs – an issue to this day.

 

Uncrowned

Active member
Joined
28 Nov 2022
Messages
32 (0.45/day)
I can see the push to reduce errors as AI and autopilot cars become normal for coders. Although it will be curious to see how well it handles major systems as such as I don't really believe many codes added nulls as a goal to achieve vs a way to handle issues.
 

Arantor

Well-known member
Staff member
Joined
24 May 2022
Messages
891 (3.44/day)
Hmm. I've had this window open now for a few days but honestly... my reaction isn't that major.

Nulls are one of those things that you sort of need as a logical concept, in the same way that the Romans were surprisingly held back by the lack of a zero - the absence of a thing is a concept in itself you need to deal with. There is a huge difference between 'something you don't know' and 'something you know that is nothing', and there will always be a need for an indeterminate state where something has failed in an otherwise unexpected way because the world doesn't exist in a vacuum.

And really, when you boil this down, this isn't stripping out null from the language. This is applying more safety rails to when null can be used so that it can only be used in specialised situations, but honestly... this is something everyone else was already doing with static analysis tools if they cared - it's no great stretch to prove the functional state of a function from its inputs and outputs if you know the possible states of other parts of the system.

This to me, in all honesty, feels like Google trying to go 'look at me, I'm relevant' because Dart, honestly, never was the JavaScript killer Google wanted it to be because no-one else was interested in supporting it much.
 
Top Bottom