Forum Moderator
Forum Moderator
  • UID555
  • Fans14
  • Follows2
  • Posts69

[Others]Some say PHP is the best language in the world. What do you think?

More Posted time:May 8, 2017 17:27 PM
PHP, as a common open-source language that absorbs the features of the C language, Java and Perl in its syntax, is conducive to learning, and widely applied in the web development field.

bold The unique syntax of PHP enables it to execute dynamic webpages faster than CGI or Perl. Compared with other programming languages, PHP embeds and executes programs in HTML documents for structuring dynamic pages, and its execution efficiency is much higher than CGI which fully generates HTML tags. PHP can also execute compiled code, and the compilation can achieve encrypted and optimized code running to accelerate code running. Its advantages are numerous.

Someone said that PHP embodies the two always’ and three represents theory:
•Any language that scolds PHP is always a language that nobody uses.
•Any developer who uses PHP is always the most pragmatic developer.
•PHP represents the most advanced productivity.
•PHP represents the most advanced culture.
•PHP represents the fundamental interests of the broadest community of developers.
Some also said that PHP is the best language in the world.

As a programmer who uses a variety of languages, what are your thoughts?

  • UID625
  • Fans5
  • Follows1
  • Posts68
1st Reply#
Posted time:May 9, 2017 9:53 AM
PHP is easy to use and get started, and weakly typed. It has rich learning materials, a low cost, and fast development, and provides support for process- and object-oriented programming. Various features and functions that may be used during web development are provided in PHP. The implementation is interpreted, no compilation is required, rapid development is enabled, and the you can activate ZendOpcache on the production environment to enhance performance. You almost don’t have to worry about memory leakage at all as resources will be released once the processing is complete.
No compilation required, being weakly typed, hot deployment, fast development, stable operation, easy O&M, built-in template engine, rich library functions, powerful hash tables (associative arrays), each request corresponds to a life cycle, there is almost no memory leakage – these are all obvious advantages of PHP. Coupled with the big increase in PHP7 performance, PHP can never be more suitable for the internet age where short, adaptable and fast operation is highly sought. The essence of PHP is the liberation and development of productivity.
However, there are a lot of PHP functions. Except the commonly used ones, I find it hard to remember other functions and have to search for them on the internet every time I want to call one.
PHP does not have a dedicated writing IDE yet.
It is said that all engineers despise PHP engineers. I am too scared to leave my bunker. Java is the best, LOL.

  • UID619
  • Fans3
  • Follows2
  • Posts59
