Become a PHP Expert: missing links, php experts missing Links _php Tutorial

Source: Internet
Author: User
Tags coding standards php language php development environment

Become a PHP Expert: missing links, missing links for PHP experts


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

When browsing a variety of PHP-related blogs, such as questions on 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 can I extend my messaging system to send more than 10,000 messages per hour without the need to introduce a new server? ”

I've divided PHP competency levels into 4 levels (which may be appropriate for any programming language or profession): Beginner, Intermediate, expert, and elite.

Grade

For PHP beginners, they learn how to use variables, include files, form processing, and so on. They learn the simple logical structure. Guided by 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 CSS files of WordPress. With this knowledge, they start looking for work, but unfortunately they usually fail.

An expert is one who has experienced many projects and has extensive experience. They have developed many commercial applications, but have not fully used the framework to do it. They are able to use PHP to develop efficiently with different databases and to discuss solutions to problems through meetings. They are familiar with design patterns and are able to easily implement project drawings in code. They are programmed away from the process.

Elite programmers are those who have worked hard for 10000+ hours to hone their professional skills. They can write an extension of PHP according to their needs, just look at the source code files to find bugs and know their code layout very well. They do only the most complex projects and are able to find alternative and creative solutions to solve 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 belongs to the intermediate?

The Missing link

How can a beginner become and surpass a professional? If a person does not know something 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 middle-level person.

The following list identifies the PHP learning path that a person needs to experience as an intermediate:

Give up spaghetti-style code

Many people think that using a class means writing object-oriented code, while using a function means writing procedural code. This is wrong, however, to support this view, we assume a widely circulated definition: Procedural code is code that does not use classes and objects, and OOP code is the code that uses classes and objects as much as possible.

My advice is to completely abandon the code. Use object-oriented style programming as much as possible-write classes, encapsulate logic, and consider using real-world terminology. The performance benefits of over-programming code are negligible compared to the reusability of the appropriate OOP code and the benefits that future developers can easily continue to develop in your project. The objection to this view is "However, WordPress is a process-style!" ”。 Frankly, this may sound a bit harsh, "WordPress developers" are not really PHP developers, like having Instagram will be a photographer. Please do not think that this means WP is useless-when you don't want to spend too much time developing a blog, simple site and a small project of the day, using WP development will surprise you. It's great for people who are anxious or don't have a lot of skills, but mastering WP will never make you a professional PHP developer-it uses spaghetti-style coding to teach you inappropriate design principles.

Start with the little things. Think about the concept of the real world and try to represent it in OOP code. Pass some basic tutorials and slowly master oop. Before transitioning to the appropriate framework and the terminology blurred by the park such as "model", "View" and "Controller", stick to oop thinking until you understand the class in general-all of which are foggy, and abstract terminology does not have a solid foundation in OOP.

Anatomy of an existing project

Go deep into the existing source code you can find. For example, view PHP projects on Github, clone them, deploy to your own host, and try to read the code. Every single file, every line, until you understand what they do.

Look for projects with normative comments, good structure, and ongoing development. Projects that were updated before 2008 are not too good, if you're going to start using PHP5.5-otherwise you might miss out on PHP's newest and strongest features that will 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 environment not only allows you to make minor adjustments based on the actual situation, but also allows you to familiarize yourself with how to build extensions from source code.

Abandon development on Windows-if your primary desktop environment is windows, then installing a virtual software and running a Linux virtual machine-windows is not case-sensitive, its line terminator, and some other things do not match most of the server environment, Developing on Windows is a lot of trouble, so it's best to develop on a system where you end up running your project.

Virtual machines can also help you with some experimentation-if an error occurs, you can start over or roll back. Try as low as you can, 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 make you familiar with different servers-whether you use Apache or Nginx, or use AppServer.

Best practices early on

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

A good IDE is also well worth it-using a cross-platform editor can help you build a new development environment at any time, ensuring that you focus on writing code rather than wasting time on modifying keyboard shortcuts and themes. Make sure you back up the IDE's configuration files to Google Cloud services and so on, so you can import your profile at any time for a fresh installation. A good IDE is phpstorm, or if you can't afford it, or you don't have an open source project that requires free licensing, NetBeans is a good choice, and both are cross-platform.

Early best practices will help you keep your code consistent, and others will be able to read your code more smoothly. Find your style and stick to it-you will help not just 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, which make everyone's code good for reusability and readability.

For a beginner very good and constantly updated resources are 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, and even more.

Try a different frame, and then select a

For a long time, PHP is the language used by most frameworks (most recently JavaScript has become the most). Whether this means that our community or language is not as popular as it is, I can't tell, but the fact remains that choosing a framework is a daunting task, especially the first time you start choosing.

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 is installed as an extension of PHP (and therefore faster than any frame today). However, it is necessary to try out different frameworks for yourself.

When you try different frameworks, you will find that the same problem can be solved in a new way. Each framework has the advantages you like and the drawbacks you dislike, but more importantly, you will be able to understand the mindset of others (especially the developer of the framework). You will see new usages and methods, and the best practice is to refactor the same experimental project with as many frames as possible. This will help you to 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 insisting, it doesn't take as much time as you think. Find a good blog and follow it, read this site's guide, Traverse StackOverflow's Questions and answers, visit the SitePoint Forum, subscribe to newsletters, and follow the good resources on Google +. Avoid basic PHP tutorial Books-because they're obsolete when they're published-instead, focus on the snippets and guides you can find on the web that contain the latest code. Even if you have a topic you've already learned, try reading it-by reading other people's views on the same issue, you'll often find something new.

If there's nothing to do, try to create some

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

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 keep your interests and participation enthusiastic. Make a simple Address book app. Then rebuild it with a different frame. and use different databases (for example, using MONGO instead of MARIADB). Stay busy!

Find a partner/mentor

If someone can be with you, learning will become easier. Find a partner who can share your passion with you. Maybe you are one of the lucky few, already have a partner to share your unique interests. Maybe you have a colleague in school or college who is willing to start and study hard with you. You can even find a mentor and receive expert guidance.

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

Summarize

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

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

Original link: SitePoint translation: Bole online-rokety

http://www.bkjia.com/PHPjc/937010.html www.bkjia.com true http://www.bkjia.com/PHPjc/937010.html techarticle Become a PHP Expert: missing links, PHP experts missing links This article is the 1th in the Becoming a PHP Professional Series 4 blog posts. When browsing the various PHP-related blogs ...

  • 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.