mercredi 7 janvier 2015

Are there established guidelines for code formatting in included files with references to other files?


When developing for the web you will inevitably end up referencing a lot of files that eventually all get included and combined into a finished product. I specifically develop a lot of Wordpress sites and, as an example, the project I'm working on right now includes a file called footer.php which simply contains this code:



<?php wp_footer(); ?>

</body>

</html>


Now I'm aware what I'm asking is absolutely non-critical but I'm wondering if there are any established best practices for things like code indentation and other formatting issues within included files. The body tag is obviously nested within the html tag, so should that indentation be kept inside footer.php? At the same time it feels kind of strange to start a file by potentially indenting the first line of code a lot of times depending on where it's included...





Aucun commentaire:

Enregistrer un commentaire