From Java to PHP

Source: Internet
Author: User

began to touch the language of Java since Freshman. But before this also contacted Vb,c,asp and so on development language, but Java makes people feel rigorous, refreshing, all kinds of data between the not Muddy. This only takes more time to study Him. But learn to learn, find his system of large, branch a Lot. In the beginning of the time did not stay, the results of the study cycle is too long, in the production environment practice is not Much.

Take ssh, it took a whole year to study, but the company from the beginning to the end did not go to use this, said is too bloated, slow response, difficult to deploy and Debug. At this point, after 5, 6 years and finally did not have the Useful. Production environment, has been the use of jsp+jquery for development, The core framework is the Company's own Development.

Learn and use the process of java, we must have a fixed force, do not casually be his new technology to attract a variety of areas, the best choice is a field, in-depth research, so that can be harvested, otherwise, every thing to try, the result time spent, the final long time to use, is not worth the Candle. If really want to and research, suggest not behind closed doors, oneself a person to blindly pondering, gather a group of like-minded friends, will a big can窝窝头pickles to chew, and then Exchange Experiences. For example, just mentioned in ssh, the content of information is too large, to study the source of the words of a person estimated that it will take at least a year or two to Study. Although we do not use the production environment, but a few people separately on the part of the study, and then discuss, the effect will be very good.

It was also a chance to learn from a friend that he was using PHP and was not very fond of his grammar and development patterns at First. grammar, each time to precede the variable with a "$" symbol, people feel very awkward. Basically a lot of content is directly mixed with html, a particularly confusing feeling.

But after some projects, I found that Java is rigorous, the slightest leak. But every development needs to be a variety of frameworks, all kinds of classes, put a good shelf and then carry out the development of specific content, or the back is a mess. PHP is a way to get rid of this, because he has both the structural language and the object-oriented language features. Small Web sites can be directly and quickly structured development, local content to oo on the LINE. So let's get the project to work Quickly.

In addition, in the learning cycle is indeed relatively short, a little programming base can be in less than a week to get started, and can be production Development.

PHP also offers a number of flexible language constructs that make the code look more efficient and compact. For example, the use of mutable variables and variable functions.

<?php

function Get_pen () {

Echo "We get a pen.";

}

function Get_pencil () {

Echo "We get a pencil.";

}

?>

User gives us a parameter $tool, representing a pen or pencil


The first method of Invocation:


if ($tool = = "pen") {

Get_pen ();

}elseif ($tool = = "pencil") {

Get_pencil ();

}


The second method of Invocation:

$getsth = "get_". $tool;

$getsth ();


Originally need to write a large piece of code, here only need a simple stitching on the LINE. This usage exists extensively in php, greatly simplifying our development process and improving development efficiency.

Because of the many such excellent features of php, coupled with his own continuous development, makes him more and more popular. It's just too addictive, isn't it?

From Java to PHP

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.