PHP Questions: A comprehensive description of PHP web design problems

Source: Internet
Author: User
Tags stack trace

Objective

I have a strange temper. I will complain a lot of things. I don't like most of the technology on this planet.

PHP is not only awkward to use, but also want to do what I want is not suitable, to be not the most satisfying, to violate my faith. I can tell you about a language, all the good ways I want to avoid, all the bad ways I like. Come on, ask! Conversation would be fun!

PHP is the only exception. Almost everything in PHP abstraction is fragmented. Including the language, the framework, the entire ecosystem is a mess. I can hardly list the curses alone, because it's all broken. Every time I try to edit a bunch of messy including PHP complaining lists, I get caught up in trifles, and the deeper I get, the more shocking things I find.

PHP is embarrassing for people. It was so broken, but the amateur who had been trained praised it. PHP is doing some minor salvage measures, but I choose to forget it.

But I have to get my system out of these things, and that's it, this is the last attempt.

Make a metaphor.

I just complained to Mel and she insisted that I publish it.

I can't even say what's going on with PHP because-it's okay. Think you have a, uh, toolbox. A bunch of tools. Looks fine, there are standard things.

You pull the screws, it's weird with three heads. OK, well, it's not very useful to you, but guess someday it will work.

You take out the hammer, it gets shaken, and there are sharp claws on both sides. But it still can be used, I mean, you can use the middle of the two sides of the oblique knock.

You take out the pliers, but they don't have jagged faces. The surface is flat and smooth. It's not much use, but it's still going to work.

You can go on. Things in the toolbox are weird and unpredictable, but they can't be said to be worthless. There is no big problem on the whole; it has all the tools.

Now imagine a lot of carpenters who use these tools, and they say to you: "What's wrong with these tools?" We've all used them, they work very well! ”。 The craftsmen show you the houses they built, each with a pentagon, and the roof is epileptic. You knock on the front door, it pours inside, and they complain that you broke their door.

That's the problem with PHP.

Position

I think the following qualities are important for the productivity and usability of a language, and PHP destroys them in a wide range. If you disagree with this, well, I can't imagine that we'll never reach an agreement.

A language must be predictable. It is the medium by which human thought is reflected to the computer, so the key is that human understanding of the procedure is actually correct.

Language must be consistent. Similar things will look similar, different is different. If you learn part of a language, you should be able to understand the rest of it easily.

Language must be concise. The new language should reduce the bad form of inheriting the old language. (We can also write machine code.) The new language should, of course, strive to avoid weaving into new and unique forms.

The language must be reliable. Language is the tool of problem solving, and the introduction of new problems should be avoided as far as possible. Any "trap" would be a huge distraction.

The language must be debugged. When something goes wrong, the programmer has to fix it, and we need to get the help we want.

My position is:

PHP to everywhere is full of surprises: Mysql_real_escape_string,e_actually_all

PHP Inconsistency: strpos,str_rot13

PHP needs special form: error-checkingaroundcapicalls,===

php Wacky: = =. For ($fooas & $bar)

PHP obscure: Default no stack trace or fatals, complex error Reporting

I can't explain why it belongs to these classes on a single issue, otherwise it will be endless. I believe that readers will think for themselves.

Don't you ever pull these things off with me again.

I know a lot of good arguments. I have also heard many arguments to refute. These are the only things that stop the conversation immediately. Stop pulling these things off me, please.

Don't tell me "good developers can write good code in any language", or bad developers. It doesn't make any sense. A good craftsman can steer a nail with a stone or a hammer, but how many craftsmen have you seen with stones? One of the criteria for becoming a good developer is the ability to choose tools.

Don't talk to me. It is the responsibility of the developer to memorize thousands of exceptions and odd behaviors. Yes, this is necessary in any system, because the computer is stupid. This does not mean that the system can be wildly accepted without a cap. PHP is only abnormal, this is not possible, once and the language wrestling duel, you actually write the program will spend more effort. My tools do not have a positive effect on creating applications for me.

Don't tell me "that's the way CAPI works." What is the purpose of the high-level language on this planet, and what they can provide is just some string helper functions and a bunch of c wrappers? If so, then use C! Here, there's even a CGI library for it.

Don't try to "make a strange thing, you deserve it". If there are two attributes, one day, some people will find a reason to use them together. Again, this is not C; There is no specification here, no "undefined behavior" is required.

Stop talking to me about Facebook and Wikipedia for PHP. I already knew! They can also be written in Brainfuck, but as long as they are good enough to keep up with them, they will always overcome the problems of the platform. It is well known that the development time may be halved or doubled if written in another language, and it makes no sense to come up with this data alone.

God forbid, don't pull anything off with me! If the list doesn't hurt your PHP view, it doesn't matter, so stop making pointless arguments on the web and continue to develop the high-cool sites to prove me wrong.

Secretly tell you: I like Python very much. I'd love to say something you don't like, if you really want to. I'm not asking for it to be perfect, I just want to make the best of it and sum up what I want.



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.