Should hackers learn PHP or Python? Rational analysis of 10 differences between PHP and Python

Source: Internet
Author: User
Tags learn php
This article introduces everybody most want to know what the hacker most want, has these things, can facilitate a lot of hacker's use, the article explains that the hacker should learn PHP or Python, two are common and more powerful language, this article is not a small series of disorderly analysis, but seriously think, All kinds of reasons are written in the inside, in addition to the introduction of hackers at the beginning should learn PHP or Python, and then to everyone said PHP and Python between the 10-point difference, that is, 10 advantages and disadvantages, want to know the look down.

First of all, let's say what a hacker is:

Hackers speak plainly is a programmer, but a strong point of the programmer, talking about hackers, the brain is how to invade other people's computer, find the information they want to find.

Simple analysis, if hackers want to invade the site, to be clear is the PHP architecture of the site or the Python architecture of the site, if you want to invade the PHP composition of the site, first you have to learn PHP, or the intrusion will be very difficult. If you're going to invade a python-made website, you're going to be proficient in python. So the hacker learning is a lot of things, we do not think of hackers too take for granted, most hackers all day in the technology company to knock Code, holding the same salary as normal workers.

But the next thing I want to say is, what is the common language of hackers, PHP? Not, Python, why? Because only the people who have used Python have experience,

Python's power is that there are a lot of third-party libraries, so that you can stand on the shoulders of giants to develop, and avoid the repetitive development of the wheel, Python has a lot of things you want to have a ready-made library exists, you just use Python import.

Like some crack with the verification code of the site, this needs to use the Python graphics library to bring the identification code function, you just use the tube, the logic of the responsibility to write down and then you do not have to control, Python comes with a library of identification verification code. (Of course, I'm not a hacker, but in some ways Python is a lot easier)

All right, I'm done with the python that hackers like to use, and now we're going to analyze the pros and cons of both PHP and Python .

See online Someone analysis is very good, think said is right, now share to everyone, so we don't have to look everywhere. (Don't thank me)

PHP and Python 10-point pros and cons analysis:

First, talk about the cost of learning that everyone is concerned about: PHP and learning costs are not very high, its advantage lies in the more complete official Chinese documents, and the PHP application domain only Web aspects, so we need to learn less content. Python Because the learning route is more, not easy to find suitable for their own tutorials and materials, so this is a bit difficult.

Second, the 2nd talk about the application: PHP is used only in the Web backend, Python is a broader area of application, if you need to port logic to other platforms (such as the desktop), Python is more user-friendly.

Third, the 3rd talk about the aspects of the community: PHP data are everywhere, but are some basic knowledge, high-quality Chinese community is very good, generally to the official new function is not very concerned. This python is a lot better, at least the people who want to learn to find very good information.

Four, to talk about grammar: PHP's syntax looks like it has not been carefully designed, very casual. Some of the syntax seems to be handy (using dots to concatenate strings), but it's a lot of trouble for later expansion (because the dots can't be used to access the members of the object), like the syntax of the egg-hurting namespace. Python is a little bit better, but Python2 and Python3 have some incompatible grammatical changes directly. (So who's good for you to judge)

Five, finish the grammar, now talk about writing HTML templates: Php can be very convenient to write HTML template directly, Python needs to use other languages or libraries to implement. (It's obvious that you're not going to say it anymore.)

Six, now talk about the mode of operation: PHP operation is relatively single (PHP-FPM, mod_php), Python can be fastcgi run, you can also listen to the port to handle the request.

Talk about Package Manager: PHP's Package Manager (PEAR) and Extension Manager (PECL) are probably no use at all, which leads to a high cost of introducing a new dependency, so many people tend to build their own wheels instead of introducing ready-made libraries. Python has a unified package manager, although there are problems, but much better than PHP, the introduction of the library after the namespace management is better than PHP.

The 8th, the extension and the library: both PHP and Python can use C to write extensions. In contrast, Python has a little more available libraries. (So you can understand it.)

Nine, said the performance aspect: because PHP runs a single, opcode cache scheme is also relatively mature (APC, opcache), cache opcode run fast after. Python may need to optimize performance on its own.

Ten, the last point we're talking about type systems: PHP and Python are dynamic types. PHP is more ambiguous on the type, there are many pitfalls, Python is strict.

The above 10 is a personal point of view, there are different ideas can be asked below or can be suppressed not to say.

"Good for a short stay"

How is the content of th header in the HTML table centered? The specific introduction of the Align attribute of th header label

Why can't I nest a div with an HTML p tag? There are also examples of CSS styles for HTML p tags

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.