Jump to content

Code Review and Framework woes


nik_jain

Recommended Posts

 I am PHP developer developing for the past 3-4 years, but except for CI I had always kind of struggled with any type of framework..

So I ended up not using most and just rolling my own frameworkish 'structure' . That ended up as a FANTASTIC learning experience, as I really  got to understand what and how a real framework does/works.

My  complete source of the site wowpictures.link (which was made as a learning thing) is here: https://bitbucket.org/nikhil_jain/complete-wowpictures.link-source/src . Can someone take a quick look please . and offer suggestions / improvements / completely wrong things I did ?

Secondly now I am hunting for a real framework, but I just find them too restriucitve / imposing. For instance yii seems too tied up with bootstrap, laravel like blade too much. Yii also seems to have a very specific class / method naming structure, that I find a chore to remember..etc etc.

So what should I do? Learn any proper framework OR try to improve my own thingy ? I am strongly leaning towards th former option, but can't find a framework that doesn't forces random stuff no me ....

Thanks

 

Edited by nik_jain
Link to comment
Share on other sites

Symfony2 does not force anything on you. With any framework there are certain "rules" to follow, and preferred ways of doing things, but that is for the better. Except for some sort-of strict structure conventions (which you can totally ignore if you want, in your own application), Symfony2 gives a lot of freedom to do what you want to do.

 

Your framework seems to lack any kind of structure or architecture. You just kind of arbitrarily dumped everything into a few files in /common/. As someone who is complaining about other frameworks being too restrictive, you should take a look at what you have made - your framework is very tightly coupled to not only a specific database driver, but also to a specific database schema. Your classes hold way too much responsibility, and your structure is not consistent (some methods have visibility keywords, some don't. Some have docblocks, some don't. Etc).

 

What you have here is more like an application and less like a framework. A framework should be reusable in a wide variety of applications with freedom of choice. You're not offering that here.

 

I was once in the same boat as you - I started with CodeIgniter and then found it hard to use the other frameworks, because I thought they were weird after using CI. Well, it turns out that CI is the weird one. Forget everything you think you know about frameworks and just start fresh with a new one. I usually recommend Symfony2, just because of its popularity and the fact an increasing number of other projects are starting to utilize the Symfony components.

Edited by scootstah
Link to comment
Share on other sites

 

Your framework seems to lack any kind of structure or architecture.

 

Agreed. I was quite hesitant to call it a framework, hence the word structure (some code that I can reuse) . It was obviously never meant for use by anyone other than me..

 

 

As someone who is complaining about other frameworks being too restrictive, you should take a look at what you have made - your framework is very tightly coupled to not only a specific database driver,

Well in my defense is the complete code of the site, not the actual 'structure' . Although I admit it doesn't even have a any kind of DB class

 

Thanks a lot for your response. I have tried symphony in the past, will give it another shot.

Though through another forum I discovered that its quite easy to get rid of blade in laravel, so I might give it a shot too!

 

Thanks again

Link to comment
Share on other sites

Laravel is much more opinionated than something like Symfony2. It sacrifices some things in order to make it more simple to use. It's still a great choice, though, especially if you're still new to frameworks. Symfony2 is very powerful, but it also has a really steep learning curve.

Link to comment
Share on other sites

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.