国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Home php教程 php手冊(cè) PHP:風(fēng)雨欲來 路在何方

PHP:風(fēng)雨欲來 路在何方

Jun 21, 2016 am 09:13 AM
asp java net php php5

PHP4:奇跡背后

1995年時(shí),Rasmus在用PHP寫他的個(gè)人主頁;今天,PHP成為風(fēng)靡全球的腳本語言,越來越多的站點(diǎn)選擇使用PHP,連Yahoo都放棄了自己的腳本而改用PHP支持它的網(wǎng)站??梢哉f,PHP是一個(gè)奇跡。我一直認(rèn)為,任何奇跡背后都有它的原因?,F(xiàn)在,就讓我們透過這個(gè)奇跡,來看看PHP的成功之道。

1 簡(jiǎn)單易用

PHP的入門門檻很低,它對(duì)使用者的要求微乎其微。學(xué)過C語言的人,使用PHP幾乎不需要什么時(shí)間。它們的語法是如此相似,以至于我常常想,是不是在C語言變量前加個(gè)$就能改成PHP。這使得大量C程序員在網(wǎng)絡(luò)腳本中選擇了PHP。另外,比起ASP的組件系統(tǒng)和Java龐大的類庫來,PHP的函數(shù)庫要好學(xué)多了。在編程風(fēng)格上,PHP更是自由,你可以使用N種風(fēng)格來寫你的腳本程序。這些特性使得PHP成為初學(xué)者的首選語言。搶占初學(xué)者市場(chǎng)是很重要的策略。如同任何人都會(huì)對(duì)自己的初戀記憶猶新一樣,人們往往會(huì)對(duì)最初學(xué)習(xí)的語言有很深的感情。即使后來自己成長(zhǎng)了,改用其他語言了,還是會(huì)時(shí)時(shí)記起最初學(xué)習(xí)的語言。在這點(diǎn)上,PHP做得很出色。

2 剪裁得當(dāng)

PHP開發(fā)組是最了解網(wǎng)絡(luò)的一群人,他們非常清楚用戶要的是什么。PHP就是要做一個(gè)出色的網(wǎng)絡(luò)腳本語言,而且,它只是要做一個(gè)網(wǎng)絡(luò)腳本語言。PHP提供的函數(shù)集在網(wǎng)絡(luò)方面相當(dāng)強(qiáng)大,而且重點(diǎn)均專注于網(wǎng)絡(luò)應(yīng)用。像PHP中的無組件文件上傳,超多數(shù)據(jù)庫支持等特性都表現(xiàn)出這個(gè)特點(diǎn)。順便說一句,PHP甚至支持ACCESS數(shù)據(jù)庫。專注使得PHP在網(wǎng)絡(luò)上表現(xiàn)出極其優(yōu)秀的性能。有失才能有得。

3 支持強(qiáng)大

PHP有強(qiáng)大的OpenSource團(tuán)體支持,在網(wǎng)絡(luò)上有數(shù)以萬計(jì)的開源代碼。你可以整合幾個(gè)現(xiàn)有程式來實(shí)現(xiàn)你的應(yīng)用,也可以分析大師級(jí)的代碼來得到提高。PHP還有很多擴(kuò)展性的項(xiàng)目來增強(qiáng)PHP在某個(gè)方面的功能。像注重編程規(guī)范化和代碼重用的PEAR,提供可編譯模板技術(shù)的Smarty,甚至開發(fā)桌面程序的GTK。

分析完這幾個(gè)理由,我們可以看出,PHP的成功得益于PHP開發(fā)組的戰(zhàn)略眼光。PHP提供了一個(gè)最小工作集,使用戶能用最簡(jiǎn)單的方式高效地完成自己需要的應(yīng)用。這正是初學(xué)者需要的。然后它通過方便的擴(kuò)展來提供各個(gè)方面的解決方案,這樣,你只需要學(xué)你要用到的那個(gè)領(lǐng)域的東西。當(dāng)你涉及的領(lǐng)域越來越多時(shí),你的水平也隨之提高,當(dāng)你熟悉了大多領(lǐng)域時(shí),回頭看看,會(huì)發(fā)現(xiàn)不知不覺已到山腰。PHP也提供了我們一種學(xué)習(xí)態(tài)度。

ASP.net+J2EE:風(fēng)雨欲來

