To be a part of what a PHP expert needs to experience

Source: Internet
Author: User
Keywords Become myself if or

This article is the 1th of 4 posts in the "Becoming a PHP Professional" series.

When browsing various PHP-related blogs, such as Quora, Google Groups, newsletters, and magazines, I often notice the level of skill differentiation. The question is similar to "How do I connect to the MySQL database?" Or how do I extend my messaging system to send more than 10,000 messages per hour without introducing new servers? ”

I divide PHP capabilities into 4 levels (which may apply to any programming language or specialty): Beginner, mid-level, expert, and elite.

Level

For beginners in PHP, they learn how to use variables, include files, form processing, and so on. They learn simple logical structures. Under the guidance of the tutorial, the implementation of the use of PHP to send mail, and even touched the object-oriented programming but did not fully understand it. They can also modify several wordpress CSS files. With this knowledge, they start looking for jobs, but unfortunately they usually fail.

Experts refer to those who have experienced many projects and have experienced them. They have developed many commercial applications, but have not fully used the framework to do so. They are able to use PHP to efficiently develop with different databases, and to discuss solutions to problems through meetings. They are familiar with design patterns and can easily implement project drawings with code. They are far away from procedural programming.

Elite programmers are those who have worked 10000+ hours to hone their professional skills. They are able to write extensions to their own needs, just a look at the source code files to find bugs and know their code layout very well. They do only the most complex projects and can find alternative and creative solutions to the problem. They have written some popular books on programming languages, held dozens of lectures, and may even have their own PHP language version or a very successful framework, or both.

So, who is the intermediate?

Missing link

How can beginners become and surpass professionals? If a person does not know what is beyond the basics, how can he improve his skills, abandon the wrong way of development and learn more advanced development methods. This is a question that many beginners have asked me. In order to become an expert, he must first become a mid-level person.

The following list shows the PHP learning path for a person to be intermediate:

Give up spaghetti code

Many people think that using a class means writing object-oriented code, and using a function means writing procedural code. This is wrong, however, in order to support this view, let's assume a widespread definition: Procedural code is code that doesn't use classes and objects, and OOP code is the code that uses classes and objects as much as possible.

My advice is to completely discard code. Use object-oriented style programming as much as possible-write classes, encapsulate logic, and consider using real-world terminology. The performance advantage of the code is negligible compared to the reusability that the appropriate OOP code brings to you and the benefits that future developers can easily continue to develop on your project. The opposing voice for this view is "but, WordPress is a procedural!" ”。 Frankly speaking, this may sound harsh, "WordPress developer" is not a real PHP developer, like having a Instagram will be the same as the photographer. Please do not think that this means that WP is useless-when you don't want to spend too much time developing a blog, a simple site and a one-day small project, using WP development will surprise you. It is ideal for people who are impatient for haste or not much technology, but mastering WP will never make you a professional PHP developer-it uses spaghetti code to teach you the wrong design principles.

Start with the little things. Think about the concept of the real world and try to represent it in OOP code. Through some basic tutorials and slowly mastering oop. Before transitioning to the appropriate framework and the plain blurred terminology such as "model", "View" and "Controller", stick with oop thinking to write code until you generally understand the class-all of which are foggy, and abstract terminology has no solid foundation in OOP.

Profiling existing Projects

Go deep into the existing source code you can find. For example, view the 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 are doing.

Look for projects that have a normative annotation, are well structured and are still being developed. Projects that were updated before 2008 are not too good, if you want to start using PHP5.5-otherwise you may miss out on the latest and most powerful features of PHP that can make you stand out in an already overpopulated field.

Learn to build your own PHP development environment

If you can build your own environment is very good ability. Setting up your own environment not only allows you to make minor adjustments to the actual situation, but also makes you familiar with how to build extensions from source code.

Discard development on Windows-if your primary desktop environment is windows, install a virtual software and run a Linux virtual machine reinstates case-insensitive, its line terminator, and other things that do not match most server environments, Developing on Windows can only cause a lot of trouble, so it's best to develop on a system where you end up running your project.