2nd Reply#
Posted time:May 10, 2017 9:40 AM
1. Technical comparison of Java and PHP:
Java is purely object-oriented for development and has powerful features and many branches. There is no app that cannot be developed in Java. Whether it is C/S or B/S, functionally speaking, no language can rival Java. But its advantage is also its disadvantage. Refer to Point 6 for details.
PHP is an up-and-coming star, absorbing advantages of Java, C and Perl languages and focusing on the internet field. PHP boasts a unique advantage in the web field and no other languages can compare with it.
The comparison between the two indicates that Java thoroughly defeats PHP. But in fact there is not much comparability as the two focus on different areas. If we compare the two in the web field, PHP wins out.
2. Market share comparison of Java and PHP:
Java language is ancient, with years of development history. It holds a place in the C/S and B/S fields, especially in the telecommunications and banking industries. But with the changes in social needs and other languages, the market share of Java is being encroached on little by little. The web field is almost monopolized by PHP, the embedded field is almost monopolized by C++, and the client field is almost monopolized by the C language. If it were not because of the emergence of Android, Java's fate would have been really hard to say. The huge empire Java has accumulated will not collapse overnight, but there must be a process. Therefore, you don't have to worry about its future if you learn Java now, instead, you should worry more about the talented Java devs that have been coming forth in large numbers over the past decade, and the large crowds of entrepreneurs entering the Java camp.
The market description of PHP is relatively easy, because we only need to look at one field, that is, the web field. PHP takes more than 80% of market share in the web field, and the remaining market share is occupied by Java-JSP, ASP, C#, .NET, Python, Ruby and so on. There are 395 in the Top 500 websites using PHP. Facebook and Sina Weibo, the world's two largest websites, both use PHP.
The two share the market on a fifty-fifty basis.
3. Development space comparison of Java and PHP:
Android's growth momentum is very vigorous, but the number of apps that a mobile phone can install is limited. The difficult promotion of apps is also the biggest challenge facing apps. Fortunately, only Java can support Android, in addition to HTML5.
China's population accounts for 19.7% of the global total, Chinese internet users account for 22.4% of the global total, and the number of Chinese websites accounts for 0.5% of the number of global websites, implying a huge space for the development of websites. The contribution of internet to GDP in developed countries may reach 20%, while that figure in China is only 3%, implying a huge space for the development of the internet. The internet cannot go without the web and the web cannot go without PHP.
Between the two, I personally feel that PHP boasts a more obvious advantage.
4. Salary comparison of Java and PHP:
Salary is determined by the relationship between supply and demand. When talents are in short supply, the salary is naturally high. When talents are saturated, salary naturally will not go very high.
Java courses are available in basically all colleges, so many students will naturally learn it if they want to engage in the software industry. Java has been quite popular in the recent ten years with talented people mushrooming, and the entire Java industry is in an oversupply situation. In Nanjing, in a 30-student Java training class, about ten won't be able to find the ideal job and have to change the profession in the end, and the lowest salary may be barely over 1,000 yuan. Of course, there are also many excellent Java practitioners who may earn more than 4,000 yuan.
PHP is entirely market-driven, and the difficulty lies in that fact that many people do not understand PHP and have no way to understand it. The fundamental reason is that PHP courses are rare in colleges. As far as I know, among the around 100 colleges and universities in Nanjing, only Nanjing Xiaozhuang University opens PHP courses, and not as a major course. Colleges and universities are not clear about the market demand for PHP, and they are more willing to promote the academic-style Java.
The smaller number of PHP learners and the high demand from enterprises contribute to the galloping lead of salaries for PHP programmers over other peers in the same industry. Generally the starting salary of PHP programmers won't be less than 3,000 yuan. The figure in Nanjing area has already exceeded 4,500 yuan, and those in Beijing, Shanghai and Guangzhou even break through 6,000 yuan.
Comparison between the two: Besides the difficulty in finding a Java-related job, the high levels of the two occupations are more or less the same, but the starting levels of Java is obviously at a disadvantage.
5. Salary increase rate comparison of Java and PHP:
Java is widely recognized as being difficult - hard to get started and at least one to two years is required to really get started. Before that, you will be at the apprenticeship level during the period, with limited salary increases. After two years, there will be a large increase and it is basically no problem to earn a salary of around 6,000 to 7,000 yuan.
PHP is widely recognized as being easy - very fast to get started and a salary rise can be expected as soon as the probation period is over. PHP devs usually enjoy a pay rise once every half a year and the amount of increases in the first three years are fair to middling: 5,000 to 6,000 yuan in the first year, 7,000 to 8,000 yuan in the second year. Into the third year, there will be many earning more than 10,000 yuan.
Comparison between the two: In fact, PHP front-end boasts obvious advantages, while the two are on a par in the backend performance, unlike what many say that PHP devs seldom witness progress in the backend. PHP practitioners are in shortage, but the case is truer for expert PHP practitioners. Java is not as highly-paid as some people boast. Instead, there is a high degree of polarization, which is actually normal. The harder a language, the more severe the polarization.
6. Bottlenecks for the development of Java and PHP:
JavaEE used to rule enterprise-class software development for decades. During the past decade, talents mushroomed, but the Java language itself is showing an increasingly bloated and splitting tendency. Java is an expensive option. Its complex design, slow project progress, costly application server and high maintenance difficulty make Java a language to be sacrificed on the temple. The split of versions also makes the so-called cross-platform feature just empty talk. Java features make it not suitable for internet companies whose businesses change rapidly with market situations. The web field is almost monopolized by PHP, the embedded field is almost monopolized by C++, and the client field is almost monopolized by C language. If it were not because of the emergence of Android, the fate of Java would have been really hard to tell. PHP boasts convenient and rapid development for large and medium-sized systems, which cannot be rivaled by Java, ASP and .NET. In addition, PHP has many powerful frameworks such as yaf, yii, and ci. For the development of small and medium-sized general systems, a ThinkPHP will easily beat all the three major SSH frameworks of Java.
PHP features easy and quick development, which also leads to its laborsome development of complicated applications. As the saying goes, it will either make you or break you. PHP pays attention to the application layer, and developers do not need to care about the underlying stuff, leading to its rapid development and ease-of-use. But for the same reason, PHP structures are prone to bottlenecks after you learn or work for a period of time. PHP 5.3 and later versions incorporate more powerful extensions to achieve functions that cannot be achieved through PHP itself. As a result, when PHP development encounters a bottleneck, you can consider using extensions to solve it. Facebook and are extensively using extensions to cope with one difficulty after another. Laruence, architect and chief PHP technical consultant of Sina Weibo, has been focused on the research and sharing of the underlying principles of PHP. He thinks extensions are the greatest aspect of PHP.
7. Comparison of the number of job openings for Java and PHP:
The data below is from Baidu statistics in early September 2014:
In early September 2014, the number of Java job openings nationwide was 82,703.
Number of Java job openings nationwide
In early September 2014, the number of PHP job openings nationwide was 47,263.
Number of PHP job openings nationwide
The number of Java job openings is a little less than twice the number of PHP ones. What's worth pondering is that the number of Java talents is more than 100 times the number of PHP talents.
8. Learning cost comparison between Java and PHP:
Java learning is widely recognized as being difficult – difficult to get started and to understand. Self-study of Java takes 12 months, and the self-taught success rate is less than 10%. The training also takes nearly six months. The average training cost is about 15,000 yuan. It takes two years for a new starter to become intermediate and more than five years to become senior.
PHP is widely recognized as the simplest language. It is an interpreted language with no compilation required. Self-study of PHP takes six months, and the self-study success rate is 20%. The training takes three months. The average training cost is about 8,000 yuan. It takes one year for a new starter to become intermediate and more than three years to become senior.
Comparing the two, we can find the schooling cost of Java is much higher than that of PHP.
Summary: Java and PHP have their own advantages, and they cannot be listed even if I keep speaking till tomorrow morning. My point is that it is okay for you to learn either one of them.
If you want to learn Java, you should engage in the Android industry. If you want to engage in the web field, study PHP.
Because of the high difficulty in learning Java, I suggest you choose it after careful consideration if you have no or poor basic knowledge. For fresh students, PHP may be a more suitable option.

