Jump to content

Recommended Posts

my php coding experience has apparently accumulated to something substantial 

but my coding practices are a big mess,

 

currently i am writing procedural scripts not using MVC etc

 

need suggestions on how to ,  what  to use to make my life more organised and

what would be the best for maintainable code?

 

 

Link to comment
https://forums.phpfreaks.com/topic/245621-mvc-or-procedural-coding-suggestions/
Share on other sites

If you try MVC then one of two things will happen:

1. It will click with you and your code will start looking better.

2. You'll continue with your messy practices but in a whole new way.

 

A mess how? Try cleaning that up first with what you write now before trying to learn something new.

If you try MVC then one of two things will happen:

1. It will click with you and your code will start looking better.

2. You'll continue with your messy practices but in a whole new way.

 

A mess how? Try cleaning that up first with what you write now before trying to learn something new.

 

in mess i meant that my html is with my php

i understand that MVC will sparate the data, layout and logic

but it is OB oriented with files i dont really like that.

If your after code organisation, you could do far worse than learning OOP.

so what do you suggest and any recommendations for frameworks?

 

Zend's framework 2.0, Symfony 2, and also try Proem (thorpe's framework). Personally I'm more of a component freak myself so you may want to try these aswell: Doctrine 2 (db), Symfony components (good for Routing, Config, Autoloading, ..): it also has an HttpFoundation, translated this means that you can write your own bootstrap code and decide whether you'll route to an action in a controller (the default setting for most frameworks)?, a class?, a php file?, a closure? (I like this kind of flexibility even when I'll never need it ;)) Twig: because I hate Smarty.

 

I have a few personal projects to get my feet wet with all the above frameworks and I mostly mix them all: use Zend's routing, Symfony's autoloading, Twig for templating, Doctrine for database, ..

  • 2 weeks later...
  • 1 month later...

Hi,

Unless you are planning to stay in the stone-age,  I suggest you go the OOP route.  Eventually everything will be translating the OOP due to its' organizational structure, and usability- re-usability of code. 

If you yourself acknowledge that you have messy code, then you should consider organizing it, and OOP can help.

In the end, you will love yourself for making the change, since maintaining it will be a lot easier.

 

Let us know what ever you do.

 

BTW I'm new to the forum.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.