Framework or from scratch?

Hello,

As I’m learning and finding over the web, videos and in the books, to understand how we build an application / website. I had a discussion yesterday with a developper, who was talking about many frameworks ( Laravel, Codeigneiter, Sinfoni , …) …and this is let me ask myself a question, that I would ask it to you.

Are we studying php to build our project from scratch, or to understand to use a framework ? the big projects like twitter, facebook, and others, began with a framework ? I don’t think so …

Many do. Twitter for instance was built on Ruby on Rails, which is a framework for Ruby. Lots of other startups continue to use RoR. A large PHP site that uses a framework, is YouPorn (that is a safe-for-work talk about their technology), who uses Symfony.

Once you learn a framework, it allows you to code much faster without worrying about common security issues and reinventing the wheel around every corner, wasting time that could be better spent on producing things that get you to market faster. There’s no reason to build something from scratch unless you absolutely need to and when you’re just starting out, you don’t need to. (or you want to learn)

1 Like

If you are just wanting to learn a language I say do it without a Framework that way you’ll learn the nuts & bolts of the language. However, if you up against the clock and need to get something done in a timely manner, like it has already been mention don’t “reinvent the wheel” use some kind of Framework.

You will learn MUCH more about patterns and modern architecture using a framework like Larevel or Symfony than you will building something from scratch. Contrary to popular belief using a framework will also present more of a challenge considering you will be submersed in unfamiliar territory. Unfamiliar territory which you will need to learn to navigate to achieve business requirements that are not covered in part or full by the core framework capabilities. Being able to understand and manipulate a framework to the point where it can be used for nearly anything is more an asset than writing something completely from scratch in my opinion. However, if you don’t believe that learning Laravel and Symfony will indirectly teach you all about the latest and greatest design patterns and architectural philosophies to better equip you to build your own framework one day. I’m willing bet that you will end up frustrated and resort to custom code anyway because Symfony or Laravel will ultimately prove to difficult to achieve EXACT requirements given your skill level.

2 Likes

Why not bootstrap? It’s a great way to get used to PSR Autoloading, using Composer and a feel for the components that make up the larger frameworks.

What are you talking about? – bootstrap is a css framework (unless there is also a *popular php framework named bootstrap). I couldn’t find anything of the sorts on google though…

That threw me off at first too, but I don’t think he’s talking about “Bootstrap”, but bootstrapping.

e.g. http://www.binpress.com/tutorial/php-bootstrapping-crash-course/146

If you want to learn then build things from scratch for gaining experience.
After that it will be easier to understand how professional frameworks work and you’ll be able to use them effectively in production.

True, but for me “tearing down” has sometimes been just as educational as “building up”.

Then again, I try attacking a problem from many fronts because that’s what works for me.
And somewhat paradoxically, I learn more from mistakes and errors than I do from “successes” so I may be the odd man out here

If you are just learning to program, using a framework is totally counterproductive actually, because if you don’t know the basics, a framework is just going to confuse you a whole lot more than you already are. They are the “next level”, where design patterns and best practices are built into them. But to understand them, you must first know what PHP programming is all about.

What you should also NOT expect is to be able to build a proper and safe and very usable web application with novice developer abilities. Just simply don’t set those goals. Learn by doing smaller tasks, start with showing a “hello world” on the screen. Then go from there. Like the next step might be to do a simple “To-Do” application, like all the Javascript frameworks put forward, in order to learn how they work.

You can also bet your butt that any large company has “A” framework of some kind being used. It might be their own home grown framework or one that is OSS. But, for sure they have a modular system, which represents building blocks to get developer kinds of things done faster. That is what a framework is supposed to be for. :smiley:

So TL;DR if you are learning PHP, start from scratch and do smaller things with the language. Then look at how frameworks might solve the problem differently, and in most cases, better. You’ll then learn both a lot faster.

Scott

First of all, thanks to each one of you for his comment and advice, you can’t imagine how much I appreciate your help.

Exactly, this is what I’m looking for now, in fact. I don’t want to wast time writing the code from scratch, but I need for now to understand globally PHP, to be able to understand any php framework. By the way, I don’t think that RoR is easy to learn, as I saw by watching an overview video that Ryby language is so much complicated vs php.

By the way, your youtube video is really interesting. But, after searching over the web and specially after reading this ARTICLE, I don’t have any desire to read more about Ruby on Rails., and in the same time, became confused to select the best framework later when I understand PHP very well…till now 90% it will be Laravel.

This is exactly what I’m doing now.

I didn’t say that, contrariwise I believe in what you say, but not for now. Before discovering Laravel ( as I mentioned above, 90% I will select it ), I need to understand very well PHP, I mean the basic, to be able to jump easily to the next step.

Interesting to read more about.

I confirm.

I agree with you, but you say that as you are a good developer, this is mean you are very very far from a beginner as me with your high level. I’m still a baby in the programming world :blush:, but I learn quickly.

You resume what I just write about. I agree with you.


Again thank you all for your advices, comments and help. I’m going to continue my adventure in the world of PHP and get back when I have more questions.

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