Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validar los datos al principio #6

Open
pamoreno opened this issue Mar 24, 2018 · 0 comments
Open

Validar los datos al principio #6

pamoreno opened this issue Mar 24, 2018 · 0 comments
Assignees

Comments

@pamoreno
Copy link

pamoreno commented Mar 24, 2018

9511ejentregar/24.c

Lines 57 to 62 in b1083bd

else
{
fprintf(stderr, "%s\n", MSJ_ERROR);
}

Si bien no es completamente incorrecto hacerlo de este modo, se estila poner la validación al comienzo y finalizar el programa si no pasa la validación:

if (esta_todo_bien != true)
{
    /* es un error */
    return EXIT_FAILURE
}

/* hacer algo */

en lugar de

if (esta_todo_bien == true)
{
    /* hacer algo */
} else {
    /* es un error */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants