To Use a PHP Framework or Not

Should we use a php framework or build our own?

Don't develop your application for the future. Chances are in 3-4 years you're going to completely scrap this project anyways. And if you really do end up having 1 million+ active users you'll have a large cash flow (hopefully) to refactor at that point.

You're a start up, your best bet is to launch something ASAP and see if people even think your idea is worth while.

Too many companies die working out the small details. Get cash-flow positive and then start worrying about optimizing and refactoring the application when you can hire your own in-house developers.

Obviously you don't want to have awesome user-experience so that should be the only true goal early on.

To answer your question... what I've found is very simple to do is something like this:

Use an existing PHP framework if you're going the PHP route. Something like YII or Laravel because these are well documented and easy to get started on ASAP.

If you're building an API then use something simple that allows you to proliferate some sort of monolith very very quickly.

As for a front-end... it doesn't really matter. It can be done with angularJS or any other JS framework very easily. I prefer AngularJS just because it's what I've worked with but there are many other great options out there as well.

I'd just use whatever the dev team is most comfortable with for now and then when you redo the app (which will inevitably happen in a few years for a new company).

To Use a PHP Framework or Not?

What are the benefits of using MVC PHP frameworks ?

Well there are many benefits of using PHP frameworks, let’s see some of the main benefits of using them.

  1. These PHP frameworks follow some design pattern, so when you use a framework you have to follow their coding convention, which makes your code clean and extensible for future purposes.
  2. The Popular PHP frameworks like CakePHP, CodeIgniter, Zend Framework, Symfony follow Model View Controller (MVC) design pattern which separates business logic from user interface, also making the code cleaner and extensible.
  3. As everybody can guess, these frameworks contain a lot of libraries to make your job easier. For example: to validate a form you don't have to write as much code as you have to do in normal coding scenario (without using a framework), just a few lines of code calling the library is usually enough for it.
  4. While working on a large project in a team, an MVC PHP framework will be a great tool for development as you can assign a developer to develop one part of a module for a developer and integration will be quite easy of these developed modules at final level.
  5. These MVC frameworks really help you to develop the project rapidly, if you know a framework well then you'll never worry about the project deadline.
  6. Most of these MVC frameworks use clear url approach making your web project SEO friendly.

check article

Why use a framework with PHP?

Framework abstracts you from low level details, makes you more productive, and protects you from low level error ( such as preventing SQL injection attacks).

A good PHP framework forces you to separate your concern and implements the proven architecture, which in the end improves your design, and makes your code much easier to read and maintain and unit test.

Here are some references on why you should use framework

Reasons to NOT use a PHP Framework?

There are many reasons that people will suggest not to use a framework.

  • You will learn a lot by writing your own. I have been working on my own and I have learned a lot of different things about PHP that I did not know before. Overall it is a great learning experience that can be used in an interview or on your resume. It shows that you have a big interest in the language and most importantly the theory behind it rather than just the mindless implementation.
  • There are a lot of things in frameworks that you do not need and by making your own you can get only whatever you want. The framework is tailored to your own needs specifically. I for one did not like how any of the frameworks handled templates which was the biggest trigger for me to make my own.
  • Also, I am not positively sure about this one, but thinking of it logically...your own framework that is tailored to only your needs will be much faster than any of the other frameworks. Think about all of the settings that the other frameworks have to go through when loading and the database queries that involves. You save yourself all of that loading.
  • If you are going to be making a small project that will not need to be expanded on, such as a simple portfolio website, then a framework would just be more work than necessary.

There is also a very good article here that goes into other details. The author of this article starts out by talking about how he always was such a big proponent of frameworks.

http://jpst.it/jiYX

I am always going to push towards making my own frameworks unless I start doing some freelance work. I am constantly updating my framework and learning more and more. You will never hear anybody say definitely use or definitely do not use a framework because it all depends on the use.

Edit: There is also a question over at the Programmers site on this: https://softwareengineering.stackexchange.com/questions/49488/when-not-to-use-a-framework

Edit #2: One last article about why frameworks are not necessary: http://www.amberweinberg.com/you-dont-need-a-framework-if-you-have-a-good-developer/

PHP Framework or not (Cake PHP)

