473,509 Members | 2,863 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Doc strings for a standalone app??

Does it make sense to use doc strings rather than #-comments for a
standalone Python app? If the classes aren't going to be re-used or
imported, do they need them?
Jul 18 '05 #1
4 1691
j_mckitrick wrote:
Does it make sense to use doc strings rather than #-comments for a
standalone Python app? If the classes aren't going to be re-used or
imported, do they need them?

Sure. They are more clear as to the assignment of the comment to a
particular class or function or method, for one thing. It can help when
debugging and/or testing your modules, for another thing. And, you never
know that you'll always release as a standalone, as you might change your
mind or release some of your modules for third-party usage, for a third
thing.
--

Jul 18 '05 #2
j_mckitrick wrote:
Does it make sense to use doc strings rather than #-comments for a
standalone Python app? If the classes aren't going to be re-used or
imported, do they need them?


The only thing I can think of to ask about that is "Why
would you *not* want to use doc strings?". There is
no significant overhead associated with them, so you
don't really lose. They have potential advantages, given
that the docs are available at runtime, more clearly
identifiable as documentation, etc, whereas the other
form of comments have no advantages for this kind of
thing. So why not use them?

-Peter
Jul 18 '05 #3
Calvin Spealman <ca****@ironfroggy.com> wrote in message news:<ma*************************************@pyth on.org>...
j_mckitrick wrote:
Does it make sense to use doc strings rather than #-comments for a
standalone Python app? If the classes aren't going to be re-used or
imported, do they need them?

Sure. They are more clear as to the assignment of the comment to a
particular class or function or method, for one thing. It can help when
debugging and/or testing your modules, for another thing. And, you never
know that you'll always release as a standalone, as you might change your
mind or release some of your modules for third-party usage, for a third
thing.
--


How do they help during debugging/testing?
Jul 18 '05 #4
The only perceived disadvantages that I'm aware of occur when you don't
use the -OO flag. Docstrings end up in frozen executables and .pyc
files, visible through the use of the "strings" command (which is a
problem for people who think the information is hidden from the binary
file like a comment). The binary files are also ever so slightly larger
when docstrings are used instead of comments. However, using -OO
removes docstrings in addition to applying optimizations...the frozen
executable or resulting .pyo files have no docstrings and are a bit smaller.

-Rick Ratzel

Peter Hansen wrote:
j_mckitrick wrote:
Does it make sense to use doc strings rather than #-comments for a
standalone Python app? If the classes aren't going to be re-used or
imported, do they need them?

The only thing I can think of to ask about that is "Why
would you *not* want to use doc strings?". There is
no significant overhead associated with them, so you
don't really lose. They have potential advantages, given
that the docs are available at runtime, more clearly
identifiable as documentation, etc, whereas the other
form of comments have no advantages for this kind of
thing. So why not use them?

-Peter

Jul 18 '05 #5

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

Similar topics

0
2256
by: FilexBB | last post by:
Currently I use jdom-b9 version to parase xml with the following xml message <?xml version="1.0" encoding="UTF-8" standalone="no"?> ...... with the code like this SAXBuilder builder = new...
2
5405
by: Lonnie, SRC employee | last post by:
*** post for FREE via your newsreader at post.newsfeed.com *** I can figure out how to set the standalone attribute in the <? xml version="1.0 ?> tag eg <?xml version="1.0" standalone="yes" ?> ...
9
2028
by: Dan Williams | last post by:
Hi people I'm getting a little annoyed with the way the print function always adds a space character between print statements unless there has been a new line. The manual mentions that "In some...
3
2855
by: Isaac Gouy | last post by:
1) Running a standalone script with SpiderMonkey on Linux js -f scriptfile.js scriptarg How can I get the value of scriptarg from within the JavaScript scriptfile? 2) Running a standalone...
0
309
by: tt | last post by:
My mod_python 3.1.4 installation works when Apache 2.0.54 is run in standalone mode (apache -k standalone) but refuses to operate when run as a service (apache -k restart). Logs yield the usual...
2
2339
by: JohnR | last post by:
Hi all. In my program I try to handle all obvious potential errors with structured error handling (try-catch) block. What I would like to do is have an 'overall' error handler that would...
1
1536
by: VK | last post by:
It is possibly more suitable to address this question to W3C mailing list, but I'm trying here first. Could anyone comment on <http://www.w3.org/TR/REC-xml/#sec-rmd> The first statement says:...
7
11639
by: tah | last post by:
Hey, Can someone please clarify, confirm, or set me straight on my understanding of a standalone="yes" attribute in the xml version element? I assume it means that the xml document containing it...
14
2212
by: Karch | last post by:
I need to find the fastest way in terms of storage and searching to determine if a given string contains one of a member of a list of strings. So, think of it in terms of this: I have a string such...
0
7347
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,...
0
7416
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...
1
7073
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...
0
7506
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...
0
5656
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,...
0
3218
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1571
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
779
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
443
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.