User talk:Chunes: Difference between revisions
(added section about factorial in PE) |
(→"Code review" for Plain English: naming routines) |
||
Line 2: | Line 2: | ||
Hello Chunes, would you please take a look at my implementation of [[Factorial#Plain_English|factorial]]? I'm not quite happy with it, and I hope could suggest some improvements. For example, I don't like the phrase <code>To put a number's factorial into another number</code>, but don't know how else to make it work. Same with <code>Put the number's factorial into the number</code>, which seems quite an unnatural thing to say in plain English. I would like to keep the recursive approach however, just make it more "idiomatic" if there's such thing as idiomatic Plain English. Thanks for help! --[[User:Dick de Bill|Dick de Bill]] ([[User talk:Dick de Bill|talk]]) 14:48, 25 September 2020 (UTC) |
Hello Chunes, would you please take a look at my implementation of [[Factorial#Plain_English|factorial]]? I'm not quite happy with it, and I hope could suggest some improvements. For example, I don't like the phrase <code>To put a number's factorial into another number</code>, but don't know how else to make it work. Same with <code>Put the number's factorial into the number</code>, which seems quite an unnatural thing to say in plain English. I would like to keep the recursive approach however, just make it more "idiomatic" if there's such thing as idiomatic Plain English. Thanks for help! --[[User:Dick de Bill|Dick de Bill]] ([[User talk:Dick de Bill|talk]]) 14:48, 25 September 2020 (UTC) |
||
:I've been struggling a bit myself with naming routines. I think I would go one of two ways with this. The first is |
|||
:<lang plainenglish>A factorial is a number. |
|||
To find a factorial of a number: |
|||
... |
|||
\Calling the routine |
|||
Find a factorial of 5. |
|||
Write "" then the factorial on the console.</lang> |
|||
:Declaring type aliases to make routines sound more natural is commonplace in the noodle, so I think it's idiomatic. |
|||
:The second is |
|||
:<lang plainenglish>To compute the factorial of a number giving another number: |
|||
... |
|||
\Calling the routine |
|||
Compute the factorial of 5 giving a number. |
|||
Write "" then the number on the console.</lang> |
|||
:I've seen this "giving" phrasing in the noodle as well, and I think it's a fairly elegant solution as well. --[[User:Chunes|Chunes]] ([[User talk:Chunes|talk]]) 15:48, 25 September 2020 (UTC) |
Revision as of 15:50, 25 September 2020
"Code review" for Plain English
Hello Chunes, would you please take a look at my implementation of factorial? I'm not quite happy with it, and I hope could suggest some improvements. For example, I don't like the phrase To put a number's factorial into another number
, but don't know how else to make it work. Same with Put the number's factorial into the number
, which seems quite an unnatural thing to say in plain English. I would like to keep the recursive approach however, just make it more "idiomatic" if there's such thing as idiomatic Plain English. Thanks for help! --Dick de Bill (talk) 14:48, 25 September 2020 (UTC)
- I've been struggling a bit myself with naming routines. I think I would go one of two ways with this. The first is
- <lang plainenglish>A factorial is a number.
To find a factorial of a number: ...
\Calling the routine Find a factorial of 5. Write "" then the factorial on the console.</lang>
- Declaring type aliases to make routines sound more natural is commonplace in the noodle, so I think it's idiomatic.
- The second is
- <lang plainenglish>To compute the factorial of a number giving another number:
...
\Calling the routine Compute the factorial of 5 giving a number. Write "" then the number on the console.</lang>