Home > Article > Backend Development > How to become a PHP expert? , a PHP expert?_PHP Tutorial
When browsing various PHP-related blogs, such as questions on Quora, Google groups, newsletters, and magazines, I often notice a hierarchy of skills. Questions are similar to "How do I connect to a MySQL database?" or "How do I scale my email system to send more than 10,000 emails per hour without introducing a new server?"
I divide PHP competency levels into 4 levels (which may apply to any programming language or major): Beginner, Intermediate, Expert, and Elite.
For PHP beginners, they learn how to use variables, include files, form processing, etc. They learn simple logical structures. Under the guidance of the tutorial, I implemented sending emails with PHP, and even touched on object-oriented programming without fully understanding it. They can also modify several WordPress CSS files. Armed with this knowledge, they start looking for jobs, but unfortunately usually fail.
Experts are those who have gone through many projects and have rich experience. They have developed many commercial applications, but not entirely using frameworks to do so. They are able to use PHP to develop efficiently with different databases, as well as discuss solutions to problems through meetings. They are familiar with design patterns and can easily implement the project's engineering drawings into code. They stay away from programming procedurally.
Elite programmers are those who have worked 10,000+ hours to hone their professional skills. They can write PHP extensions according to their needs, can find bugs just by looking at the source code files, and understand their code layout very well. They work on only the most complex projects and are able to find alternative and creative solutions to problems. They have written some popular books on programming languages, given dozens of lectures, and may even have their own version of the PHP language or a highly successful framework, or both.
So, who belongs to the intermediate level?
How can beginners become and surpass professionals? If a person doesn't know anything beyond the basics, how can he improve his skills, abandon wrong development methods and learn more advanced development methods. This question has been asked to me by many beginners. In order to become an expert, he must first become an intermediate.
The following list points out the PHP learning journey that a person needs to go through to become an intermediate person:
Many people think that using classes means writing object-oriented code, while using functions means writing procedural code. However, this is wrong. To support this point of view, we assume a widely circulated definition: procedural code is code that does not use classes and objects, while OOP code is code that uses classes and objects as much as possible.
My suggestion is to abandon procedural code completely. Program in an object-oriented style whenever possible - write classes, encapsulate logic, think about using real-world terminology. The performance benefits of procedural code pale in comparison to the reusability benefits that proper OOP code gives you and the ease with which future developers can continue to work on your project. The objection to this point of view is "But, WordPress is procedural!". Frankly, this may sound a bit harsh, but a "WordPress developer" is not really a PHP developer, just like having an Instagram would make you a photographer. Please don’t take this to mean that WP is useless — when you don’t expect to spend too much time developing a blog, a simple site, and small one-day projects, developing with WP will do wonders for you. It's great for people who are in a hurry or don't have a lot of skills, but mastering WP will never make you a professional PHP developer - it uses spaghetti coding and teaches you inappropriate design principles.
Start from small things. Think of a real world concept and try to represent it in OOP code. Go through some basic tutorials and slowly become proficient in OOP. Stick with writing code in OOP thinking until you understand classes in general, before transitioning to the proper frameworks and confusing terms like "model", "view" and "controller" - all of which are in the clouds. Abstract terms have no solid foundation in OOP.
Dig into the existing source code you can find. For example, check out PHP projects on Github, clone them, deploy to your own host and try to read the code. Every file, every line until you understand what they do.
Look for projects with standardized annotations, good structure, and ongoing development. Projects updated before 2008 aren't that great if you're going to start using PHP 5.5 - otherwise you might miss out on PHP's latest and greatest features that can make you stand out in an already overpopulated field.
If you can create your own environment, it is a very good ability. Building your own environment not only allows you to make minor adjustments based on your situation, but it also allows you to become familiar with building extensions from source code.
Give up developing on Windows - If your main desktop environment is Windows, install virtualization software and run a Linux virtual machine - Windows is case-insensitive, its line endings, and other things are different from capital letters. Most server environments don't match that, and developing on Windows will just cause a lot of trouble, so it's best to develop on a system where you will eventually run the project.
A virtual machine can also help you conduct some experiments - if something goes wrong, you can start over or roll back. You can try as low as you want without worrying about messing up. It’s important to master the tools, but it’s also important to have a good working platform.
Conducting experiments on your own will also allow you to become familiar with different servers—whether you use Apache or Nginx, or use Appserver, etc.
When writing code, make sure you have ample documentation comments, nice indentation, and good structure. When you build a class, project or library, use well-known documentation tools (PHPDocumentor, ApiGen) to extract your documentation comments and improve them.
A good IDE is also very worthwhile - using a cross-platform editor can help you set up a new development environment at any time, ensuring that you can focus on writing code rather than wasting time on modifying the keyboard Shortcut keys and themes. Make sure you back up the IDE's configuration files to a place like Google Cloud Services so you can import your configuration files for a fresh installation at any time. A good IDE is PHPStorm, or if you can't afford it, or don't have an open source project that requires a free license, Netbeans is a good choice, and both are cross-platform.
Implementing best practices early will help your code stay consistent and help others read your code more smoothly. Find your style and stick to it - you'll help not only yourself, but others as well. Try to follow the PSR standards (PSR-0, PSR-1, PSR-2, PSR-3) - they are standards for a reason. Most of us use and love these standards, which make everyone's code reusable and readable.
A great and constantly updated resource for a beginner is PHP the right way — learn it and you’ll be familiar with the latest practices, basic OOP, security, deployment, coding standards and more that I’ve mentioned and more .
For a long time, PHP has been the language used by most frameworks (recently JavaScript has become the most used). Whether this is a reflection of our community or the inconsistent popularity of the language, I can't tell, but the fact remains that choosing a framework can be a daunting task, especially when starting out for the first time.
Having tried most of them, I can wholeheartedly recommend the Phalcon framework due to its robustness and quality, as well as the fact that it is written in C and installed as an extension to PHP (thus more powerful than Any framework today is faster). However, it’s worth trying out different frameworks yourself.
When you try different frameworks, you will find that the same problems can be solved in new ways. Each framework has advantages that you like and disadvantages that you hate, but more importantly, you will learn about the mentality of others (especially the developers of the framework). You'll see new usages and approaches, and best practice is to refactor the same experimental project using as many frameworks as possible. This will help you effectively measure the efficacy of a particular framework: the speed of development using it and its performance.
Don’t underestimate other people’s tips and tricks. Read as much as you can—if you stick with it, it won't take as long as you think. Find a good blog and follow it, read the site's guide, browse the StackOverflow questions and answers, visit the SitePoint forum, subscribe to the newsletter, and follow good resources on Google+. Avoid basic PHP tutorial books—as they are out of date by the time they are published—instead, focus on snippets and guides you can find online that contain the latest code. Even if you come across a topic you've already studied, try reading about it—you'll often discover something new by reading other people's perspectives on the same subject.
There is always something to do. Never say “I have no projects to work on” or worse “I’m bored”. If you don’t have an ongoing project to work on—create one. Are you frustrated by a tool you use every day because of its imperfect functionality? Make a better one yourself! No ideas for new products? Then make a copy of an existing one - try rebuilding a basic FaceBook, rebuilding something you already know, just to be able to practice it.
The most important thing is to never stop - if you don’t cherish every hour, you won’t be able to accumulate 10,000 hours! Keep up the good work and keep yourself interested and engaged. Make a simple address book application. Then rebuild it using another frame. And use a different database (e.g. Mongo instead of MariaDB). Stay busy!
Studying becomes easier if you have someone with you. Find a partner who shares your passion. Maybe you're one of the lucky few who already has a partner who shares your unique interests. Maybe you have a peer in school or college who would love to start and work hard with you. You can even find a mentor and receive guidance from experts.
Don’t underestimate the power of a partner—there will always be a teacher among us when we are together!
When you focus on all of these items and master them as much as possible, when you realize that this is what you want, then keep at it—you are on your way to becoming an advanced PHP developer. Maintain your principles, never give up (even if someone around you does) and keep practicing.
If you have some useful resources and would like to share with us how you crossed (or are crossing) the intermediate developer barrier, please leave a comment below and let us know!
Original link: SitePoint Translation: Bole Online - rokety
PHP has a low threshold, but how many people have touched its ceiling?
It is important to learn the basic skills of PHP. It is best to have learning experience in data structures.
For novices who are 1 or 2 years old. Must fully master
smarty+pear+adodb+xml+ajax+jquery(prototype)
within 2 years. Then it is recommended to be proficient in analyzing domestic and foreign open source codes, such as: discuz, zendcart, etc. and many more.
Tool class must be proficient in the development of zend studio.
The database must be proficient in mysql & sqlserver
The operating system must have a certain understanding of liunx. And can configure the environment.
You should also buy the administrator manual for apache and read it carefully.
The above is the content that must be mastered within 2 years. At this time, you have basically got started. It’s not too hard to go to a work unit to do anything
In the third year, you need to enrich your thinking. If you don’t have .NET or JAVA development experience, please make up for it. Because the ideas of .NET and JAVA are much more mature than PHP, learning SQLSERVER is also to improve the usage level of mysql. Database is not simply a matter of creating a table and querying it.
So in my third year of Jianyi, I added more ideas and database content. But this does not mean that you will not watch it in the first two years. I mean year three is more of that. Because at this time, you already know many basic parts of PHP, and then you need an overall improvement, rather than a one-sided improvement.
At this time, you have to consider architectural issues.
In the fourth year, when you deploy a large project. Deployment issues such as load and file distribution and security are coming one after another. At this time, you have to work hard to understand what a file server cluster is, what a web server cluster is, what a database cluster is, etc. Then what are the requirements for improving your coding, security requirements, etc.
The key to persistence in PHP is to first learn the basic grammar, develop good habits, learn to unset (variable), and learn object = NULL. Learn to configure lamp wamp, learn to use development tools NB, zend studio... Then read the function encyclopedia mysql object-oriented programming method and then learn how to optimize your php code, how to optimize sql query smarty template engine mvc framework such as domestic thinkphp is very good. It has more lightweight Chinese information and follows zend framework (a very huge framework) memcached.......Don't think that php can only do web applications. There are banks in foreign countries that use php cli. Background service. If you want to be at the high end, learn C. Use it to develop PHP extensions and learn Facebook’s hiphop PHP (the project of converting PHP to C++ makes the PHP speed infinitely close to CGI written directly in C). Learn more databases.... Learn Later you will find that PHP is not as simple as you think and there is no end to learning (you have to check it out after PHP 5.3 starts to support namespaces). It was a bit messy at night, but that's basically it. If you want to learn, don't hesitate and don't trust what others say. Why is PHP only suitable for small projects? The newly developed Friends Network by Tencent is written in PHP. Websites like Facebook are all written in PHP.
Remember to accept it