網(wǎng)絡(luò)腳本界的革新浪潮由Microsoft的ASP.net首先發(fā)起。在ASP.net中,有一個(gè)很吸引人的東西——事件驅(qū)動(dòng)機(jī)制。這在桌面編程中是很普通的概念,而在腳本編程中事件驅(qū)動(dòng)意味著對(duì)服務(wù)器端的腳本(如PHP、JSP、ASP)和客戶端的腳本(如JavaScript和VbScript)進(jìn)行封裝,使之協(xié)同工作。這樣一來,編程就會(huì)變得異常方便。在.net環(huán)境中的事件驅(qū)動(dòng)還有一個(gè)優(yōu)勢(shì),就是你甚至可以不會(huì)任何服務(wù)器端腳本和客戶端腳本,因?yàn)樵贏SP.net中,是可以直接使用C#這樣的語言的——連$都不用加。這為MS陣營(yíng)的傳統(tǒng)程序員轉(zhuǎn)向網(wǎng)絡(luò)開發(fā)鋪平了道路,同時(shí),也使PHP在初學(xué)者市場(chǎng)上受到很大的打擊。可以預(yù)見,以后的傳統(tǒng)程序員轉(zhuǎn)向PHP的將大為減少。不過ASP.net最大的問題在于它只能在Windows上運(yùn)行,而現(xiàn)在大陸正在大力發(fā)展Linux。這使得PHP的生存空間似乎寬了點(diǎn),但是——讓我們來看看Java吧。

Java也是一個(gè)奇跡,1995年發(fā)布第一個(gè)版本,現(xiàn)在形成三個(gè)版本,分別覆蓋嵌入式系統(tǒng)(J2me)桌面程序(J2se)和服務(wù)器(J2ee)三大應(yīng)用領(lǐng)域。更重要的是,Java得到了絕大多數(shù)程序員的認(rèn)可,現(xiàn)在世界上最出色的計(jì)算機(jī)書籍多是以C++或者Java作為描述語言的。Java幾乎像C一樣,成為一種信仰。所以,我們不要妄想Java陣營(yíng)的程序員會(huì)轉(zhuǎn)向PHP。同時(shí),在同是開源和跨平臺(tái)的Java面前,PHP丟掉了不少優(yōu)勢(shì)。J2ee中的JSP又在初學(xué)者市場(chǎng)對(duì)PHP造成相當(dāng)?shù)膲毫Α?br>
在曾經(jīng)使PHP成功的初學(xué)者市場(chǎng)、易用性和開源支持等方面都受到挑戰(zhàn),而隨著機(jī)器性能的不斷提高,大家對(duì)效率的要求漸漸降低的情況下,可以說,PHP要在ASP.net和J2EE的狹縫中生存并壯大,是一件很不容易的事情。

而PHP本身還有不少問題。像低層用戶過多。大量的開發(fā)者處于入門階段,不知道如何提高自己,導(dǎo)致大量開源代碼不規(guī)范和低效率,而又會(huì)又下一批初學(xué)者從這些糟糕的代碼中學(xué)習(xí),如此遞歸。另一方面,高階用戶卻因?yàn)镻HP的面向?qū)ο筇匦圆煌暾仍蚨坏貌晦D(zhuǎn)向其他語言以開發(fā)大型應(yīng)用。


PHP5:濃濃咖啡味

PHP開發(fā)組在今年年中發(fā)布了PHP5的BETA1,我們可以從中看見PHP的反擊。首先,PHP4的開發(fā)仍然馬不停蹄,而且我們可以肯定,PHP4的開發(fā)還將持續(xù)很長(zhǎng)一段時(shí)間。這樣做的目的是鞏固既有用戶,同時(shí)在將來的PHP4版本中逐漸融合部分PHP5的新特性,實(shí)現(xiàn)PHP4到PHP5的平滑過渡。

再來看PHP5的變化。在PHP5中,我們看到了太多Java的影子。OO體系幾乎是COPY的Java的,這保證了PHP高階用戶不流失,使得他們能方便的使用最新的技術(shù)體系來架構(gòu)自己的應(yīng)用。另一方面,也為Java程序員使用PHP提供了方便,雖然這樣的情況可能比較少。在完善了OO體系后,PHP具備了真正進(jìn)入企業(yè)級(jí)市場(chǎng)的能力。然后PHP5也添加了不少自己的東西,像__get,來使這個(gè)體系更易用。不知道的是,這杯cappuccino是否會(huì)像Java般受歡迎呢?

從PHP5的改變中,我們看出了PHP將來的方向。一是和JSP競(jìng)爭(zhēng),爭(zhēng)取在某一些方面取代JSP,成為粘合JavaBeans和Servlet的膠水。這要求PHP和Java之間建立更為緊密的關(guān)系。Zend小組正在參與JSR規(guī)范的指定。這個(gè)規(guī)范將使得你可以在PHP中直接new一個(gè)Java對(duì)象并調(diào)用它的方法。這樣也能使PHP更快的進(jìn)入企業(yè)級(jí)市場(chǎng)。另外,如果PHP編寫的腳本能被直接編譯成Binary Code在Jvm上運(yùn)行的話,PHP的前景會(huì)好很多。另一個(gè)方向是做Java和.net間的集成,在一些大型的應(yīng)用中整合已有資源。PHP4中我們已經(jīng)可以調(diào)用com組件和Java對(duì)象,相信在將來PHP5將對(duì)此提供更多的支持。

不管怎么樣,無論是和J2ee和.net競(jìng)爭(zhēng)還是融合,PHP要走的,將是一條滿是荊棘的路。不過既然PHP已經(jīng)一路風(fēng)雨地走到了今天,我們有什么理由不相信它能走得更遠(yuǎn)呢?

Best Wishes, PHP.



