Some people say that mastering if and while is equivalent to mastering the PHP language. does this sentence make sense? Why? -Php Tutorial

Source: Internet
Author: User
Php Chinese network (www.php.cn) provides the most comprehensive basic tutorial on programming technology, introducing HTML, CSS, Javascript, Python, Java, Ruby, C, PHP, basic knowledge of MySQL and other programming languages. At the same time, this site also provides a large number of online instances, through which you can better learn programming... Reply: Bullshit. this is just like saying that "Mastering do and have is equivalent to mastering English. "Mastering if and while" and "using if while" are different, and many answers have converted "Mastering" into "using ".

First, if while represents the selection structure and the loop structure. The two are added with the order structure (no specific keywords), and the three are the cornerstones of any algorithm (language-independent), or, any algorithm can be implemented using these three logical structures, which has long been rigorously proven. Familiar with the three, there will be more than half of the country.

Second, mastering these skills does not mean to understand their basic syntax formats. this is just the beginning, as well as the various algorithms and related experience and skills involved in the expansion, the scope is quite wide. The word if while is no longer two syntaxes at this level, but represents the skillful use of the entire language.

These two words look very short, but they are actually very long. I don't think it makes sense. PHP contains many things. Well, this may only support basic syntax. this is the first step in learning PHP!
I personally think that learning PHP is divided into several levels:
1. Basic syntax
This can be said to be a horse step in the course of practice, and the Foundation must be solid. You can read other things only when you are solid. 2. PHP + MYSQL
PHP and database are the best choice. it is best to have time to learn about the other two, Linux and apache.
3. object-oriented
This is even more important. maybe these have been involved in the basic syntax. However, object-oriented is far from simply defining several classes. it is as simple as defining several methods. This is an idea. Sometimes it is a function, but it is a very good object-oriented practice. this is about open-source CMS drupal.

4. design mode
By learning this, you can improve the readability and scalability of your code by simply implementing your code. It can better work with others.
5. Template engine
Famous there is Smarty, you can look at the official site of the manual http://www.smarty.net/ Or download the manual from some forums. The template engine can be used to separate PHP from the foreground interface.
6. secondary development
For example, most forums and blogs are developed twice. Discuz !, Wordpress and phpwind. You can write some plug-ins or themes and contribute them to open-source organizations for your study and discussion.
7. use the framework for development
Such as ZendFramework, YiiPHP, and CI. The PHP framework is indeed a good thing, which can greatly reduce repetitive workload. it is often a collection of the wisdom of N programmers and a rare learning material.
8. if you use the template engine of Smarty in step 1, you can read the code of Smarty now (the premise is that Step 3 and 4 are better done ), then, read the data in step 1.
9. develop your own mature framework or PHP application. The programs written after this format are not as well as those written in step 1, because you need to learn the advantages of some open-source program frameworks. At this time, the performance and scalability of your program will be greatly improved.
9. you will find that some things cannot be solved by the program.
10 studying the underlying technology is not a simple PHP programmer at this time.
These things come from an article I saw on the internet. I have added some of my own understandings, and it seems quite reasonable.


Judgment and loop are the essence of each language and the most used knowledge, but not all of them have been learned. in this way, I always feel a little bit inferior to php..

It is terrible for programmers who only consider implementing functions. It will bury N holes in the code. Performance problems. Maintenance problems. Security issues. Logic problems.
Reference a programmer's definition
I think there are only three good programs:
1. excellent performance. performance is an important feature of a program. almost all applications, such as office software, anti-virus software, games, and web, are very performance-oriented. No one prefers slow software, we have learned computer Principles, Algorithms, Data Structures, various xx performance optimizations, various xx tuning, various high-performance xxx, various xx programming Arts, various architectures, and distributed architectures, what is the ultimate goal of parallel computing? It is for good performance. to put it bluntly, it is for program efficiency.
2. easy maintenance: The program is not static, and maintenance is also very important. what kind of code is clean and tidy? programmers are good at it. The greatest truths are simplicity, software engineering, design pattern, and reconstruction, concepts such as REST, AOP, IOC, object-oriented, UML, document-driven development, and other methods are designed to make the program code more elegant, more reasonable, and easier to change, better maintenance in the future.
3. good robustness: as a good program, there must be fewer bugs. this is a must and a good solution should be provided for various reasonable and unreasonable operations of users, we learn various testing technologies, various programming ideas, security technologies, cryptography, various high availability, various master-slave architectures, and various backup technologies to ensure that our programs run well, whether it's users' misoperations or malicious attacks, our programs can face both natural disasters and man-made disasters with ease.
I wrote the code for eight years and used the while command to count all my hands .... Thank you for your invitation.
If while and other judgment statements are very commonly used in many programming languages, but they do not mean that they even master the language, which is just the basis.
I personally think this sentence is probably intended to show that php is easy to learn, but it is also misleading. if it is just the language itself, it makes sense.

However, advanced languages (such as PHP, Java, C #, and Ruby) are more important than other languages, for example, library, mode, optimization, etc. For those familiar with FP, this sentence is correct, and others do not know.

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.