appunti3s:documentazione
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
appunti3s:documentazione [2013/09/19 20:41] – profpro | appunti3s:documentazione [2020/06/08 22:19] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== La documentazione del software ====== | ||
+ | Documentare bene gli oggetti e le funzioni create permette al programmatore di riutilizzarle più facilmente in futuro, quindi di fare un investimento per poter risparmiare tempo. | ||
+ | Se la documentazione è in lingua inglese, chiunque conosce l' | ||
+ | |||
+ | La documentazione del software può essere inserita nel software stesso, aggiungendovi degli opportuni commenti all' | ||
+ | Se il programma è costituito da più file sorgente, dovrebbe essere documentato anche ogni file, come in questo esempio. | ||
+ | < | ||
+ | /** | ||
+ | * @file main.cpp | ||
+ | * @author | ||
+ | * @version 1.3 | ||
+ | * | ||
+ | * @section LICENSE | ||
+ | * | ||
+ | * This program is free software; you can redistribute it and/or | ||
+ | * modify it under the terms of the GNU General Public License as | ||
+ | * published by the Free Software Foundation; either version 2 of | ||
+ | * the License, or (at your option) any later version. | ||
+ | | ||
+ | */ | ||
+ | </ | ||
+ | |||
+ | |||
+ | A loro volta ogni classe e ogni funzione devono essere documentate come in questi esempi: | ||
+ | < | ||
+ | /** | ||
+ | * @section DESCRIPTION | ||
+ | * | ||
+ | * The time class represents a moment of time. | ||
+ | */ | ||
+ | |||
+ | class Time { | ||
+ | |||
+ | public: | ||
+ | |||
+ | /** | ||
+ | * Constructor that sets the time to a given value. | ||
+ | * | ||
+ | * @param timemillis Number of milliseconds | ||
+ | * passed since Jan 1, 1970. | ||
+ | */ | ||
+ | Time (int timemillis); | ||
+ | | ||
+ | }; | ||
+ | </ | ||
+ | |||
+ | Esempio di documentazione di una funzione | ||
+ | |||
+ | < | ||
+ | /** | ||
+ | * <una descrizione breve, di una riga> | ||
+ | * | ||
+ | * <una descrizione piu' completa> | ||
+ | * <che puo' avere anche piu' righe> | ||
+ | * | ||
+ | * @param | ||
+ | * @param | ||
+ | * @return descrizione dell' | ||
+ | */ | ||
+ | void NomeClasse:: | ||
+ | { | ||
+ | // il codice della funzione... | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||