473,791 Members | 2,827 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

poll: does name conventions in python matters?

in python it is common to see naming
inconsistencies ,methods,module s,packages,clas ses with names in every
posible style:
thisisalongmeth od
ThisIsALongMeth od
thisIsALongMeth od
this_is_a_long_ method
and even This_Is_A_Long_ Method
All over the place,even within one module!

classic static languages dont really need naming conventions, on the other
side dynamic languages must have it(in my opinion),since there is a lot of
syntax variability and very short constructors, a clear example is what
does this means?
c = Required(2)
is it a method which returns an object or is it a class constructor?
this kind of situation greatly decrease readability.

whats your opinion on the matter?

a) dont care about naming conventions, i use the one i like
b) didnt know python has naming conventions,nob ody follows them
c) naming convention doesnt matters
d) i would use one if there was a clear and concise document about python
naming style(python style guide is vague)
e) i think is very important for readability of source code and easier to
use libraries
d) other, explain please

if you care about it,how could be fixed?

if clear conventions were defined,would you change your current naming
style?

stdlib modules are not going to be touched,but for any new proyect i think
python would benefit from an improved,well defined,strict style guide,the
one now(http://www.python.org/doc/essays/styleguide.html) is so vague that
is not helpfull at all.

Ruby for example have a clear naming convention,if python had one,it would
benefit greater than ruby,since python source code is much more readable as
it is,but it could be better.
Jul 19 '05 #1
4 1397
vegetax wrote:
in python it is common to see naming
inconsistencies ,methods,module s,packages,clas ses with names in every
posible style:
thisisalongmeth od
ThisIsALongMeth od
thisIsALongMeth od
this_is_a_long_ method
and even This_Is_A_Long_ Method
All over the place,even within one module!

classic static languages dont really need naming conventions, on the other
side dynamic languages must have it(in my opinion),since there is a lot of
syntax variability and very short constructors, a clear example is what
does this means?
c = Required(2)
is it a method which returns an object or is it a class constructor?
this kind of situation greatly decrease readability.

whats your opinion on the matter?


If you really worry about it, why don't you capitalise your English? :-)

David
Jul 19 '05 #2
vegetax wrote:
in python it is common to see naming
inconsistencies ,methods,module s,packages,clas ses with names in every
posible style:
thisisalongmeth od
ThisIsALongMeth od
thisIsALongMeth od
this_is_a_long_ method
and even This_Is_A_Long_ Method
All over the place,even within one module!


You certainly won't find most of those in a single
module, at least not in the standard library. You
might find a couple. Check out the PEP(s) on the
topic, and just follow the conventions of whatever
code you are working with.

If you are working with new code and need to choose
something from scratch, go with your personal preference
and be consistent.

If all the above fail, use "names_like_thi s" or
"namesLikeThis" . If you really need somebody else
to tell you what to use: use the latter, because
I told you to. ;-)

-Peter
Jul 19 '05 #3
Peter Hansen wrote:
vegetax wrote:
in python it is common to see naming
inconsistencies ,methods,module s,packages,clas ses with names in every
posible style:
thisisalongmeth od
ThisIsALongMeth od
thisIsALongMeth od
this_is_a_long_ method
and even This_Is_A_Long_ Method
All over the place,even within one module!
You certainly won't find most of those in a single
module, at least not in the standard library. You
might find a couple.


there are some of those inconsistent cases in the stdlib,check the sys
module which mixes a_method with amethod all over the place.

If you are working with new code and need to choose
something from scratch, go with your personal preference
and be consistent.

If all the above fail, use "names_like_thi s" or
"namesLikeThis" . If you really need somebody else
to tell you what to use: use the latter, because
I told you to. ;-)

-Peter


Yes sir! =)
I actually follow the scheme you mentioned,the problem lies when you are
using several of this libs in a module and you have to mix all kind of
naming conventions (including yours) which makes the code less readable.

Jul 19 '05 #4
Peter Hansen wrote:
If all the above fail, use "names_like_thi s" or
"namesLikeThis" . If you really need somebody else
to tell you what to use: use the latter, because
I told you to. ;-)


No, no. Use the former, because *I* told you to. ;-)
--
Michael Hoffman
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

44
3425
by: Carl | last post by:
"Nine Language Performance Round-up: Benchmarking Math & File I/O" http://www.osnews.com/story.php?news_id=5602 I think this is an unfair comparison! I wouldn't dream of developing a numerical application in Python without using prebuilt numerical libraries and data objects such as dictionaries and lists. I have been experimenting with numerical algorithms in Python with a heavy use of the Numeric module. My experience is that Python...
17
1993
by: Doug Holton | last post by:
George W Bush, as certified by Florida's election commission. Which decorator syntax do you like the most? See http://wiki.wxpython.org/index.cgi/PythonDecoratorsPoll A. @classmethod def foo(): (82) 14% C1. def foo() : (235) 41% E1. def foo(): @classmethod (260) 45% Total Votes: 577
28
2399
by: Paul McGuire | last post by:
Well, after 3 days of open polling, the number of additional votes have dropped off pretty dramatically. Here are the results so far: Total voters: 55 (with 3 votes each) Votes for each choice or group of choices: Any J 81 J2 78 Any C 40 C1 29 Any D 9
9
4179
by: Lad | last post by:
Is there a poll script available in Python?
0
1318
by: Ivan Simurina | last post by:
Hello!!!, i really need help with something and i will appreciate your help alot! I plan to develop a quiz/poll project in C# that would contain these segments: User Related Matters: Register new user. (Sign up) Maintain user (Editing/Updating any information that user gave on signup) Administrative Related Matters: Creating & Maintaing User Roles. Assinging/Editing User Roles.
1
2582
by: Magnus Lycka | last post by:
I'm trying to read standard out in a process started with popen2 in a non-blocking way. (Other good ways of doing this than the one I tried are appreciated.) I've tried to dumb down my code to see what happens, and socket.poll seems to behave very strangely. I've tried to use the .poll method for the poll object with and without a timeout, but in either case, the output randomly switches between on of the versions below. It runs fast,...
2
3068
by: inhahe | last post by:
select.poll isn't supported on Windows, because Windows doesn't have such a feature, or at least it didn't until Vista. Vista implements the same thing but called WSAPoll, an article is here http://blogs.msdn.com/wndp/archive/2006/10/26/WSAPoll.aspx I hope that the next edition of Python supports select.poll on Vista, or at least that someone writes a third-party module fo it. As much as I'd love to do it myself, it's probably beyond...
162
10303
by: Sh4wn | last post by:
Hi, first, python is one of my fav languages, and i'll definitely keep developing with it. But, there's 1 one thing what I -really- miss: data hiding. I know member vars are private when you prefix them with 2 underscores, but I hate prefixing my vars, I'd rather add a keyword before it. Python advertises himself as a full OOP language, but why does it miss one of the basic principles of OOP? Will it ever be added to python?
9
4612
by: shapper | last post by:
Hello, I am displaying a poll using CSS and lists: http://www.27lamps.com/Beta/Poll/Poll.html At the moment I have two problems: 1. I am not able to set a padding between each Bar and the border which I am using background-image to define it.
0
10426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10154
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3713
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.