Programování Začátečník ChatGPT

Code dokumentace s JSDoc/docstrings

Vytvoření comprehensive dokumentace pro funkce a třídy.

Prompt text

Délka: Střední
Dokumentuj tento kód:

**Kód:**
```[JAZYK]
[KÓD BEZ DOKUMENTACE]
```

**Documentation Style:**
- JavaScript/TypeScript: JSDoc
- Python: Google/NumPy docstrings
- Java: Javadoc
- PHP: PHPDoc

**Include:**
1. **Function/Class description**
- What it does
- When to use it

2. **Parameters:**
- @param name - type - description
- Default values
- Optional vs required

3. **Returns:**
- @returns type - description
- Possible return values

4. **Examples:**
- @example with code
- Common use cases

5. **Throws/Exceptions:**
- @throws ErrorType - when

6. **Additional:**
- @deprecated if relevant
- @see for related functions
- @since version

Jazyk: [JAZYK]. Style guide: [GUIDE].
Interaktivní tvůrce

Příklad použití

Vstup:

Dokumentuj TypeScript funkci calculateShipping(weight, distance, express). Jazyk: TypeScript. Style: JSDoc with @example.

Výstup:

/**
* Calculates shipping cost based on package weight, delivery distance, and shipping speed.
* Uses tiered pricing: standard vs express delivery. Includes fuel surcharge for long distances.
*
* @param weight - Package weight in kilograms (must be positive)
* @param distance - Delivery distance in kilometers (must be positive)
* @param express - Whether to use express shipping (default: false)
* @returns The calculated shipping cost in USD
* @throws {ValidationError} If weight or distance is negative or zero
*
* @example
* // Standard shipping for 5kg package, 100km
* calculateShipping(5, 100) // returns 15.50
*
* @example
* // Express shipping
* calculateShipping(5, 100, true) // returns 28.50
*
* @see {@link getDeliveryTime} for estimated delivery times
* @since 2.0.0
*/

Kde použít tento prompt?

Najděte vhodné AI nástroje pro použití tohoto promptu a maximalizujte jeho efektivitu.

Objevte další AI prompty

Prozkoumejte naši sbírku Programování promptů a najděte ty, které vám pomohou dosáhnout lepších výsledků.