Scroll to top

WHY USE A FRAMEWORK OVER PLAIN PHP

In this post, we will see why it’s important to use a framework for serious development over plain PHP.

WHY USE A FRAMEWORK OVER PLAIN PHP

CODE MANAGEMENT

Frameworks are organized in such a way that developers can keep their code organized by separation of presentation and logic layer. The presentation layer is done by Frontend developer who does not have anything to do with backend stuff he works with HTML, CSS, jquery most of the time. In the below image you will see how views and controllers are separated.

Frameworks follow MVC pattern which separates the layers. Models are objects in the web application like SettingsObject, Profile Object.Views are presentation layer which shows the visible part to the user .

Controllers are classes which takes the data from Model and pass that to Views . Controllers contain business logic .

SECURITY

In most of the application you will be using Login , Registration , Payment gateways for processing payment , Saving Credit card information for recurring transactions . This type of applications need to be secure from all sort of hacking methods . Why should we recreate it when it have been done by top developers . Frameworks are secure . Frameworks are tailored for security from the ground up

  • Filter Input escape output is automatically done for us
  • Secure routing for admin and normal users
  • Handling CSRF attacks is just changing a option in the config
  • SQL Injections are very common attacks
  • Password Encryption

LIBRARIES AND PACKAGES

Framework contains all the packages which are mostly used in web development . Some of the packages are

  • Form Builders
  • Authentation System
  • Email Libraries
  • String helpers
  • Localization
  • Cache
  • Pagination
  • Sessions
  • Templates
  • Validation

ACTIVERECORDS

If you are used to frameworks you will never be writing a single line of query most of the time in your applications . Frameworks provides ActiveRecord implementation to work with databases so when ever you change database you dont need to change a single line of code . If you want to get all users thats simple just query your models like below

GOOD PRACTICE AND GOOD COMMUNITY

Yes, we know how to code but what if there is an alternative way which can improve performance we will surely use that . Good Frameworks have an active community , good developers who teach you best practices . Give it a try

CONCLUSION

In the next few posts, i will be writing posts on Laravel and let you feel comfortable with the directory stucture .

Author avatar

admin

http://www.kodeinfo.com
Imran is a web developer and consultant from India. He is the founder of KodeInfo, the PHP and Laravel Community . In the meantime he follows other projects, works as a freelance backend consultant for PHP applications and studies IT Engineering . He loves to learn new things, not only about PHP or development but everything.

Post a Comment

Your email address will not be published. Required fields are marked *