Assistant Engineer
Assistant Engineer
  • UID622
  • Fans3
  • Follows0
  • Posts52
3rd Reply#
Posted time:May 11, 2017 11:41 AM
This topic is entrapping, probably to be catchy. The large number of tool coders just, following the suit of internet contrarians who have bought Intel or AMD CPUs, have verbal battles with each other.
In my opinion, there are no good or bad tools. On the contrary, the longer-existing tool will certainly be more improved in its own segment. Bill Gates once said that he can use BASIC to compile anything you want and can make. The same way applies to PHP. No matter whether it is used for shell, backend, or front-end, PHP exists completely like the golden cudgel in the proficient hands. There are thousands or tens of thousands of languages, and the key is to find the one that fits you and your future jobs.
Whatever language it is, the role of the language is to enable us to communicate with the machine, so the ease of use and learning is the true question. Some people like to use tools to compare the execution efficiency and advanced features. In my words, if you are truly such a person keen on the execution efficiency and advanced features, you should have invented a kernel on your own as Linus did, instead of shouting here.
From this point of view, PHP is indeed a unique martial art, only that the secular people often more take a fancy to the barely-seen Jiuyin Zhenjing, a martial arts secret in Chinese kung-fu fictions. They, even with average internal strength, are eager to practise a martial art scripture to make themselves stand out. But they don't know that a general single Green Wave palm art will make Pharmacist Huang unparalleled in the world.
In short, the cool do not care about languages and those who do are definitely not cool.

  • UID623
  • Fans4
  • Follows1
  • Posts72
