Home  >  Article  >  Backend Development  >  How to become a professional PHP developer

How to become a professional PHP developer

WBOY
WBOYOriginal
2016-07-25 08:46:281076browse

How to become a professional php developer? Senior web developer Bruno Skvorc shared some insights on his blog.

How to become a professional PHP developer

While reading various PHP-related blogs, Quora questions, Google+ communities, news and magazines, Bruno Skvorc noticed that the issues discussed were polarized. For example, "How do I connect to a mysql database?", or "How do I enable my email system to send more than one million emails per hour without adding more servers?"

Bruno Skvorc divides users into four categories based on their ability to use PHP: Beginner, Intermediate, Professional and Elite.

bipolar

In PHP language, beginner users will use some variables, includes, form processing, etc. You will also learn some simple logical structures. With the help of tutorials, they can send emails using PHP, and they may even be exposed to some examples of object-oriented programming, but of course they may not necessarily understand the principles behind it. They use WordPress and modify some CSS classes. They apply for jobs with this knowledge and are unfortunately rejected.

PHP professional users can bring many projects to life. They use many frameworks to develop business applications, use various databases efficiently, attend various seminars, learn various design patterns, and easily develop a complete project - from process design to final operation. They have long since moved away from the procedural programming paradigm.

Elite programmers are professionals who have been trained for 10,000+ hours in the legend. They write their own extensions to expand the functions of PHP they deploy. They can catch bugs with just a cursory glance at the source files. They are extremely particular about code layout and only approve. On extremely complex projects, creative alternatives are found to solve problems before others are aware of them. They will also write some best-selling books about the PHP language, speak at numerous seminars, and even create their own fork of PHP or one or two very successful frameworks.

So, where are those intermediate users?

missing link

How does a programmer advance from junior to professional level or even higher? If a person only has basic programming knowledge, how can he improve his skills, abandon bad practices, and use advanced methods to practice? Bruno Skvorc is often asked this question by beginners. If you want to become a professional programmer, you must first become an intermediate PHP programmer.

The following list points out some aspects you need to pay attention to when using PHP smoothly:

Give up spaghetti code

Many people think that using classes means writing object-oriented code, while using functions means writing procedural code. Big mistake! Let's review the broad definition: procedural code is code that doesn't use classes and objects, and object-oriented code is code that uses as many classes and objects as possible.

Bruno Skvorc’s advice is to abandon procedural code entirely. Use object-oriented style as much as possible - write classes, encapsulate logic, think in real-world terms. Considering reusability, the performance advantage of procedural code over class-based code is negligible. Proper OOP code allows future developers to take over your project. Usually people will retort like this: "But WordPress is procedural!" To be honest (perhaps unpleasant), if the developers of WordPress are PHP developers, then the developers of Instagram are photographers. That doesn’t mean WP isn’t useful – for blogs, simple websites, and one-day projects, WP is great. You can make some money quickly with WP, and it is also very useful for users who are not very technical. But being proficient in WP does not mean you are a professional PHP developer - it is just a bunch of spaghetti code that cannot teach you reasonable design principles.

Start from small things. Think about real-world concepts and try to express them in object-oriented code. Learn some basic tutorials and then slowly progress to advanced levels. Practice object-oriented programming until you really understand classes. Before that, don’t rush to learn various frameworks and abstract terms like MVC.

Delve into existing projects

No matter where you see the source code, study it carefully. For example, find a PHP project in Github, clone it, deploy it on your own machine, and try to modify it. Go from file to file, line to line, until you really understand what they mean.

Learn to build a PHP environment

Building a PHP environment is also a valuable skill. Not only does this allow you to tweak and optimize your own configuration, but it also allows you to become familiar with building plugins from source.

Don’t develop on Windows - if your primary desktop is Windows, you need to install a virtual machine software and then run a Linux virtual machine - Windows has case sensitivity, line endings, and other quirks than most server environments , will cause you trouble. So it's best to develop in an environment similar to the server.