The virtual machine can also help you with some experimentation-if there is an error, you can start again or roll back. You can try as little as possible, as long as you want, without worrying about messing things up. While mastering tools is important, it is also important to have a good working platform.

Experimenting on your own can also familiarize you with different servers-whether using Apache or Nginx, or using AppServer.

Best practices as early as possible

When writing code, make sure you have sufficient documentation comments, fine indentation and good structure. When you build a class, project, or library, use the well-known documentation tools (Phpdocumentor, Apigen) to extract and refine your documentation comments.

A good IDE is also worth it-using a cross-platform editor can help you create a new development environment at any time, ensuring that you focus on writing code instead of wasting time on modifying keyboard shortcuts and topics. Make sure you back up the IDE's profile to Google Cloud services and so on, so you can import your profile for a new installation at any time. A good IDE is phpstorm, or if you can't afford it, or if you don't have open source projects that require free permission, NetBeans is a good choice and both are cross-platform.

Doing best practices early can help keep your code consistent and others can read your code more smoothly. Find your style and stick to it-you will not only help yourself, but others. Try to follow the PSR standard (PSR-0, PSR-1, PSR-2, PSR-3)-they can be standard for a reason. Most of us use and love these standards, and it gives everyone's code a good reusability and readability.

A very good and constantly updated resource for a beginner is PHP the right way-learning it will be able to familiarize yourself with the latest practices, basic OOP, security, deployment, coding standards, etc. I mentioned, or even more.

Try a different frame and select a

PHP has long been the language used by most frameworks (most recently JavaScript). Whether this means that our community or language is not in the same fashion, I can't tell, but the fact remains that choosing a framework is a daunting task, especially for the first time.

Having tried most of these frameworks, I can wholeheartedly recommend the Phalcon framework because it has good robustness and quality, and in fact it is written in C and installed as a PHP extension (and therefore faster than any current framework). However, it is necessary to try different frameworks for yourself.

When you try out different frameworks, you will find that the same problem can be solved in a new way. Each frame has the advantages you like and the flaws you dislike, but more importantly, you will be able to learn about other people's mindset (especially the developer of the framework). You will see new usages and methods, and the best practice is to refactor the same experimental projects using as many frameworks as possible. This will help you effectively measure the effectiveness of a particular framework: the speed with which it is developed and its performance.

Don't underestimate the tips and tricks of others. Read as much as you can-if you keep holding on, it won't cost as much time as you think. Find a good blog and follow it, read the guide to the site, traverse StackOverflow questions and answers, visit the SitePoint Forum, subscribe to newsletters, and follow the good resources on Google +. Avoid basic PHP Tutorials-because they are outdated when they are published-instead, focus on the clips and guides you find on the Web that contain the latest code. Even if you have a topic you've already learned, try reading it-you often find something new by reading other people's opinions about the same problem.

If there is nothing to do, try to create some

There is always something to do. Never say "I don't have a project to do", or worse "I'm bored". If you don't have an ongoing project to do-create one. Does the tool you use every day make you feel frustrated because of its imperfect function? Make yourself a better one! No idea about the new product? Then copy an existing one-try rebuilding a basic Facebook and rebuilding something you already know in order to be able to practice.

The most important thing is never stop-if you do not cherish every one hours, you will not be able to accumulate to 10,000 hours! Continue to work hard to maintain your interest and enthusiasm for participation. Make a simple Address book application. Then rebuild it with another frame. and use different databases (for example, using MONGO instead of MARIADB). Keep busy!

Find a partner/mentor

It will be easier to learn if someone can join you. Find a partner who can share your passion. Perhaps you are one of the lucky few who have a partner who shares your unique interests. Maybe you have a colleague at school or college who would like to start with you and study hard. You can even find a mentor and receive expert guidance.

Do not underestimate the strength of a partner-three people will have my teacher!

Summary

When you focus on all these items and try to master them as much as you can, when you realize that this is what you want, stick to it-you're on your way to becoming an advanced PHP developer. Maintain the principle, never give up (even if someone around you gives up) and stick to practice.

If you have some useful resources and want to share with us how you crossed (or is crossing) intermediate developers, please leave a message below to let us know!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.