Documentatie (PHPDoc)
Als je een applicatie ontwikkeld, in welke taal schrijf je dan de documentatie? Ik ben nu bezig met het ontwikkelen van een applicatie en doe nu alle documentatie in het Engels, maar soms is dit best lastig om overal dezelfde zinnen aan te houden en om ook nog eens goede zinnen te maken. Daarom twijfel ik erover in welke taal ik de documentatie zou doen.
Ik verwacht de komende paar jaren niet samen te werken met 'buitenlandse' programmeurs, eigenlijk nooit.
Het zou erg fijn zijn als je hier een stukje documentatie kan laten zien hoe jij het aanpakt.
Ik verwacht de komende paar jaren niet samen te werken met 'buitenlandse' programmeurs, eigenlijk nooit.
Het zou erg fijn zijn als je hier een stukje documentatie kan laten zien hoe jij het aanpakt.
Documenteren in de taal die het meest voor de hand ligt en zoals je zelf al zegt niet te verwachten met buitenlandse programmeurs te moeten werken (geen outsourcing naar India... ;-) gewoon in het nederlands doen (maar niet in msn taal....). Gewoon documenteren in de scripts/code. Is het makkelijkst bij te houden bij mutaties. Eventueel in kop refereren/verwijzen naar hoofdstukken in het voorliggende ontwerp (functioneel ontwerp/technisch ontwerp e.d.)
Gewijzigd op 12/10/2011 19:56:42 door Aad B
Bedankt voor de info, dan ga ik toch maar Nederlandstalige documentatie aanhouden in mijn code.
Documenteren van code doe ik altijd in het engels. Dat is toch wel de 'voertaal' in de software ontwikkeling wereld. Naast outsourcing of samenwerken met buitenlandse partijen biedt het ook voordelen als je bijvoorbeeld een stukje code plaatst op een internationaal forum voor hulp of om juist hulp te bieden. Ook als je later bijvoorbeeld besluit om (delen van) je code open-source te maken heeft dit aanzienlijke voordelen.
Ik zou altijd documenteren in het Engels om de redenen die Kees hierboven al noemt. Daarnaast ontwikkel je je Engelse taalvaardigheid op het gebied van programmeren. En dat is weer handig aangezien de meeste documentatie op het gebied van programmeren is opgesteld in de Engelse taal. Dus ik zeg +1 voor Engels.
Precies, documenteer in de taal waarin je ook programmeert. En aangezien alle functies in PHP al in het Engels zijn, is het alleen maar passend om ook in het Engels te programmeren, en dus te documenteren.
Poeh, nu wordt het wel een heel erg lastige keuze. Engels heeft inderdaad zijn voordelen en nadelen; je bent iets langer met de documentatie bezig maar je kunt er later wel meer mee, als ik het goed heb. En ja, ik programmeer (variabelen etc.) ook alles in het Engels.
Toch wil ik nog even terug komen op dit onderwerp. Momenteel gaat mijn documentatie zo ver dat ik bij elke regel uitleg wat er gebeurd. Ik vraag mij toch af of er iemand hier op PHPhulp wat van zijn code kan laten zien als je gebruikt maakt van PHPDoc.
Toch besloten om alles Engelstalig te gaan doen!
EDIT: Toch maar even iets van code posten dan, deze kleine pagina heb ik net opnieuw gedocumenteerd:
Toch besloten om alles Engelstalig te gaan doen!
EDIT: Toch maar even iets van code posten dan, deze kleine pagina heb ik net opnieuw gedocumenteerd:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* @author ...
* @package ...
* @name Dashboard
*/
class Dashboard extends CI_Controller
{
/**
* @name __construct
* @access public
*
* Run the main controller in the framework and check if the user can access this page.
*/
function __construct()
{
parent::__construct();
$this->permission->check();
}
/**
* @name index
* @access public
* @return view
*
* Say hello to the user and show the login history for this user.
*/
function index()
{
$data['pageName'] = 'Dashboard';
$data['loginHistory'] = $this->dashboard_model->loginHistory();
$this->load->view('dashboard/index', $data);
}
/**
* @name logout
* @access public
* @return redirect
*
* Delete the user session and redirect the user to the index (loginpage).
*/
function logout()
{
$this->session->sess_destroy();
redirect('');
}
}
/**
* @author ...
* @package ...
* @name Dashboard
*/
class Dashboard extends CI_Controller
{
/**
* @name __construct
* @access public
*
* Run the main controller in the framework and check if the user can access this page.
*/
function __construct()
{
parent::__construct();
$this->permission->check();
}
/**
* @name index
* @access public
* @return view
*
* Say hello to the user and show the login history for this user.
*/
function index()
{
$data['pageName'] = 'Dashboard';
$data['loginHistory'] = $this->dashboard_model->loginHistory();
$this->load->view('dashboard/index', $data);
}
/**
* @name logout
* @access public
* @return redirect
*
* Delete the user session and redirect the user to the index (loginpage).
*/
function logout()
{
$this->session->sess_destroy();
redirect('');
}
}
Gewijzigd op 20/10/2011 20:17:24 door PHP Scripter
Je code klopt niet helemaal. Een titel moet op de eerste regel commentaar. Beschrijving moet, gescheiden door een witregel, daaronder.
Dus:
Praktijkvoorbeeld:
Dus:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
/** Titel
*
* Beschrijving
* Beschrijving
* Beschrijving
*
* @return bool Success
*/
/** Titel zonder beschrijving
*
* @return bool Success
*/
?>
/** Titel
*
* Beschrijving
* Beschrijving
* Beschrijving
*
* @return bool Success
*/
/** Titel zonder beschrijving
*
* @return bool Success
*/
?>
Praktijkvoorbeeld:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
/** Error handler
*
* Will be triggered when an error occures. This function shows where what error occured, and echoes a stacktrace.
* When triggered, the script shuts down.
*
* @access public
* @param int $type Error-type, predifined PHP-constant.
* @param string $error Description of the error.
* @param string $errFile Path of the file where the error occured.
* @param int $errLine The line where the error occured.
* @param array $context Some for the error relevant variables.
* @return void
*/
?>
/** Error handler
*
* Will be triggered when an error occures. This function shows where what error occured, and echoes a stacktrace.
* When triggered, the script shuts down.
*
* @access public
* @param int $type Error-type, predifined PHP-constant.
* @param string $error Description of the error.
* @param string $errFile Path of the file where the error occured.
* @param int $errLine The line where the error occured.
* @param array $context Some for the error relevant variables.
* @return void
*/
?>
Jacco bedankt voor je antwoord! Zou je nu nog eens naar mijn documentatie willen kijken?
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/**
* @author ...
* @package ...
* @name Dashboard
*/
class Dashboard extends CI_Controller
{
/** constructor
*
* Run the main controller in the framework and check if the user can access this page.
*
* @access public
*/
function __construct() { }
/** index
*
* Say hello to the user and show the login history for this user.
*
* @access public
* @return view
*/
function index() { }
/** logout
*
* Delete the user session and redirect the user to the index (loginpage).
*
* @access public
* @return redirect
*/
function logout() { }
}
/**
* @author ...
* @package ...
* @name Dashboard
*/
class Dashboard extends CI_Controller
{
/** constructor
*
* Run the main controller in the framework and check if the user can access this page.
*
* @access public
*/
function __construct() { }
/** index
*
* Say hello to the user and show the login history for this user.
*
* @access public
* @return view
*/
function index() { }
/** logout
*
* Delete the user session and redirect the user to the index (loginpage).
*
* @access public
* @return redirect
*/
function logout() { }
}
Gewijzigd op 20/10/2011 20:52:36 door PHP Scripter
Ziet er al beter uit, let op dat de @return-tag bestaat uit 2 parameters bestaat:
@return [type] [description]
Bijvoorbeeld:
@return bool Success
@return [type] [description]
Bijvoorbeeld:
@return bool Success
De eerste is vereist, de tweede niet. Mocht de beschrijving voor de liggen, schrijf ik hem meestal niet op.
Pim, bedankt voor de toevoeging.




