Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #9041 > unrolled thread
| Started by | porton.victor@gmail.com |
|---|---|
| First post | 2018-07-19 16:02 -0700 |
| Last post | 2018-07-28 04:33 -0700 |
| Articles | 4 — 4 participants |
Back to article view | Back to comp.programming
Variable naming for a list of lists porton.victor@gmail.com - 2018-07-19 16:02 -0700
Re: Variable naming for a list of lists Richard Heathfield <rjh@cpax.org.uk> - 2018-07-20 14:53 +0100
Re: Variable naming for a list of lists Richard Damon <Richard@Damon-Family.org> - 2018-07-27 17:28 -0400
Re: Variable naming for a list of lists Julio Di Egidio <julio@diegidio.name> - 2018-07-28 04:33 -0700
| From | porton.victor@gmail.com |
|---|---|
| Date | 2018-07-19 16:02 -0700 |
| Subject | Variable naming for a list of lists |
| Message-ID | <175f32d6-0bde-4090-aec9-580c10ade345@googlegroups.com> |
I have a list of lists of downloaders (downloaders are function objects). I pass this list of lists as well as individual sublists and list elements between different functions. I could name the relevant fields as downloaders_list_list, downloaders_list, and downloader. But this "Microsoft-style" naming of variables accordingly their types is heavily advised against. What is recommended naming for such variables? I see nothing better than name downloaders variables containing both the list of lists and its sublists. Any better (or at least, any other) variants? What is the recommended names for such variables (local variables and class fields) accordingly the official Python naming conventions? About the usage of the list of lists: I run a download pipeline (which retrieves multiple files), which for each sublist does a number of download operations, repeating every download operation several times in a row for elements of the sublist (each of which retrieves a file in a different way, for example with different URL mappings). I repeat the entire download pipeline for every sublist of the list of lists.
[toc] | [next] | [standalone]
| From | Richard Heathfield <rjh@cpax.org.uk> |
|---|---|
| Date | 2018-07-20 14:53 +0100 |
| Message-ID | <pisphh$6hb$1@dont-email.me> |
| In reply to | #9041 |
On 20/07/18 00:02, porton.victor@gmail.com wrote: > I have a list of lists of downloaders (downloaders are function objects). > > I pass this list of lists as well as individual sublists and list elements between different functions. > > I could name the relevant fields as downloaders_list_list, downloaders_list, and downloader. But this "Microsoft-style" naming of variables accordingly their types is heavily advised against. Only when it nails the name to the language data type (because, if the language data type changes, you have a heavy edit in front of you). Your names look good to me. -- Richard Heathfield Email: rjh at cpax dot org dot uk "Usenet is a strange place" - dmr 29 July 1999 Sig line 4 vacant - apply within
[toc] | [prev] | [next] | [standalone]
| From | Richard Damon <Richard@Damon-Family.org> |
|---|---|
| Date | 2018-07-27 17:28 -0400 |
| Message-ID | <Z7M6D.296546$p05.163946@fx28.iad> |
| In reply to | #9041 |
On 7/19/18 7:02 PM, porton.victor@gmail.com wrote: > I have a list of lists of downloaders (downloaders are function objects). > > I pass this list of lists as well as individual sublists and list elements between different functions. > > I could name the relevant fields as downloaders_list_list, downloaders_list, and downloader. But this "Microsoft-style" naming of variables accordingly their types is heavily advised against. > > What is recommended naming for such variables? I see nothing better than name downloaders variables containing both the list of lists and its sublists. Any better (or at least, any other) variants? > > What is the recommended names for such variables (local variables and class fields) accordingly the official Python naming conventions? > > About the usage of the list of lists: I run a download pipeline (which retrieves multiple files), which for each sublist does a number of download operations, repeating every download operation several times in a row for elements of the sublist (each of which retrieves a file in a different way, for example with different URL mappings). I repeat the entire download pipeline for every sublist of the list of lists. > I would say a bit more description of the problem may be helpful. You start with a downloader, which is a function object to download something. Seems fairly clear. Next you make a list of downloaders. What is the purpose of having a list? How do you chose which downloader in the list you use in a given situation? WHY you have a list may make a clearer name come out. Next you make of list of those list. Why? What makes one list of downloaders different from another and how do you chose which list to use? Think of the problem, not the implementation.
[toc] | [prev] | [next] | [standalone]
| From | Julio Di Egidio <julio@diegidio.name> |
|---|---|
| Date | 2018-07-28 04:33 -0700 |
| Message-ID | <acae452f-8a10-4727-bab4-7d1d20052ca1@googlegroups.com> |
| In reply to | #9041 |
On Friday, 20 July 2018 01:02:19 UTC+2, porton...@gmail.com wrote: > I could name the relevant fields as downloaders_list_list, downloaders_list, > and downloader. I might go with downloaderTable, downloaderList, and downloader. Just descriptive names anyway, YMMV. > But this "Microsoft-style" naming of variables accordingly their types is > heavily advised against. That's not been a "Microsoft style" for decades now (*). The only place where mention of the variable "type" is still allowed is for references to UI controls, as in btnConfirm, txtSurname, etc. Note also that there are no conventions at all for private members. (*) "DO NOT use Hungarian notation." <https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/general-naming-conventions> HTH, Julio
[toc] | [prev] | [standalone]
Back to top | Article view | comp.programming
csiph-web