Solved

To framework or not to framework

Posted on 2014-09-30
12
86 Views
Last Modified: 2014-10-03
Hi

I am writing a fairly large website and my employer has been convinced by someone that he needs a framework.

I do not think he does.

I can use an ORM.

As far as I am aware we are not templating the system and just using one design (if we did template the system can we add this in retrospectively or should this really be done from the start?)

I have always written standard legible code so people could pick up my code and understand my aim. I dont write idiomatic code no-one can understand to look clever. If i look clever i get harder tasks at work!

Is there a reason I'm missing why a framework could help him? I have seen this (http://www.phpandstuff.com/articles/top-10-reasons-why-you-should-use-a-php-framework) but time is off the esssence and i am a coder not a designer and i worry about how long it will take me to reverse engineer a pre-made template into laravel. A previous post/comment from Ray Paseur suggested i took a week and did a rapid prototype to see how long it takes to reverse engineer a teamplate so i will do that as Ray is god :) . I just wondered how long it took the people who know what they are doing to reverse engineer a template. But i guess that could be like asking how long is a piece of string

Thank

I know we shoud all write great code using the latest technologies and the best design patterns but sometimes your boss just wants to make money and wants you get something togethas asap an i think a framework wont help. If we were making loads of websites - perhaps. But it is just one website.

Thanks experts :)

But also, can you get significant speed gains from a framework?
0
Comment
Question by:andieje
  • 6
  • 4
  • 2
12 Comments
 
LVL 51

Accepted Solution

by:
Julian Hansen earned 250 total points
ID: 40352128
What is a framework? If you develop code on which your site is based - is that not a framework?

I suspect that what is under discussion here is an existing open source framework (Joomla, Drupal, Cake, Symfony, laravel)

Two main benefits I see from using an existing framework are tried and tested pre-existing functionality and continuity (developers knowledgeable about the framework).

Personally for most of my projects I find most of the frameworks out there to be bloated - trying to be everything to everyone and so I developed my own framework.

In terms of speed of site can't see that a framework delivers any significant performance unless it has a good caching function and your custom site does not implement caching - otherwise I usually find that the frameworks out there are quite inefficient in their implementation sacrificing speed for ease of development.

Having said that, if I were in a position of paying someone to implement a site I would insist on a standard framework for the following reasons

a) I could be reasonably sure I am not paying to have the wheel re-invented
b) My site will be based on a code base that will be tried and tested (doesn't say anything for the customisations - but the underlying engine should be reasonably sound)
c) I could be fairly confident that I should be able to find someone to support the site in the event the original developer was no longer available.
d) Popular frameworks have support for plugins and while these pose a potential security risk they also provide functionality out of the box that would have to pay someone to develop.

From a developer perspective I would go with the framework for the following reasons

a) I don't have to re-invent the wheel
b) I am covered if my employer wants to question my work.

Reasons for not going the framework route.

a) Project is really security sensitive
b) Project has functionality or structure that would require to much re-configuring of framework code base
c) Framework is overkill for project

You should get as many different answers as experts out there - so you are going to need to evaluate how to proceed based on your experience and specific situation.
0
 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 total points
ID: 40352139
You will not get "speed gains" from frameworks - they are generalized solutions and as such, they contain answers to a lots of questions you may not be asking.  Where you will get value from a framework is in the build-out of the site.  The framework already contains things you need like organization, security, session handlers, data base abstraction, etc.

The article cited in the question dates from 5-6 years ago.  CodeIgniter and Kohana were very popular then, but like all things in technology, the fashions change as technology advances.  Today I  would trust the "Frameworks" section of this site, which seems to be up-to-date.
http://www.phptherightway.com/

Here is a good list:
https://github.com/codeguy/php-the-right-way/wiki/Frameworks
0
 

Author Comment

by:andieje
ID: 40353034
Ray - what would you do? I don't feel that one php site would benefit from the learning curve of the framework. If I was a competent designer and wasn't worried about reverse engineering a design templates then I would think definitely framework. The design template is key as that has all the flashy bits that do nothing but attracts customers and that is what my boss wants. I feel I could write a 3 tier extendable website without a framework. It feels the learning curve for the framework is disproportionate.

