self-documenting-code

PHP: Using array keys to identify function arguments [closed]

北慕城南 提交于 2019-12-14 04:24:12
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last year . I user-define many functions and a few of them have six, ten, or even more arguments. Reading my code gets difficult when I forget what the arguments of a function are, or what order they go in. I've devised a way to deal with this, replacing all the arguments with a single

using Sphinx's sphinx-apidoc utility to autogenerate documentation from python code

微笑、不失礼 提交于 2019-12-07 08:28:41
问题 I am wondering what the commenting format is in order to have self-documenting code using Sphinx's sphinx-apidoc utility. I am able to get this utility to generate a set of reStructuredText files for each python file, but these files still need to be filled in. I am looking for a way to get this utility, or some other Sphinx utility to generate documentation from the python codes docstrings. I understand this would require becoming familiar with a conventional commenting format, and I am

using Sphinx's sphinx-apidoc utility to autogenerate documentation from python code

谁都会走 提交于 2019-12-05 17:05:54
I am wondering what the commenting format is in order to have self-documenting code using Sphinx's sphinx-apidoc utility. I am able to get this utility to generate a set of reStructuredText files for each python file, but these files still need to be filled in. I am looking for a way to get this utility, or some other Sphinx utility to generate documentation from the python codes docstrings. I understand this would require becoming familiar with a conventional commenting format, and I am hoping to be pointed to this reference material. Thanks! mzjn, thanks for the comment. your second link

Do people use the Hungarian Naming Conventions in the real world? [closed]

╄→гoц情女王★ 提交于 2019-11-28 06:46:07
Is it worth learning the convention or is it a bane to readability and maintainability? Considering that most people that use Hungarian Notation is following the misunderstood version of it, I'd say it's pretty pointless. If you want to use the original definition of it, it might make more sense, but other than that it is mostly syntactic sugar. If you read the Wikipedia article on the subject, you'll find two conflicting notations, Systems Hungarian Notation and Apps Hungarian Notation . The original, good, definition is the Apps Hungarian Notation , but most people use the Systems Hungarian

In Python, how do I indicate I'm overriding a method?

情到浓时终转凉″ 提交于 2019-11-27 06:02:31
In Java, for example, the @Override annotation not only provides compile-time checking of an override but makes for excellent self-documenting code. I'm just looking for documentation (although if it's an indicator to some checker like pylint, that's a bonus). I can add a comment or docstring somewhere, but what is the idiomatic way to indicate an override in Python? UPDATE (23.05.2015): Based on this and fwc:s answer I created a pip installable package https://github.com/mkorpela/overrides From time to time I end up here looking at this question. Mainly this happens after (again) seeing the

Do people use the Hungarian Naming Conventions in the real world? [closed]

不想你离开。 提交于 2019-11-27 05:41:54
问题 Is it worth learning the convention or is it a bane to readability and maintainability? 回答1: Considering that most people that use Hungarian Notation is following the misunderstood version of it, I'd say it's pretty pointless. If you want to use the original definition of it, it might make more sense, but other than that it is mostly syntactic sugar. If you read the Wikipedia article on the subject, you'll find two conflicting notations, Systems Hungarian Notation and Apps Hungarian Notation

In Python, how do I indicate I'm overriding a method?

不打扰是莪最后的温柔 提交于 2019-11-26 22:15:41
问题 In Java, for example, the @Override annotation not only provides compile-time checking of an override but makes for excellent self-documenting code. I'm just looking for documentation (although if it's an indicator to some checker like pylint, that's a bonus). I can add a comment or docstring somewhere, but what is the idiomatic way to indicate an override in Python? 回答1: UPDATE (23.05.2015): Based on this and fwc:s answer I created a pip installable package https://github.com/mkorpela