Posted time:May 12, 2017 15:20 PM
1. PHP has achieved commercial mass production
2. PHP has a lot of excellent functions and rich libraries
3. PHP itself is an interpreted language with a high fault tolerance and agile development
4. PHP devs are partially non-professional, with insufficient knowledge in data structures and algorithms, computer memory, and heaps and stacks
5. PHP is open-source and free, and has excellent open-source communities
That is why the current disputes arise. In fact, I want to say that excellent programmers will certainly not only know one language, and those who really like programming should like the diversity of languages which makes us less boring.

Assistant Engineer
Assistant Engineer
  • UID627
  • Fans3
  • Follows0
  • Posts55
Posted time:May 15, 2017 14:10 PM
Easy deployment
Many companies in other industries want to have a website. They do not have a lot of budget for the website, so they may just casually buy a virtual host. In this situation, I am afraid the best option will be PHP. There are few virtual machines that support Ruby, Python and other similar languages. ASP requires Windows servers, and only PHP can run on any virtual host.
Low learning threshold
At the beginning, PHP is designed specifically for web (although it now has moved closer to a general programming language), with a very low learning and usage threshold. A .php file built is a webpage, and the GET parameter can be obtained with $_GET ['XXOO']. Other general programming languages do not provide native support for these HTTP-related features. At this time, you will need to choose and learn an HTTP framework to compile web applications, such as Tornado (Python), Ruby on Rails and so on.
Simple syntax
PHP is weakly typed at the beginning (now it is not that weak, but still not strongly typed). You almost do not need to consider the type conversion. For a very long period of time at the beginning, PHP did not support object-oriented programming. It is very easy to use PHP to access data in the database, and around half of the websites involve nothing other than data reading and writing in the database.
Since PHP runs in the form of CGI or FastCGI you do not have to consider the memory management issue. Either way, the memory will be released after each request.
PHP's error handling mechanism is also very simple - if an error occurs, the error information is printed on the page. It's also easy to turn off error prompts.
Many heavyweight open-source projects
PHP has many heavyweight open-source projects such as WordPress (blog), Typecho (blog), Drupal (CMS), MediaWiki (WIKI), and DiscuzX (Forum). It can be said that PHP is the best choice if you want to deploy a website without too much trouble.
Tested through history
PHP, after all, can be classified as a veteran web programming language, and its pitfalls or vulnerabilities have been experienced by programmer predecessors. There are a large number of libraries to reuse, and it is very easy to hire PHP developers. However, Node.js, Golang and other new languages are all subject to insufficient technical reserves and talent reserves. It is not the time for Python or Ruby to take a sigh of relief - although you were invented long ago, there were few engaged in web development back then.
An accurate saying will be: the best language for web development

Assistant Engineer
Assistant Engineer
  • UID634
  • Fans0
  • Follows0
  • Posts44
