code-documentation

JSDoc: Return object structure

会有一股神秘感。 提交于 2019-12-18 09:58:56
问题 How can I tell JSDoc about the structure of an object that is returned. I have found the @return {{field1: type, field2: type, ...}} description syntax and tried it: /** * Returns a coordinate from a given mouse or touch event * @param {TouchEvent|MouseEvent|jQuery.Event} e * A valid mouse or touch event or a jQuery event wrapping such an * event. * @param {string} [type="page"] * A string representing the type of location that should be * returned. Can be either "page", "client" or "screen".

What's the best way to handle/format Javadoc and annotations in code? [duplicate]

…衆ロ難τιáo~ 提交于 2019-12-10 13:44:17
问题 This question already has answers here : codestyle; put javadoc before or after annotation? (5 answers) Closed 6 years ago . I've looked across this forum, and I've googled this one, and I'm not sure what is the best way to handle Javadoc and annotations that appear together in the same class. From what I can see from Sun/Oracle's documentation, they seem to suggest (though I cannot really find an explicit statement) that Javadoc should be listed atop annotations. See their example How and

Adding sub-properties to an existing property-list in jsdoc

送分小仙女□ 提交于 2019-12-10 09:23:13
问题 I am trying to automate a particular module in our JS library and am stuck at a point where I want to define a set of properties (lets say an object that goes as construction parameter of a class). /** * This function initiates world peace! * @constructor * @param {object} defaults - The options to initiate peace. * @param {number} defaults.issues - The number of issues being taken up. * @param {string} defaults.source - The name of the location where process starts. */ var WorldPeace =

Documentation about compiler options for Swift

你离开我真会死。 提交于 2019-12-10 04:37:05
问题 Hello, i want to start running some microbenchmarks on Apples Swift-language. However i feel it is hard to find proper documentation for the different options in regards of compiler optimization. I have read a lot of questions and articles about other peoples microbenchmarks of the language, however it would be nice to have some firm documentation on the subject. In the latest beta, the ones to use seems to be: -Onone No optimizations -O Safe optimizations? -Ounchecked (Replaced -Ofast)

How to describe function arguments in dynamic typed languages?

て烟熏妆下的殇ゞ 提交于 2019-12-07 07:51:08
问题 My question is more oriented toward Python, but it may also be about JavaScript or other scripting languages. I usually develop with statically typed languages (Java, C++, ActionScript, ...). I like to use from time to time Python, and I also need to sometimes use JavaScript. These are dynamic typed languages. Nothing wrong with that, but I usually have lots of headaches to understand which parameters are needed in a function or in a method. It happens even if it is my own code with some

Python Interpreter Mode - What are some ways to explore Python's modules and its usage

柔情痞子 提交于 2019-12-06 03:54:15
While inside the Python Interpreter: What are some ways to learn about the packages I have? >>> man sys File "<stdin>", line 1 man sys ^ SyntaxError: invalid syntax >>> sys --help Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: bad operand type for unary -: '_Helper' Corrected: >>> help(sys) ... Now, how do I see all the packages available to me on my sys.path? And see their subsequent usage and documentation. I know that I can easily download a PDF but all this stuff is already baked in, I'd like to not duplicate files. Thanks! You can look at help("modules")

Adding sub-properties to an existing property-list in jsdoc

邮差的信 提交于 2019-12-05 14:54:47
I am trying to automate a particular module in our JS library and am stuck at a point where I want to define a set of properties (lets say an object that goes as construction parameter of a class). /** * This function initiates world peace! * @constructor * @param {object} defaults - The options to initiate peace. * @param {number} defaults.issues - The number of issues being taken up. * @param {string} defaults.source - The name of the location where process starts. */ var WorldPeace = function (defaults) { // code here }; It is well and good had all properties of the construction was defined

How to describe function arguments in dynamic typed languages?

五迷三道 提交于 2019-12-05 13:15:14
My question is more oriented toward Python, but it may also be about JavaScript or other scripting languages. I usually develop with statically typed languages (Java, C++, ActionScript, ...). I like to use from time to time Python, and I also need to sometimes use JavaScript. These are dynamic typed languages. Nothing wrong with that, but I usually have lots of headaches to understand which parameters are needed in a function or in a method. It happens even if it is my own code with some docstrings! Maybe because the eye has to look somewhere else than in the definition of the function. Of

Documenting Node.js projects [closed]

和自甴很熟 提交于 2019-12-04 07:27:26
问题 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'm currently using JSDoc Toolkit to document my code, but it doesn't quite fit - namely, it seem to struggle with describing namespaces properly. Say you have two simple classes in each their files: lib/database/foo.js : /** @class */ function Foo(...) {...} /** @function ...

Code documentation: How much is too much?

百般思念 提交于 2019-12-03 19:31:13
问题 How much code documentation in your .NET source is too much? Some background: I inherited a large codebase that I've talked about in some of the other questions I've posted here on SO. One of the "features" of this codebase is a God Class, a single static class with >3000 lines of code encompassing several dozen static methods. It's everything from Utilities.CalculateFYBasedOnMonth() to Utilities.GetSharePointUserInfo() to Utilities.IsUserIE6() . It's all good code that doesn't need to be