Wednesday, 21 October 2015

How to write managed code with PHP.

I was recently exploring some projects available on Internet built with php. There are tons of small projects, extensions and plugins easily available on Internet with specific tasks. Many newbies can easily get these codes and use them in their project, that is how PHP are said to be easy as there is thousands of extensions and plugins available ready to be used.

What do I mean by Bad practice and unmanaged codes ?

However Its very easy to build a website with these codes but using different kind of coding practice form different sources from different modules of your application is gonna get you nowhere. For example if you want to display a page and using "echo" to display html codes line by line and using built in functions directly on the front-end page then it will creates confusion with the front end and back functionality. It may be easy and faster way to design small pages with little server side scripting but as your website grow, its gonna be a nightmare for you to debug it if you get trapped with some bugs.

How should we actually write PHP codes ?

The answer is simple 'keep front end and server side scripts completely separate'. But thats not all. Try to develop with MVC even with the smallest project. Keeping your model, view and controller in separate files and folders will give you better speed and control. It also lets you easily scale your project and applications are gonna be likely anomaly free. I would also suggest to use framework there are many good framework available for both small and large systems.

some popular PHP frameworks are..
1. Codeigniter
2. Cakephp
3. Yii
4. Zend

Common mistake while using framework

Using an MVC framework isn't gonna solve all your problems. People still tends to use library functions available for front end designing like forms etc. This kind of practice is bad for responsive web site specially if you want your website to open smoothly of different devices (Mobile , Tab and different browsers). So I would suggest to develop the front end using only front end technology like HTML5 , CSS.  Jquery or Angular js. And keep all the back-end codes in separate files.

Benefits of Using PHP framework

  •  Easy to debug.
  •  Increase scalability of applications.
  •  Fast development with the help of libraries.
  •  Secure Codes and best practice enforced.
  •  Better designing and demonstration of application.

Have a great time with PHP ......... 


  1. The gave data's are extremely valuable to me. It's a superb website for learning web application. Much obliged to you for sharing this brilliant blog.
    PHP Training in Chennai | PHP Course in Chennai | PHP Institutes in Chennai | PHP Training Center in Chennai

    1. I am glad that I saw this post. It is informative blog for us and we need this type of blog thanks for share this blog, Keep posting such instructional blogs and I am looking forward for your future posts.
      Cyber Security Projects for Final Year

      JavaScript Training in Chennai

      Project Centers in Chennai

      JavaScript Training in Chennai

  2. Great Article. Thank you for sharing! Really an awesome post for every one.

    IEEE Final Year projects Project Centers in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation. For experts, it's an alternate ball game through and through. Smaller than expected IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble. Final Year Project Domains for IT It gives you tips and rules that is progressively critical to consider while choosing any final year project point.

    Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining the authors explore the idea of using Java in Big Data platforms.
    Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai

  3. Looking for best Tamil typing tool online, make use of our Tamil Virtual keyboard online to type in Tamil on web browser and share it on your social media handle. Tamil Typing Software Download

  4. it is really a great and helpful piece of info. I am glad that you shared this helpful information with us. Please keep us informed like this. Thank you for sharing.
    china visa singapore

  5. I enjoyed over read your blog post. This was actually what i was looking for and i am glad to came here!
    Website: Antique jewellery designs

  6. Amazing Article,Really useful information to all So, I hope you will share more information to be check and share here.thanks for sharing .
    Website: Vietnam Adventure Tour