Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Convert/ConvertTo/ConvertFrom -> To/From?

Reply
 
Old 06-06-2006   #1 (permalink)
Alex K. Angelopoulos [MVP]


 
 

Convert/ConvertTo/ConvertFrom -> To/From?

The original spec for PS included a verb Convert. It is currently not used,
although we have ConvertFrom and ConvertTo for SecureString.

I would like to suggest that the ConvertFrom/ConvertTo verbs be discarded in
favor of the (from an Anglophonic perspective) concise, descriptive, and
intuitive words To and From. Convert may be reserved for further use. Here's
the rationale.

Convert is extremely broad and doesn't really communicate a lot about what
is happening. Convert-SecureString could be modified to take custom -To
and -From parameters, or even use a -From or -To switch, but it would be
less intuitive and would generally require cmdlets implementing a LOT of
functionality for this symmetry. Since this isn't always possible, custom
Convert-* cmdlets would often be lacking some functionality as well.

Using To and From gives us pithy, intuitive PowerShell verbs that are
already encountered regularly in .NET (the ubiquitous ToString() method, for
example). They form a logical family of their own (probably including
"Convert" if it is reserved). Cmdlets can be implemented to perform simple
conversions in one direction, and allow multiple or alternative
implementations for the other direction.

Finally, please note that it really and truly is OK to use words like this
as verbs. PowerShell uses English words, but it is its own language. In the
context of PowerShell, a verb is a verb based on role.



My System SpecsSystem Spec
Old 06-07-2006   #2 (permalink)
dreeschkind


 
 

RE: Convert/ConvertTo/ConvertFrom -> To/From?

Reminds me on a similar discussion in the old NG about some verbs that are
used in the current build:

http://www.microsoft.com/communities...bcb&sloc=en-us


I hope that the team has some time left to review all used verbs, cmdlet
names and the naming guidelines again (and change if needed) before the
release of PoSh V1.

--
greetings
dreeschkind


"Alex K. Angelopoulos [MVP]" wrote:

> The original spec for PS included a verb Convert. It is currently not used,
> although we have ConvertFrom and ConvertTo for SecureString.
>
> I would like to suggest that the ConvertFrom/ConvertTo verbs be discarded in
> favor of the (from an Anglophonic perspective) concise, descriptive, and
> intuitive words To and From. Convert may be reserved for further use. Here's
> the rationale.
>
> Convert is extremely broad and doesn't really communicate a lot about what
> is happening. Convert-SecureString could be modified to take custom -To
> and -From parameters, or even use a -From or -To switch, but it would be
> less intuitive and would generally require cmdlets implementing a LOT of
> functionality for this symmetry. Since this isn't always possible, custom
> Convert-* cmdlets would often be lacking some functionality as well.
>
> Using To and From gives us pithy, intuitive PowerShell verbs that are
> already encountered regularly in .NET (the ubiquitous ToString() method, for
> example). They form a logical family of their own (probably including
> "Convert" if it is reserved). Cmdlets can be implemented to perform simple
> conversions in one direction, and allow multiple or alternative
> implementations for the other direction.
>
> Finally, please note that it really and truly is OK to use words like this
> as verbs. PowerShell uses English words, but it is its own language. In the
> context of PowerShell, a verb is a verb based on role.
>
>
>

My System SpecsSystem Spec
Old 06-09-2006   #3 (permalink)
Alex K. Angelopoulos [MVP]


 
 

Re: Convert/ConvertTo/ConvertFrom -> To/From?

Interesting; it looks like there's intent to expand the role of such
cmdlets, so it does make sense to have simpler general verbs for the
conversions. I posted my suggestion in Connect:
https://connect.microsoft.com/feedba...8519&SiteID=99

"dreeschkind" <dreeschkind@discussions.microsoft.com> wrote in message
news:27FCD40F-E474-44EB-AF9B-5BDC62FC65A6@microsoft.com...
> Reminds me on a similar discussion in the old NG about some verbs that are
> used in the current build:
>
> http://www.microsoft.com/communities...bcb&sloc=en-us
>
>
> I hope that the team has some time left to review all used verbs, cmdlet
> names and the naming guidelines again (and change if needed) before the
> release of PoSh V1.
>
> --
> greetings
> dreeschkind
>
>
> "Alex K. Angelopoulos [MVP]" wrote:
>
>> The original spec for PS included a verb Convert. It is currently not
>> used,
>> although we have ConvertFrom and ConvertTo for SecureString.
>>
>> I would like to suggest that the ConvertFrom/ConvertTo verbs be discarded
>> in
>> favor of the (from an Anglophonic perspective) concise, descriptive, and
>> intuitive words To and From. Convert may be reserved for further use.
>> Here's
>> the rationale.
>>
>> Convert is extremely broad and doesn't really communicate a lot about
>> what
>> is happening. Convert-SecureString could be modified to take custom -To
>> and -From parameters, or even use a -From or -To switch, but it would be
>> less intuitive and would generally require cmdlets implementing a LOT of
>> functionality for this symmetry. Since this isn't always possible, custom
>> Convert-* cmdlets would often be lacking some functionality as well.
>>
>> Using To and From gives us pithy, intuitive PowerShell verbs that are
>> already encountered regularly in .NET (the ubiquitous ToString() method,
>> for
>> example). They form a logical family of their own (probably including
>> "Convert" if it is reserved). Cmdlets can be implemented to perform
>> simple
>> conversions in one direction, and allow multiple or alternative
>> implementations for the other direction.
>>
>> Finally, please note that it really and truly is OK to use words like
>> this
>> as verbs. PowerShell uses English words, but it is its own language. In
>> the
>> context of PowerShell, a verb is a verb based on role.
>>
>>
>>



My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
convertto-HTML PowerShell
convertto-html PowerShell
ConvertTo-Html PowerShell
RC2 - Help bug for Convertto-html PowerShell
HowTo: Use ConvertTo-SecureString and ConvertFrom-SecureString PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46