Ask PHP experts to guide and improve PHP programming object-oriented programmers
Today, I attended a Coding Dojo program, and I had some questions. I hope Daniel can give me some guidance.
I am a PHPer and now I am in an e-commerce company. I am a big bull and a programmer. We use ThinkPHP framework. every time we make a function, we feel like we have done a lot of work, however, after completing these steps, I found that what I did was not technically competent, did not use object-oriented thinking, nor did I use design patterns. I just designed and solved some problems logically, I don't know how to improve my PHP skills. Should I consciously write more object-oriented programs? How can I improve myself in the future? I hope the PHP experts can give me some advice. I am very grateful ~
Reply to discussion (solution)
My current status is different from what you described, but I provide an idea: take the time to re-write the current project based on the object-oriented approach (aside from the TP framework ), how much can be done from the underlying architecture? I think this will certainly improve.
You can use your imagination only when you are answering questions.
However, the framework is only being used to fill in blank questions.
But it is wrong to "not use object-oriented thinking". what you do is the specific implementation of some methods of objects.
Based on the framework, think about how you rely on the framework. that is to say, why can you use the framework?
For example, every time you write business logic, you write a controlle and action, and then you can access the service through the url. Have you ever thought about what logic has been processed from the url request to the action? Can we clarify these logics? Can you realize how these logics interact with each other?
What are the real reasons why I naturally know something? It will be improved slowly, that is, not only knowing it, but also knowing it.
It is often said that if there is an electric saw and someone who uses a knife to cut a big tree is really stupid.
But how does an electric saw cut down a big tree? the principle still needs to be understood from a knife ?? Vertical force is called cutting and cutting, and horizontal force is called Saw
Vertical forces are laborious, and horizontal forces are labor-saving. the number of horizontal saws is proportional to the wood thickness, and the frequency (that is, the number/time) is related to the force (energy ).
Therefore, adding power increases the saw frequency (the number of times per unit time) to save time and effort.
The electric saw (tool, framework) can improve work efficiency, but the accumulated work experience is on this tool. for example, it is not easy to hold the electric saw ......
However, it is difficult to understand the working principle. In the end, we should take a knife to understand how to cut wood.
What if I only know how to use an electric saw to go to a new wooden farm without electricity ??
If you build a tool to solve the problem without studying its principles, make sure that you will have this tool around you in the future.
For example, if a real person wants to leave the city for the rest of his life, he only needs to know the road card tool, and does not need to know the lost view of the stars/the compass to identify the direction (alas, it is not easy to see the stars in the current city). but if you want to travel around, you are not sure whether you want to go to a new place or not, it is better to master the basic knowledge from a low level.
If you want to learn and improve your theoretical skills, let alone the "advanced and excellent" tools on your hands.
If you are not sure you can have concrete pre-fabricated parts, you should learn how to make it better.
I have never heard of players from Brazil, North Korea, and Iraq over the past few decades complaining about poor venues and poor lawns.
It is often said that if there is an electric saw and someone who uses a knife to cut a big tree is really stupid.
But how does an electric saw cut down a big tree? the principle still needs to be understood from a knife ?? Vertical force is called cutting and cutting, and horizontal force is called Saw
Vertical forces are laborious, and horizontal forces are labor-saving. the number of horizontal saws is proportional to the wood thickness, and the frequency (that is, the number/time) is related to the force (energy ).
Therefore, adding power increases the saw frequency (the number of times per unit time) to save time and effort.
The electric saw (tool, framework) can improve work efficiency, but the accumulated work experience is on this tool. for example, it is not easy to hold the electric saw ......
However, it is difficult to understand the working principle. In the end, we should take a knife to understand how to cut wood.
What if I only know how to use an electric saw to go to a new wooden farm without electricity ??
If you build a tool to solve the problem without studying its principles, make sure that you will have this tool around you in the future.
For example, if a real person wants to leave the city for the rest of his life, he only needs to know the road card tool, and does not need to know the lost view of the stars/the compass to identify the direction (alas, it is not easy to see the stars in the current city). but if you want to travel around, you are not sure whether you want to go to a new place or not, it is better to master the basic knowledge from a low level.
If you want to learn and improve your theoretical skills, let alone the "advanced and excellent" tools on your hands.
If you are not sure you can have concrete pre-fabricated parts, you should learn how to make it better.
I have never heard of players from Brazil, North Korea, and Iraq over the past few decades complaining about poor venues and poor lawns.
This is a metaphor .....
Understand the underlying layer and write the framework by yourself
I used to be similar to the landlord,
To solve these two problems,
I mainly use two methods,
1. learn c ++ again
2. I wrote a framework myself and improved my blog with my own framework.
Hope the landlord can get a satisfactory answer
Of course, you can try other frameworks and cms.