PS 這只是Easy對(duì)PHP將來發(fā)展的一點(diǎn)個(gè)人看法,可能不是很成熟,只是給大家一點(diǎn)參考。



Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

PHP Tutorial
1502
276
How to handle transactions in Java with JDBC? How to handle transactions in Java with JDBC? Aug 02, 2025 pm 12:29 PM

To correctly handle JDBC transactions, you must first turn off the automatic commit mode, then perform multiple operations, and finally commit or rollback according to the results; 1. Call conn.setAutoCommit(false) to start the transaction; 2. Execute multiple SQL operations, such as INSERT and UPDATE; 3. Call conn.commit() if all operations are successful, and call conn.rollback() if an exception occurs to ensure data consistency; at the same time, try-with-resources should be used to manage resources, properly handle exceptions and close connections to avoid connection leakage; in addition, it is recommended to use connection pools and set save points to achieve partial rollback, and keep transactions as short as possible to improve performance.

How to work with Calendar in Java? How to work with Calendar in Java? Aug 02, 2025 am 02:38 AM

Use classes in the java.time package to replace the old Date and Calendar classes; 2. Get the current date and time through LocalDate, LocalDateTime and LocalTime; 3. Create a specific date and time using the of() method; 4. Use the plus/minus method to immutably increase and decrease the time; 5. Use ZonedDateTime and ZoneId to process the time zone; 6. Format and parse date strings through DateTimeFormatter; 7. Use Instant to be compatible with the old date types when necessary; date processing in modern Java should give priority to using java.timeAPI, which provides clear, immutable and linear

Comparing Java Frameworks: Spring Boot vs Quarkus vs Micronaut Comparing Java Frameworks: Spring Boot vs Quarkus vs Micronaut Aug 04, 2025 pm 12:48 PM

Pre-formanceTartuptimeMoryusage, Quarkusandmicronautleadduetocompile-Timeprocessingandgraalvsupport, Withquarkusoftenperforminglightbetterine ServerLess scenarios.2.Thyvelopecosyste,

How does garbage collection work in Java? How does garbage collection work in Java? Aug 02, 2025 pm 01:55 PM

Java's garbage collection (GC) is a mechanism that automatically manages memory, which reduces the risk of memory leakage by reclaiming unreachable objects. 1.GC judges the accessibility of the object from the root object (such as stack variables, active threads, static fields, etc.), and unreachable objects are marked as garbage. 2. Based on the mark-clearing algorithm, mark all reachable objects and clear unmarked objects. 3. Adopt a generational collection strategy: the new generation (Eden, S0, S1) frequently executes MinorGC; the elderly performs less but takes longer to perform MajorGC; Metaspace stores class metadata. 4. JVM provides a variety of GC devices: SerialGC is suitable for small applications; ParallelGC improves throughput; CMS reduces

Using HTML `input` Types for User Data Using HTML `input` Types for User Data Aug 03, 2025 am 11:07 AM

Choosing the right HTMLinput type can improve data accuracy, enhance user experience, and improve usability. 1. Select the corresponding input types according to the data type, such as text, email, tel, number and date, which can automatically checksum and adapt to the keyboard; 2. Use HTML5 to add new types such as url, color, range and search, which can provide a more intuitive interaction method; 3. Use placeholder and required attributes to improve the efficiency and accuracy of form filling, but it should be noted that placeholder cannot replace label.

Comparing Java Build Tools: Maven vs. Gradle Comparing Java Build Tools: Maven vs. Gradle Aug 03, 2025 pm 01:36 PM

Gradleisthebetterchoiceformostnewprojectsduetoitssuperiorflexibility,performance,andmoderntoolingsupport.1.Gradle’sGroovy/KotlinDSLismoreconciseandexpressivethanMaven’sverboseXML.2.GradleoutperformsMaveninbuildspeedwithincrementalcompilation,buildcac

go by example defer statement explained go by example defer statement explained Aug 02, 2025 am 06:26 AM

defer is used to perform specified operations before the function returns, such as cleaning resources; parameters are evaluated immediately when defer, and the functions are executed in the order of last-in-first-out (LIFO); 1. Multiple defers are executed in reverse order of declarations; 2. Commonly used for secure cleaning such as file closing; 3. The named return value can be modified; 4. It will be executed even if panic occurs, suitable for recovery; 5. Avoid abuse of defer in loops to prevent resource leakage; correct use can improve code security and readability.

go by example http middleware logging example go by example http middleware logging example Aug 03, 2025 am 11:35 AM

HTTP log middleware in Go can record request methods, paths, client IP and time-consuming. 1. Use http.HandlerFunc to wrap the processor, 2. Record the start time and end time before and after calling next.ServeHTTP, 3. Get the real client IP through r.RemoteAddr and X-Forwarded-For headers, 4. Use log.Printf to output request logs, 5. Apply the middleware to ServeMux to implement global logging. The complete sample code has been verified to run and is suitable for starting a small and medium-sized project. The extension suggestions include capturing status codes, supporting JSON logs and request ID tracking.

See all articles