Posted time:May 16, 2017 16:24 PM
Maybe unlike many software developers, I was originally engaged in the hardware circle. To design an electronic computer, the principle is the most critical.
   The principle is very easy – among a pile of latches, a hop of crystal oscillator triggers a change in the timing sequence. The data execution between latches involves AND, OR, NO and XOR. There are two x86 instruction sets of Intel. The 8086 instruction set is !, while CPUs recognize MOV and other assembly instructions. These assembly instructions are compiled into the machine instructions in the CPU.
 The following discussion does not take into account the wage income, but only considers the language of the project. For the time being, the fastest execution must be compilation. If you write a program using a 12M-GHz single-chip machine with 2M hard drive and several K of memory in the last century, you can still shoot Pluto's photos and send the photos back to Earth. But this 2M program takes more than half of a year of the whole development team to complete. Each instruction has been considered again and again. Each device of scientific instruments and microwave communication systems such as a camera temperature sensor and a radiating counter share a single processor. Bill Gates once said: '640k ought to be enough for anybody', but we all know wthat turned out.
 On the basis of the compilation you can directly write C scripts. The C language can be executed directly in the CPU through the compiler. You may ask now what the role of the operating system is at this time. If you write the C language directly, it is indeed able to be executed, just to flush the C language program into the BIOS chip (SPIFLASH). If you execute the C language, the scheduling speed is also fast. But you really cannot write it in this way, because you do not have the physical address of the register that corresponds to the NIC, and the physical address of hardware by various vendors – they are all confidential – unless you write your own single-chip machine programs to implement various bus interfaces (I2C I2S SPI UART PCIE USB). The smallest server is now already buildable, and it is called BOA which you can search in Baidu. This server is established in the C language and can parse single-thread and single-use servers in PHP (we can say that many of your router configuration pages are using it). At this time, have you found that you cannot read Java (JSP) or ASP? This proves that PHP has an extremely low hardware requirement and can run on 32M ARM.
 In terms of processing, apart from direct calls of the C language, you can also use the C language call to load the operating system (BIOS FASTBOOT). The operating system schedules various processes, and various major manufacturers can encapsulate their own hardware into the drives for various systems so that the internal timing sequence and calling method can be made private. Many operating systems have multiple users and tasks, or implement traffic-controlled scheduling. In short, the current reliable systems are Linux and Windows (traffic control and preemptive scheduling are skipped here. For details, you can refer to non-smart mobile phones).
  The operating system should be able to achieve system-independent languages, that is, the operating system cannot limit the development language used by developers. It also means that your mobile phone apps should not be forced to adopt Java/Object C/Swift for development. Look at your computer and you will find an example – software that developed in C, Java or other languages can all run, as long as there is a corresponding compiler.
 However, iOS and Android cannot be called a real system because they both copy the Linux kernel – No, they use Linux kernel, to be more accurate. The upper layer of operating system, due to early hardware constraints, makes it possible for a mobile phone to install various compilers as the computer does (such as. NET, C++, JDK...). As a result, Google forces installation of a DV Android virtual machine to support only Java.
This stupid design leads to the result that all the apps must be developed in Java. Some vendors, in order to synchronize game updates, use the ObjectC game engine and then shell-ize it in Android for running the program. In this way, the app has to go through ObjectC > Java-Java virtual machine > Various middle layers of Android (C) > Linux > the underlying layer (compilation), and it is not strange if the app is choppy.
iOS is worse. Apple developers all know that iOS "eats" data. It imposes various limitations in the name of protecting users, and keeps updating systems which will cause forced termination of apps, making users think it is a bug with the app. Before distributing an app, you are required to purchase a certificate. iOS store is just dredging for money, isn't it?
However, nobody installs Ubuntu (Linux) system, and with no pioneers, it is hard to understand the materials in a foreign language.
All in all, small companies with limited budgets do not develop the client.
Small companies do not develop the client.
Do not develop the client.
Please develop web pages.
Web pages are compatible and unified. Various browser can translate them into the desired language for independent execution.
Which language should be selected for the webpage background, PHP, ASP or JSP, or self-written C?
From cost perspective, I choose PHP because virtual hosts are extremely cheap.
PHP implements one-time compilation and execution every time. Once the customer leaves, the memory is emptied, with no TSR concept. This has led to the failure to implement many advanced concepts such as ORM and MVC, or the implementation of TSR is just a pseudo implementation.
So PHP is not available for developing a huge project. I heard that Taobao was initially developed in PHP, but the PHP bottleneck enforced the language change. But whose website can have ten million users? In addition, the MySQLi background of PHP also integrates the database link pool and cache writes philosophies, so PHP is fine to use. There is also the ThinkPHP framework to develop medium-sized projects.
In contrast, JSP is indeed faster, but framework is always required, such as Spring and Hibernate. But not every project is of an enterprise level and not every project needs half-day coding effort.
With regard to the reusability of code, various common database reads/writes, OSS or key value storage are supported by almost all products. But some Alibaba Cloud SDKs do not have a PHP version available, such as the table form storage.
In short, I suggest you use PHP for small projects, JSP for large projects and JSP for projects with budgets covered by someone else.
Please feel free to advise if there is anything wrong. Thank you.

