Prev: integer >= 1 == True and integer.0 == False is bad, bad, bad!!!
Next: getting the variable type
From: rantingrick on 11 Jul 2010 03:26 Another source of asininity seems to be the naming conventions of the Python language proper! True/False start with an upper case and i applaud this. However str, list, tuple, int, float --need i go on...?-- start with lowercase. Q: Well what the hell is your problem Rick. Who cares right? WRONG, I tell you what my problem is. Now i cannot "wisely" use variables like... str="this is a string" list = [1,2,3] def make_random_objs(range=10) def show_message(str) int = 12 If we would have adopted proper naming conventions from dios numero uno all this nonsense would be rectified! Str, Float, List, Range, etc, etc. You think Python 3000 was a hump to climb over just wait for Python 4000. Just thoughts.
From: Alf P. Steinbach /Usenet on 11 Jul 2010 03:34 * rantingrick, on 11.07.2010 09:26: > > Another source of asininity seems to be the naming conventions of the > Python language proper! True/False start with an upper case and i > applaud this. However str, list, tuple, int, float --need i go > on...?-- start with lowercase. > > Q: Well what the hell is your problem Rick. Who cares right? > > WRONG, I tell you what my problem is. Now i cannot "wisely" use > variables like... > > str="this is a string" > list = [1,2,3] > def make_random_objs(range=10) > def show_message(str) > int = 12 > > If we would have adopted proper naming conventions from dios numero > uno all this nonsense would be rectified! Str, Float, List, Range, > etc, etc. You think Python 3000 was a hump to climb over just wait for > Python 4000. > > Just thoughts. Just do Str = str List = list Float = float and so on in module "myBasicTypes", and import that. :-) Cheers & hth., - Alf -- blog at <url: http://alfps.wordpress.com>
From: Günther Dietrich on 11 Jul 2010 04:03 rantingrick <rantingrick(a)gmail.com> wrote: >Another source of asininity seems to be the naming conventions of the >Python language proper! True/False start with an upper case and i >applaud this. However str, list, tuple, int, float --need i go >on...?-- start with lowercase. > >Q: Well what the hell is your problem Rick. Who cares right? > >WRONG, I tell you what my problem is. Now i cannot "wisely" use >variables like... > >str="this is a string" >list = [1,2,3] >def make_random_objs(range=10) >def show_message(str) >int = 12 Someone who wants to write readable and maintainable code would (practically) never want to use variables named in this way. Why? Because these names don't tell anything about the purpose of the variables. So, it is not a disadvantage that the functions you listed above are named in this way. In the contrary, it is an advantage, as it keeps newcomers from using stupid variable names. >If we would have adopted proper naming conventions from dios numero >uno all this nonsense would be rectified! Str, Float, List, Range, >etc, etc. You think Python 3000 was a hump to climb over just wait for >Python 4000. Additionally to what I mention above, there is PEP 0008. Read it, you can learn from it. What you listed above, are functions, and their names comply completely with PEP 0008. Regards, Günther PS: Even though I suspect that you are simply an agitator rsp. troll (based on what you posted in this group so far), and normally I refuse to feed trolls, I make an exception in this case, so newcomers ar not mislead by your half-baked ideas.
From: rantingrick on 11 Jul 2010 04:30 On Jul 11, 3:03 am, "Günther Dietrich" <gd.use...(a)spamfence.net> wrote: > So, it is not a disadvantage that the functions you listed above are > named in this way. In the contrary, it is an advantage, as it keeps > newcomers from using stupid variable names. "int" for an Integer is stupid? "list" for a List is stupid? "str" for a String is stupid? What am i missing?
From: Andre Alexander Bell on 11 Jul 2010 04:49 On 07/11/2010 10:30 AM, rantingrick wrote: > On Jul 11, 3:03 am, "G�nther Dietrich" <gd.use...(a)spamfence.net> > wrote: > >> So, it is not a disadvantage that the functions you listed above are >> named in this way. In the contrary, it is an advantage, as it keeps >> newcomers from using stupid variable names. > > "int" for an Integer is stupid? > "list" for a List is stupid? > "str" for a String is stupid? > > What am i missing? You are missing (from PEP 8): --- 8< --- 8< --- Class Names Almost without exception, class names use the CapWords convention. Classes for internal use have a leading underscore in addition. --- 8< --- 8< --- You may want to think of list, int, str, object, ... as classes that don't follow this advice with their class name. But besides that, shouldn't a variable name reflect it's purpose instead of it's type? E.g. name = 'rantingrick' counter = 1 .... as compared to str = 'rantingrick' int = 1? Regards Andre
|
Next
|
Last
Pages: 1 2 3 4 5 Prev: integer >= 1 == True and integer.0 == False is bad, bad, bad!!! Next: getting the variable type |