0

Ok, it might be a banal question but i'm a little bit confused. I'm going to develop a project by my own. This means i'll build the HTML template, the PHP scripts, MYSQL query, AJAX calls and CSS styles. This means no other people will touch any part of the code.

I know templates are good ways to make the entire application easy to be modified. But is that so necessary to do it? Since i'm the only one who got to know what that files and what that page do?

2
  • 1
    think about you, in 2 years, you'll have forgotten everything, use good practices, at least for you Commented Jan 14, 2011 at 12:01
  • if you don't want to ease your own job, you can use no templates of course Commented Jan 14, 2011 at 12:07

4 Answers 4

1

Using common patterns in the development of software products is not only about making it more readable/maintainable but also about making it extensible. The longer your software will be in use, the more features will be requested/desired. Extending one big mess of a software will not work out in this case. Try a php framework (e.g. Zend Framework / Symfony(1/2)), there are lots of tutorials which allow you an easy start with or without templating engine (I use twig atm, which does a great job!).

Sign up to request clarification or add additional context in comments.

Comments

1

If i were you, i wouldn't use templates (do you mean PHP frameworks?) but thats just me.

1 Comment

I mean my own developed framework which has a template class in it.
1

You don't have to use a template engine - PHP itself can do that just fine.

In general, it's a good idea to "separate concerns" (eg. code which outputs HTML is separate from code which loads data from the database) - it improves the readability and organization of code, making it easier to maintain and faster to develop further.

Comments

0

You should have a look at a framework, like symfony. Most frameworks make use of MVC and hence provide a good separation of your code.

But is that so necessary to do it? Since i'm the only one who got to know what that files and what that page do?

Yes, if you want to keep it maintainable in the long run. If you are not constantly working on the code, you will forget how some things work eventually and then you are happy if you have a proper separation and organization.

2 Comments

Separation (template system) are used because of job-separation (php developer, web designer). Since i'm both, why should i divide it? I'll put my html and css part in the bottom of the page and it will be done, isn't it?
@Charlie Pigarelli: As I said, it increases maintainability.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.