ch-a-os / DocSort

Digitize and access everything, everywhere.
GNU General Public License v3.0
0 stars 1 forks source link

Decide if we should use JSdocs #129

Open ghost opened 5 years ago

ghost commented 5 years ago

@Mondei1 We should decide on if we want to make use of the JSdoc-commenting.

/**
 * Extracts the user ID out of the JWT
 * @param jsonwebtoken JWT of user
 * @returns ObjectID of user
 */

This is nice, but i am not sure if this is needed, since our software will never be used by other people. It's not a package that is embedded somewhere, so other pserson needs to read our functions... I can just imagine that it would be nice for ourselfes to have more information, but keeping JSdocs in sync with the rest of the code requires extra work.... And i'm not sure if the Typescript-"documentation" is maybe enough at this point.

I mean...

export async function addUserToRequest(req: ModifiedRequest, res: Response, next: Function): Promise<void> {

This is pretty straight forwarded and easy to understand in my opinion^^

Not saying i'm against JSdocs, i just think weshould decide on if to use it or not and then make the code consistent :)

Mondei1 commented 5 years ago

Sure it's a little bit useless but first, it looks good, second it can help us a little bit and at last, newcomers who want to improve DocSort or want to know how it works can easily understand one function.