Senior Engineer
Senior Engineer
  • UID105
  • Fans5
  • Follows0
  • Posts344
Posted time:May 23, 2017 13:40 PM

Let’s take a closer look at some of the major differences between these two languages.

Compiled vs. Interpreted. Java is considered a compiled programming language. This allows it to run on any operating system regardless of where it was written. The difference is in the implementation: Java is compiled into bytecode and run on a virtual machine. PHP is what you call an interpreted language, or “script”—the code can be run as-is in their respective runtime environments (i.e., the server). While there’s a lot of nuance to the compiled vs. interpreted debate, it is generally true that scripts are much easier to use and favor programmer productivity.
Memory safe. Java is a memory-safe language, which means if you attempt to assign values outside of the given array parameters, the programmer receives an error.
Static vs. Dynamic Type Checking. Java uses static type checking, where the type of a variable is checked at compile-time. The programmer must specify the type (integer, double, string, etc.) of any variable they create. There are many pros and cons for these two paradigms, but the primary advantage of static type checking is that type errors are caught early in development, and because the compiler knows exactly what data types are being used, code typically executes faster or uses less memory. The primary advantage of dynamic type checking is programmer productivity—you are free to assign types at your leisure.
Concurrency. This is the language’s ability to handle the execution of several instruction sequences at the same time. Java makes use of multiple threads to perform tasks in parallel. PHP, like most server-side languages, uses multi-threaded, blocking I/O to carry out multiple tasks in parallel. For most use-cases, both methods work just fine, but Java is generally faster because thread to thread memory sharing much faster than interprocess communication (IPC). PHP has been around the block for a while though, and has found its own way to achieve asynchronous processing—most notably through the HHVM project released by Facebook.
Class-Based vs. Prototype Based. Java follows class based inheritance—a top down, hierarchical, class-based relationship whereby properties are defined in a class and inherited by an instance of that class (one of its members).

Let’s take a closer look at some of the major similarities between these two languages.

Back-End Development. Both languages are used on the server-side. Java has long been used to power back-end technologies like Apache, JBoss, and WebSphere.
Syntax. Looping structures, classes, defining variables, and conditional operators are very similar in both languages. This makes it easy for developers to work cross-platform should you have several projects that use both languages.
Entry points. When your program starts, the compiler or interpreter looks for where it needs to begin execution.
Object-Oriented Programming (OOP). Neither language is “fully” object-oriented, but both languages have access to techniques like inheritance, encapsulation, and polymorphism. The benefit? Object-oriented languages make your program much more modular so you can reuse code for other programs.

As with all languages, the choice really boils down to what you’re trying to build and what resources you have at your disposal.

You should consider Java if your project involves…

Android Apps
Enterprise Software
Scientific Computing
Big Data Analytics
General Purpose Programming of Hardware
Server-Side Technologies like Apache, JBoss, Geronimo, GlassFish, etc.
You should consider PHP if your project involves…

Software stacks like the LAMP stack (Linux, Apache, MySQL, PHP)
CMS’s like WordPress, Drupal, or Joomla etc.
Servers like MySQL, SQL, MariaDB, Oracle, Sybase, and Postgresql etc.
Both Java and PHP are excellent foundations for a wide variety of software. Which language you choose to use will be determined by what you want developed.

You can manipulate hardware with Java, but it’s not a common language for low-level programming since it’s a “safer” language. Because Java won’t allow you to perform certain functions to protect the PC, it’s preferred for higher level applications.

The best way to make a firm decision is to post your project and ask developers for their opinions. They can tell you which language is right for your project to help guide you to the right solution.