[phpwebapp-discussion] [phpwebapp - Web Application Discussion] Mixing HTML, CSS, JavaScript, PHP, S
Brought to you by:
dashohoxha
From: SourceForge.net <no...@so...> - 2003-07-31 09:15:52
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=2129008 By: dashohoxha Suppose that we have constructed a web application with PHP. If we inspect the code inside one of the files of the application, what we usually see is a jam of HTML code, JavaScript code, CSS code, PHP code, SQL code etc. This kind of mixing many languages inside the same file is a really bad thing, for these reasons: 1 - It makes the editing of the application very difficult. Most of the editors have code colorizing features, automatic indentation features, etc. for many languages, in order to simplify editing and to make it easy. But when they are faced with such a mix of languages, very often they get confused. As a result, such features become useless, and even they become harmful, because they may colorize wrongly or indent wrongly. 2 - It makes the maintenance of the application very difficult. It is very difficult for somebody else to try to read, to understand and to modify such a code, and even for the author of the code himself (after some time has passed). 3 - Makes difficult the team work. Suppose that a web application is constructed by a team that is composed of PHP programmers, who construct the server side logic of the application, web designers (HTML+CSS) who create the look and feel of the application, JavaScript programmers who construct the client side logic of the application, and DB specialists who construct the database and the queries. In this case it is very difficult for any one of them to make modifications in a big file that has lots of unfamiliar code to them, without making any mistake. Take for example the web designer, it is very difficult for him to change the look and layout of a web page that is tightly interwoven with PHP code. 4 - Increases the complexity of web applications. Different from the previous example, suppose now that a web application is constructed by one or more programmers and each of them is responsible for a certain part of the application. In this case each of them has to have good skills in all of them: PHP, HTML, CSS, JavaScript, database, etc. This is difficult to happen and it increases the complexity and the difficulties of constructing a web application. It is clear that such a mix of codes is a bad thing and a bad practice and it must be avoided as much as possible. ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=135222 |