MVC and Frameworks

Inspired by someone else’s thread…

Must a person use a “framework” in order to learn and program using MVC?

I hate using other people’s code!!

As I see it, if I wanted to use your code I’d hire you to program my site!

This, of course, is not to say that I cannot learn from others. But to me the fun of programming is solving problems yourself versus “configuring” someone else’s finished product. (That is what WordPress is to me!)

Not at all. I frequently recommend the article From Flat PHP to Symfony2, and the first half of that article is completely framework-less. “You’ll write a simple application in flat PHP, and then refactor it to be more organized. You’ll travel through time, seeing the decisions behind why web development has evolved over the past several years to where it is now.”

2 Likes

@Jeff_Mott Do you prefer frameworks or write MVC your own way?

Why not both? This is a great tutorial series.

3 Likes

It depends on what you’re doing really. If you’re programming for fun, or to learn, then there’s a lot to be said for writing everything yourself.

If you’re programming for profit though, then using 3rd party libraries or frameworks has a couple of big advantages:

  • Open-source projects have many more pairs of eyes looking over the
    code, and more people using it in different situations, so bugs and
    strange edge-cases are much more likely to be discovered and fixed
    quickly
  • As the old saying goes “time is money”, and you don’t want to be spending time coding and debugging stuff that’s already been done. Your time as a developer is more wisely spent creating the functionality that is unique to a project, rather than re-inventing the wheel.
2 Likes

I can’t agree more with @fretburner. It boils down to time and intent. Fun and education: Do (whatever) yourself (unless your goal is to learn the tool). Speed and efficiency? Use the tools people have given you. The age old euphemism “why re-invent the wheel” comes to mind. Just because one enjoys independence does not require one to sew their own clothes, build their own car from parts, build their own house by hand, or assemble their own computer - but if people find those things enjoyable or more efficient for one reason or another, then they absolutely do them!

The rest of the time, we use prebuilt things to save time and money. So your intent is what matters: Getting the thing done for some deadline, for example, or learning a language, for example.

1 Like

Its an interesting question. For me though, Id love to write my own MVC framework, and actually beyond MVC with a four-layered domain driven framework. I am close to an object purists, so I try to write my framework to be as object oriented as possible and apply as many good OO design practices as I can. Of course, I am not perfect, so it will have flaws. But one amazing thing about writing your own framework is that its also a good learning practice, it makes you a better programmer in the end. In a professional world though, you just will have to do whatever it takes to develop your application quickly, especially if you work for someone not yourself. If your boss wants to use an existing framework to boost development speed, do not fight him.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.