If PHP is a _php tutorial written in British English

Source: Internet
Author: User
Tags vars
PHP's father, Rasmus Lerdorf, when he created PHP, was not written in either Greenland or Danish (though he had Greenland and Danish descent), which was very sensible. Although it was written in English for him, it was not easy to write in his native language. As he had been in Canada before, he chose the local dialect. It is not French, nor is it a dialect that is not in the pure English standard, we often call it "American English".

Since then, British PHP developers have been particularly dissatisfied with the issue. What is Rasmus thinking? More importantly, how do we change this fact? How can our developers ensure that even in the digital age, the fine traditions of the Daying Empire continue to flourish?

A slap in the face

 
  
  

The most necessary change is to remove some of the symbols that are well-liked by Americans and replace them with some more refined symbols to make PHP more elegant.

 
  
  

Let's go

 
  
  
  1. Php
  2. Echo ' Hello world! ';
  3. ?>

How many of today's British programmers are initially exposed to the "Hello world", a typical American program, albeit simple but trite and disgusting? A more formal presentation would promote the use of the language by most young British geniuses, This provides a more refined atmosphere for the wider user base.

 
  
  
  1. Php
  2. Announce ' good Morrow, fellow subjects of the Crown.
  3. ?>

Abbreviated words

Nothing is more hateful to the English than the unnecessary abbreviations. "Abbreviations" are unheard of in the streets of London, as native British grammars refuse to send a "C u soon traffic Kthxbye" message, preferring to use some seemingly more refined words instead: "Dear sir or Madam." As long as the time allows, I hope to arrive within one hours as soon as possible. I assure you that your horses will be properly placed. to the King. (The input is slow, yes, but not hasty).

On the other hand, PHP contains a lot of needless acronyms and acronyms.

 
  
  
  1. Str_replace ()
  2. Is_int ()
  3. Var_dump ()
  4. Preg_match ()
  5. Json_encode ()

It should be changed to the following:

 
  
  
  1. String_replace ()
  2. Is_integer ()
  3. Variable_dump ()
  4. Perl_regular_expression_match ()
  5. Javascript_object_notation_encode ()

Correction: I have corrected the extension of "preg_match"--thanks to the friends who are pointing out.

Eloquence

 
  
  
  1. if ($condition) {
  2. Else {

Shakespeare did not want to see his mother tongue twisted into this monster. Brevity is popular in the right places-not necessarily in some remote areas-but not here. The "If ... else" module is the most used condition code in PHP, so it must be as safe to use as possible. There are many options to replace, but this conditional statement may be the most robust.

 
  
  
  1. Perchance (£condition) {
  2. } otherwise {

The above modules also apply to the United States, can only be said to be cumbersome, people hate switch ... case concept,

 
 
  1. Switch ($variable) {
  2. Case $option 1:
  3. //code here
  4. Break ;
  5. Case $option 2:
  6. //code here
  7. Break ;
  8. default :
  9. //code here
  10. Break ;
  11. }

Keywords such as "switch", "Break" and "default" are difficult and lack of contact for the reader. This American usage really needs to be improved. (People who use American usage have some interesting ideas and expect to use I_MIGHT_BE_PARTIAL_TO () instead of include () to show their genius programming talent):

 
  
  
  1. What_about (£variable) {
  2. Perhaps£possibility:
  3. Splendid
  4. Perhaps£other_possibility:
  5. Splendid
  6. On_the_off_chance:
  7. Splendid

Spelling

 
  
  
  1. Imagecolorallocate ()
  2. Serialize ()
  3. Newt_centered_window ()

At this point, the words let me eat a lot of losses. The self-respecting gentleman looked forward to understanding the words. It weakens the belief that anyone accepts the distorted meaning of words in a programming language. These "words" and many similar errors should be returned to the appropriate form immediately.

 
  
  
  1. Imagecolourallocate ()
  2. Serialise ()
  3. Newt_centred_window ()

Habit

 
  
  
  1. try {
  2. $e ) {
  3. die (' Message ');

The try ... catch statement block is a good proof of the lack of PHP features. The new PHP is too straightforward to allow the module to be used, and lacks the necessary limitations. In addition, the word "die" is frustrating. This new module, though more verbose, is more elegant and optimistic.

 
  
  
  1. Would_you_mind {
  2. } actually_i_do_mind (Exception£e) {
  3. cheerio (' Message ');

Class

In the English mind, nothing is as important and ingrained as the concept of the class, and this part of PHP rarely changes unless it is a significant change made here.

 
  
  
  1. class Republic {
  2. public $a ;
  3. private $ b ;
  4. protected $c span>;
  5. }
  6. $example = new Republic;

First, there is no room for class hierarchies in the popular system, which is unacceptable. So we should first give the class A certain level-upper, middle, working (upper, middle, working)-the class cannot use a more advanced class method without explicit permission from the higher class directive (although, of course, even though it has later visited a more advanced class, However, it is not a full member of the more advanced directives and cannot be granted more advanced instructions for accessing other low-level instruction classes. "Public" and "private" are synonyms in the English class system (for example, the school system is named), so these must be adjusted, and the attribute visibility of "protected" is the same. The word "new", although feasible, requires a more appropriate word to be substituted for the class problem.

 
  
  
  1. Upper_class Empire {
  2. State£a;
  3. Private £b;
  4. Hereditary£c;
  5. }

The day does not fall ...

Hopefully these few simple changes will improve PHP's reputation and position in many programming languages. It is no longer a distant cousin of a lame American. Instead, it can return to the embrace of the British, the King of scripting languages.

English Original:

http://www.bkjia.com/PHPjc/445711.html www.bkjia.com true http://www.bkjia.com/PHPjc/445711.html techarticle PHP's father, Rasmus Lerdorf, when he created PHP, was not written in either Greenland or Danish (though he had Greenland and Danish descent), which was very sensible. Although for him to use English ...

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