生の PHP と PHP フレームワーク

7月 19, 2016

Raw PHP vs PHP フレームワーク has been a hot cake of a discussion between PHP開発者 for years with some developers preferring raw PHP and others frameworks. Although both raw PHP and frameworks have their own advantages and disadvantages, it mostly comes down to workflow preferences and demands of the project. If you belong to either side of the spectrum, check out the advantages and disadvantages of Raw PHP and frameworks to take an informed decision when picking either raw PHP or frameworks for the development.

Frameworks Advantages:

  • Framework introduces an extra layer to wrap your business code which in turn provides better manageability and easily workability in teams. If you take an example of any MVC framework; you can understand that the teams can separately work on Model, Views and controller part. ORM (Object-relational mapping) provides easy scalability.
  • A framework gives you some tools and function to make it easier for yourself. For example the database seeds, the form request classes, the migrations, and so on.
  • In framework everything come as set of predefined codes, helpers, libraries. So, you don’t have to write your own pagination, security code or integrate someone else’s pagination, security scripts. Framework follow specific standard which makes the codes more organized. Besides, frameworks have organized MVC pattern that separate your code into 3 categories, excluding the probability of code.
  • Framework is better because almost everything is provided, you need to write less code and there is less to worry about.
  • Frameworks usually have security classes in the core. Some methods of Input class have flags to clean XSS from _POST or other global array.

Disadvantages:

  • You need to learn more as there is a specific learning curve for specific frameworks.
  • Frameworks are slower than raw PHP code.

Raw PHP code Advantages:

  • Raw PHP offers you a lot of freedom a lot of space for imagination and invention.
  • If code is small; going with procedural PHP/PHP-RAW is good idea.

Disadvantages:

  • You need to write lots of code that may already be written.
  • There is more to consider about, like security (SQL Injection, XSS), organization of code, separation of business logic, view etc., (that frameworks already do it for you).
Advantages of Raw PHP Advantages of PHP Frameworks
Faster and more Flexible with no framework library overheads Less duplication of codes with detailed and clear documentation
It is portable More security methods and encryption
Not bound by someone else’s rules or concepts Built-in libraries and helpers
Unlike framework you are not dependent on 3rd party libraries Easy error handling
Your philosophy, your code Easy to find experienced developers
You can license it as you choose Pre-loaded with useful classes

We have a team of experienced and highly qualified PHP developers experienced in a variety of industries. Our team works diligently to meet your goals and give your business a competitive edge. We are one of the best and oldest PHP application development company with experience in an assortment of industries. If you are looking to develop any application or a website then feel free to Contact Us.

jaJapanese