I hopw it isn't against etiquette to ask a direct question to Ray but we have engaged on many other questions so I think he probably has a better idea of my skill level and personality.

Kind regards
0
 

Author Comment

by:andieje
ID: 40353039
@Julian
I respect your advice completely and don't want to reinvent the wheel and I want to use tried and tested components. However for me speed is the essence and I don't want to spend a month or so trying learning mvc, laravel and how reverse engineer a design  template into it. This may be the preferred and optimal way to produce the site but I have time constraints.
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 40353064
My candid answer: I would lay out the pros and cons of each approach and your estimate of the timing from start to finish.  Put this into a presentation and meet with the boss, and let the boss decide.  If the boss chooses the framework path, knowing it will take longer, the good news is that you'll get framework experience which will make things better next time.  If the boss chooses organic development, knowing it will go faster, but not add all of the flashy features of the framework, you'll miss out on the framework experience, but the task may be completed more quickly.  If the boss puts the choice back to you, choose the framework approach, explaining that it's an investment in your skill set that will be good for the organization in the future.
0
 
LVL 51

Expert Comment

by:Julian Hansen
ID: 40353128
However for me speed is the essence and I don't want to spend a month or so trying learning mvc,
I completely understand this sentiment - I personally am averse to using canned code - but I also know that my way is not necessarily the right way - it works for me because of how I want to work but it is not the way I would advise others to proceed because it is risky on several levels

1. It can actually take longer as you spend time trying to solve problems that are provided out of the box
2. You can find yourself in what I call the Babbage trap - you halfway build your site before realising there is a better way and being a perfectionist you are compelled to re-engineer / refactor the project.

Regarding the time to learn - I like the story of the guy who is always late for work pushing his bicycle. One day an observer asks him why he does not just get on the bike and ride to work - to which he replies he does not have the time to get on the bike. Sometimes it is worth taking the time to learn how to do something because the time lost in learning will be more than made up in gains down the line - not to mention adding a new marketable skill to your skill set.

I use a framework for all my sites - it just happens to be one I have developed and used over the years - but never-the-less it is still a framework. It does all the heavy lifting for me freeing me to focus on the functionality of the site - which is essentially what a framework is designed to do. I do not advocate creating a framework - my reasons for doing so are not good ones to follow - I mention it merely to highlight the benefit of using tried and tested code that takes care of the nitty gritty.

Of course if you decide to go with a framework the next trick is to decide which one ...
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:andieje
ID: 40353192
Thanks Ray = the problem I have with an estimate of timing is that I've not used Laravel before. I will suggest to the client that I do a small prototype as you suggested and see what he says to that idea. Then I will be able to suggest time frames
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 40353215
I like that idea.  A "Hello World" example will give you a chance to take notes and build a code sample library.  Maybe you can write an article for EE about your experience getting started with Laravel.
0
 

Author Comment

by:andieje
ID: 40354339
Hi again Ray

Just drawing up my list of pros and cons as you advised, in this comment here what did you mean by flashier features of frameworks. Having never used one I am assuming they add some really nice touches really easily. I was wondering if you could provide an example
0
 

Author Comment

by:andieje
ID: 40354340
opops forgot tosay please
0
 

Author Comment

by:andieje
ID: 40354343
Do you use a framework Ray?
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 40354360
I've used WordPress as a framework, mostly for demonstration purposes.  I rarely produce public-facing web sites; most of my work is internal or in machine-to-machine web services (telephony, APIs, etc) so I'm not the right guy to ask.  My arguments in favor of Laravel are mostly hearsay, but I have great respect for the proponents of Laravel.  
http://www.sitepoint.com/best-php-frameworks-2014/

If you want to have some fun without investing too much time in the project, you might take a look at Slim.
http://www.slimframework.com/
http://www.ibm.com/developerworks/library/x-slim-rest/
http://www.youtube.com/watch?v=26CRc89gN10

If you want to tear your hair out in a funhouse maze of mirrors and dead-ends, take a look at Zend, which when compared to Slim might be called the Morbidly Obese Framework.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now