PHP: Application Framework Question (up for discussion)

I am a hobbyist, which means that I do it on the side, and I do not do it too often. I read and browsed the framework of web applications and looked between them in CakePHP and CodeIgniter. Finally, I decided to dive into CakePHP, as it seemed to be more in my lane.

The problem is that the more I immerse myself in it, the more I don’t understand why I use the framework. So, the hardcore developers are there, discuss with me or help me understand the following:

I understand that in the long run, application infrastructure helps speed up code deployment or write code faster. It is clear, however, whether limiting this framework is the fact that you must encode framework standards? More and more I am trying to use CakePHP, it is almost like I need to learn the framework language / standards in the programming language itself. For example, I need to learn CakePHP standards and how to implement a “faster” deployment and interpretation, but I'm also trying to code PHP standards (which are somewhat built into CakePHP), but overall this is what I see. For me, this is a bit of an overhead, but if you know CakePHP or your choice structure, it's nothing, because you probably know how to encode your framework?

Another question or discussion - both the outside developer and the person who likes the MVC approach, but doesn’t really know how to implement it using the framework, will be the best approach to the code in the same way as I do (via the function file), creating my own functions, etc., but also use MVC methods to use? I mean that instead of studying the structure of the application, I have to separate the styles of content from functions, etc., for example, from MVC, but use my own functions or study the scope of the application.

Note. I may misuse the application framework, but I'm not sure. In addition, it was intended for discussion, and not for circulation; I don’t know what I don’t know, so I really turn to some clarifications.

Thanks!

+4
source share
2 answers

I think that there is something to remember: to be productive with the help of a tool, you need to learn how to use the tool first. You know how to walk, and you can get from point A to B in an hour. If you want to get there faster, you need to learn how to drive, and those days that taught how to ride could be used for walking. But as soon as you know how to move, you are much more effective.

It is like frameworks - the car is the foundation.

With wireframes in general, they are used to facilitate and speed up the development process. To apply the DRY principle, you will get reliable basic tools (word processing, input control, form validation, email and session processing, etc.) so that you can immediately work on them so that you do not invent the wheel. I was happy to use the framework, but as soon as I received it, this is something that I can not let go, in my experience.

I don’t think this is a limitation (since they are extensible), I think it’s rather a “personal standard” - the way these applications should have been written in the same way as when creating your own libraries. Once you know and love your framework, this wave will magically disappear.

About MVC, I would not use the word "should", but this is a definitively good choice, no matter what you do - if you use the framework, great, and if not, but you separate the business logic from the content, great! It's all about you, feeling comfortable. The same thing happens with Grid Frameworks, CSS Resets, using libraries, etc. is a matter of choice. What is mine Use these tools because they are designed to use and create trusted applications and websites. They were tested again and again, they work, and they help you not to repeat yourself and not to reinvent the wheel (which has been done a thousand times). MVC is also great for scalability and maintenance.

My recommendation is exploring the framework. There's the reason you chose Cake over Codeigniter (I don’t know why, though - the Codeigniter user is here!), So stick with it and work with it for a while. They are all powerful, but the full potential is not fully visible from the very beginning.

In addition, the last: since all applications have punctual use, you will always create your own libraries, no matter what, and these frameworks simplify the creation, use and support. That way, you can have a mix of all of them, with the whole database of the framework.

Keep trying - you won’t regret it!

My two cents.

+1
source

MVC principles are usually applied using object-oriented programming, but it is possible to use it to use concepts using procedural programming. This is how most Drupal works.

I used several different frameworks and also wrote my own. I prefer to use my own for complete control over the design and implementation. I also wrote this so that I can use the main code in many projects. I also need an ongoing copyright project.

I am a development group where I work with CodeIgniter, and I swear to buy it, I used it only to deceive and never create, and sites with it. But I prefer it over CakePHP. When I participated in using CakePHP, I did a lot for the main code to understand how to do certain things, and decided that I did not need all this overhead even for the simplest queries.

Doing this is a great learning experience. Many people think that this should simply remain a learning experience and not be used for the real world, but I disagree. General frameworks are great for rapid prototyping, but I personally prefer more control over the system. There are other MVC frameworks, perhaps also look at them.

I do not always agree with the discussions that designers are developing, but you should at least find out why they did it the way it teaches you.

There is nothing "wrong" to do this with functions, but as someone who just (last year) did PHP-procedural PHP programming for OOP; OOP is the way to go. I think I should mention that I'm not new to OOP, just PHP. But it was still not easy.

The amount of code that I reuse, as well as how easy it is to create new pages, was worth the time it took to get new things to fit my old methods.

0
source

Source: https://habr.com/ru/post/1344697/


All Articles