As a person with experience in about dozen php frameworks and self assessed as proficient in a few (Cake included), I would suggest you look into Yii Framework. It is lightweight, efficient, well written, supports huge amount of features, has big and friendly community and is by all means better then CakePHP imho.

As far as the 4000 hits per day - that's basically nothing. If you write well optimized applications (take care of slow queries, optimize the db accordingly, move heavy traffic content to CDN eventually), on a decent server, web app can take many times that amount.

php frameworks , when and why do i need them?

Frameworks are created to make your work easy.

Advantages of using framework

  1. There are a lot of functions that are already written
  2. There are some good programic patterns. You have good code and file organisation.
  3. There are a lot of libraries and plugins.
  4. There is MVC pattern already implemented.
  5. They give you advantage of faster develompent.
  6. There is community support
  7. They are mostly fast and secure.

Why use a framework with PHP?

Why do I need to use a popular framework?

Using framework in the begining may seem to be hard, but when you learn it, it makes coding a lot faster!

Disadvantages of using framework:

  1. You will learn a lot by writing your own.
  2. If you need it for small project like portfolio, there is no need for giving yourself more work to set the framework to work.
  3. There is a lot of things in framework that you don't need and they take its space on server.

https://softwareengineering.stackexchange.com/questions/49488/when-not-to-use-a-framework

It's not about frontend project, if you have big project you should use framework if it's little it's not worth. That is my opinion.

I'd suggest you Zend Framework or Symfony if you decide to use Framework.

When to use a framework or develop from scratch for a PHP web app

The advantages of using a solid reliable framework:

  1. Someone else has done a lot of work
    for you.
  2. Someone else has given you a solid
    conceptual model as the basis for
    your application.
  3. Improvements to the framework become
    improvements to your application.

The disadvantages of using a solid reliable framework:

  1. Your application is dependent on the
    work of others.
  2. You have to use the framework’s
    conceptual model as the basis for
    your application. If it is a bad
    fit your development is going to be
    just that much more difficult.
  3. In order to incorporate improvements
    to the framework into your
    application you have to repeat your
    testing.
  4. Breaking changes in the framework
    may break your application.
  5. It may be difficult to get the
    framework author to make or accept
    proposed changes that are critical
    to the success of your application.
  6. If you make changes to the framework
    that aren’t accepted, you have to
    keep patching each new release.
  7. The framework author may abandon the
    framework, leaving you to support it
    yourself.

What should I know before using a PHP framework

Frameworks help to structure big applications. But learning to use a framework is like learning a new language. When you master it, you productivity can increase a lot. But before that, you will spend hours trying to understand how to do specific things. And remember, you have to understand how the framework is intended to work, and you have to adhere to this way.

Frameworks will help you to write more secure and more robust applications, to have better error handling, to reuse common codes, to cache you pages, to simplify database access, etc. But for small projects, they can be overkill.

Most of the time, you have to know about MVC structure. Most frameworks use a single entry script, and parse URL to get the right page, and use templates to display it. Those are concepts you should be familiar with.

Benefits of PHP frameworks

Doesn't php framework make coding a complex process?

It depends what you want to do. If all you're doing is creating a basic contact form for a site that is all static HTML, then yes using a framework would make it a more complex process. On the other hand if you're building a large scale app then using a framework would not necessarily make it more complex.

Doesn't coding without framework provides more flexibility ?

This depends on the framework itself, they aren't all the same. Some frameworks such as Slim or Codeigniter are very trimmed down and don't get in the way too much and so don't really impact on flexibility, some are more complex such as Symfony2/Zend.

Some people say you don't need any additional framework, as PHP is itself a framework.

They are right, you technically don't need a framework, you can do anything with plain PHP that you can do with a framework. Frameworks have really evolved from developers personal archives of functions and helper code. PHP can be relatively low level in that it doesn't have a ready made function to do everything you need. Before frameworks, developers tended to have their own set of helper code that would be reused on many projects. Frameworks are still essentially that, except they are collaborative projects that hundreds or thousands of developers contribute to.

One other benefit of frameworks is if you have several developers, and one has developed an application and you want another developer to contribute to it or take over it, then if the developer is familiar with the framework that was used he can get up to speed on the app much quicker than if it was written in plain PHP. Without the framework, the new developer would have to decipher the previous developers system before they even start to look at adding any new functionality.



Related Topics



Leave a reply



Submit