Virtual machines are also good for experimentation - if something goes wrong, you can start over or roll back. You can also experiment without worrying about messing everything up. Knowing how to use the tools is important, but having a good work surface is equally important.

Experimenting with your own environment can also make you familiar with different servers - whether to use Nginx or Apache, or use Appserver, etc.

Apply best practices early

When writing your own code, make sure to comment it in detail, indent it perfectly, and structure it carefully. After building a class, project, and library, use well-known documentation tools (PHPDocumentor, ApiGen) to extract documentation and improve upon it.

A good IDE is valuable. Being familiar with a cross-platform editor will help you get into the code immediately after setting up a new environment, instead of wasting time on setting keyboard shortcuts and themes. Make sure you save the IDE configuration files in the cloud, (e.g. Google Drive) so you can easily import them even if you have a new installation of the system. Bruno Skvorc recommends PHPStorm and Netbeans, two cross-platform IDEs, the latter of which is free.

Adapting to best practices early can help you stay consistent in the project process and help others read your code fluently. Find your style and stick to it - it will be good for you and others. Follow PSR standards (PSR-0, PSR-1, PSR-2, PSR-3) as strictly as possible. Standards are not just in name. Most people follow these standards and love them because they increase the reusability and readability of everyone's code.

For beginners, The Tao of PHP is a very useful resource that provides timely guidance. Through this book, you can become familiar with the latest best practices, basic concepts of object-oriented, security, deployment, coding standards, etc.

Make your choice after trying different frameworks

For a long time, PHP was the programming language with the most frameworks (JavaScript has caught up recently). It's hard to tell whether this means the division of the community or the popularity of the language. But the truth is, choosing a framework can be a confusing thing, especially when you are just starting out.

After trying out most frameworks, Bruno Skvorc recommends the stable and high-quality Phalcon framework. In fact, Phalcon is written in C language and can be installed as a PHP extension, so it is faster than existing frameworks. Regardless, it's definitely worth trying out different frameworks.

When you try different frameworks, you learn new ways to solve common problems every time. Each framework has its own features and pitfalls, but the most important thing is that you can learn the ideas of others (mainly framework developers). You'll be exposed to new usages and approaches, and it's a great exercise to refactor your projects using all the frameworks you can find. This will help you effectively measure the efficiency of a particular framework: speed and performance of development.

read

Never ignore tips and suggestions given to you by others. Read as much as you can. Subscribe to good blogs, read tutorials on websites, read Q&A on StackOverflow, subscribe to mailing lists, and follow high-quality resources on Google+. But avoid PHP basic tutorial books, they will become outdated quickly. Instead, focus on useful, up-to-date code snippets and tutorials online. Even topics you've already touched upon can be read again, and you can often gain new ideas from someone else's perspective.

If there are no jobs, invent some

Alwaysthere is something to do. Never say to yourself, "I don't have a project." Don't ever say to yourself, "I'm bored." If you can't find a project to work on, start a new one. Are you frustrated because the tools you use every day lack a certain feature? Make a better alternative! No ideas for new products? Then iterate on existing ideas - try rebuilding a basic Facebook, recreating some projects you already know to practice.

The most important thing is to never stop - if you stop, you won’t have an amazing 10,000 hours! Keep working, maintain your interest, and keep investing. Make a simple address book application. Then refactor it using another framework. Then change the database (such as MariaDB to Mongo). Stay busy!

Find a partner or mentor

It’s easier to learn when you work with others. Find a partner who shares your passion. Maybe you're one of the lucky few to find a partner who shares your geeky interests. Maybe you can find a companion in school who wants to start studying and also needs a partner. You can even find a mentor and get some professional guidance.

Never underestimate the power of companionship!

in conclusion

When you focus on practicing the various methods mentioned above, you are on the way to becoming a professional PHP developer. Stick to your principles, never give up (even if others around you do), and keep practicing.

Original text ecoming a PHP Professional: The Missing Link

Compile SegmentFault

PHP


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn