Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider changing the term "empty null" to "enumerable null" or "null enumerable" #11175

Closed
mklement0 opened this issue Jun 10, 2024 · 2 comments · Fixed by #11177
Closed

Consider changing the term "empty null" to "enumerable null" or "null enumerable" #11175

mklement0 opened this issue Jun 10, 2024 · 2 comments · Fixed by #11177
Labels
area-conceptual Area - Conceptual articles issue-doc-bug Issue - error in documentation

Comments

@mklement0
Copy link
Contributor

mklement0 commented Jun 10, 2024

Type of issue

Other (describe below)

Feedback

Suggested terminology change:

  • [System.Management.Automation.Internal.AutomationNull]::Value behaves like an enumerable in enumeration contexts.
  • In expression contexts, it behaves like $null

Arguably, either value is "empty", so using "empty null" to describe the former doesn't serve to distinguish these values.

I therefore suggest calling [System.Management.Automation.Internal.AutomationNull]::Value the enumerable null or null enumerable (see discussion below).

See also:

Page URL

https://learn.microsoft.com/en-us/powershell/scripting/learn/deep-dives/everything-about-null?view=powershell-7.4#empty-null

Content source URL

https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/docs-conceptual/learn/deep-dives/everything-about-null.md

Author

@sdwheeler

Document Id

53e31d8c-92e1-d484-f9d4-b79ded54c1d1

@iSazonov
Copy link
Contributor

I therefore suggest calling [System.Management.Automation.Internal.AutomationNull]::Value the enumerable null.

It can still confuse. Maybe replace null with AutomationNull as doc term.

@mklement0
Copy link
Contributor Author

@iSazonov:

It is hard to come up with a descriptive yet pithy term.
The essence of [System.Management.Automation.Internal.AutomationNull]::Value is: it is a $null that is also an enumerable; if it is enumerated, it enumerates nothing.

An alternative would be "null enumerable".

The only reason to pick "AutomationNull" would be to align with the underlying type name, which in itself isn't descriptive either.

At the end of the day, "AutomationNull" is preferable to "empty null", but given the pending change to create a fully public type - see PowerShell/PowerShell#13465 (comment) - this could be an opportunity to rename the type too; e.g., the implementation could be, based on PowerShell/PowerShell#9997 (comment):

namespace System.Management.Automation
{
    // New, fully public class
    public sealed class NullEnumerable : PSObject
    {
        private NullEnumerable()
        {
        }

        public static NullEnumerable Value { get; } = new NullEnumerable();
    }
}

namespace System.Management.Automation.Internal
{
    // Original, "pubternal" class
    [Obsolete("Use System.Management.Automation.AutomationNull")]
    public static class AutomationNull
    {
        public static PSObject Value => System.Management.Automation.NullEnumerable.Value;
    }
}

@mklement0 mklement0 changed the title Consider changing the term "empty null" to "enumerable null" Consider changing the term "empty null" to "enumerable null" or "null enumerable" Jun 11, 2024
@michaeltlombardi michaeltlombardi added area-conceptual Area - Conceptual articles issue-doc-bug Issue - error in documentation and removed needs-triage Waiting - Needs triage labels Jun 11, 2024
michaeltlombardi added a commit to michaeltlombardi/PowerShell-Docs that referenced this issue Jun 11, 2024
Prior to this change, the article 'Everything you wanted to know about `$null`'
used the term 'empty `$null`' to describe
`[System.Management.Automation.Internal.AutomationNull]::Value`

However, this terminology isn't clear enough, as both that value and the `$null`
value itself can be considered to be 'empty.'

This change:

- Updates to use the terminology 'enumerable null' instead of 'empty `$null`'
  to describe the value.
- Resolves MicrosoftDocs#11175
- Fixes AB#260888
michaeltlombardi added a commit that referenced this issue Jun 11, 2024
Prior to this change, the article 'Everything you wanted to know about `$null`'
used the term 'empty `$null`' to describe
`[System.Management.Automation.Internal.AutomationNull]::Value`

However, this terminology isn't clear enough, as both that value and the `$null`
value itself can be considered to be 'empty.'

This change:

- Updates to use the terminology 'enumerable null' instead of 'empty `$null`'
  to describe the value.
- Resolves #11175
- Fixes AB#260888
@Taojunshen Taojunshen mentioned this issue Jun 11, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-conceptual Area - Conceptual articles issue-doc-bug Issue - error in documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants