PHP Australia Conference 2015

PHP와 다른 프로그래밍 언어

PHP는 웹프로그래밍을 위한 최고의 프로그래밍 언어입니다. 다른 언어는 어떨까요?

PHP vs. ASP?

ASP 그 자체로는 실제로 언어라고 볼수 없습니다. ASP는 Active Server Pages의 약어입니다. ASP를 프로그래밍하기 위해 같이 다루어야 하는 언어가 Visual Basic Script와 JScript입니다. ASP의 최대 단점은 MS의 Internet Information Server (IIS)에서만 사용할수 있다는것입니다. 이 점으로 인해 ASP를 Win32기반 서버로 제한하게 됩니다. 다른 환경이나 웹서버에서 ASP를 작동하게 하는 몇개의 프로젝트가 진행중입니다: » Halcyon» InstantASP (상업용), » Chili!Soft의 Chili!Soft ASP (상업용) ASP는 PHP보다 느리고 성가신 언어이며, 약간은 불안정하기까지 합니다. ASP의 문법(pros)은 그것이 VBScript를 사용하고 있기 때문에 만약에 비주얼 베이직(Visual Basic)을 다룰줄만 안다면 상대적으로 접근하기 쉽습니다. 또한 ASP는 IIS가 ASP를 올리고 실행시킬수 있도록 해놨기 때문에 기본적으로 지원이 됩니다. ASP내에 내장되어있는 컴포넌트는 제한되어있습니다. 그래서 FTP서버와 접속할수있도록하는 고급(advanced)기능을 사용할 필요가 생긴다면 추가적인 컴포넌트를 사야합니다.

ASP를 PHP로 변환시켜주는것이 있나요?

네, 서버측의 » asp2php가 가장 많이 쓰이며, » 클라언트측옵션도 있습니다.

PHP vs. Cold Fusion?

PHP는 복잡한 프로그래밍 작업과 새로운 아이디어를 시도하는데 가장 빠르며 가장 효율이 높습니다. 그 뿐만 아니라 PHP는 가장 안정적이며 적은 자원만이 필요합니다. 콜드 퓨전(Cold Fusion)은 더 낳은 에러 핸들링, 데이터베이스 추상화는 PHP 4에도 언급된것이긴 하지만, 더 낳은 데이터베이스 추상화(abstraction) 그리고 더 낳은 날짜 파싱이 가능합니다. 콜드 퓨전(Cold Fusion)의 다른 강점 중 하나는 최고의 검색 엔진입니다. 그러나 그 검색엔진은 웹 스크립트 언어에 포함되어 있어야 합니다. PHP는 거의 모든 플래폼에서 실행이됩니다; 콜드 퓨전(Cold Fusion)은 오직 Win32, Solaris, Linux and HP/UX 에서만 사용가능합니다. 콜드 퓨전은 좋은 IDE를 가졌고 보통 시작하기가 쉽습니다, 반면에 PHP는 초기에 더 많은 프로그래밍 지식이 요구됩니다. 콜드 퓨전은 프로그래머가 아닌사람들을 위해 설계되었지만, PHP는 프로그래머에게 초점을 맞췄습니다.

이 주제에 관해 Michael J Sheldon이 정리한 글이 PHP 메일링리스트에 게제되었습니다. »에서 사본을 볼 수 있습니다.

PHP vs. Perl?

Perl에 비해 PHP의 가장 큰 장접은 웹을 위한 스크립트로 설계되었다는것입니다. 반명에 Perl은 더 많은 일을 할수 있도록 설계되었고 이로 인해 매우 복잡하게 되었습니다. Perl의 유연성/복잡성은 코드를 쓰기 쉽게 했지만 다른 저작자/코더가 읽기에는 어렵게 했습니다. PHP는 복잡성을 잃지않으면서 덜 헷까리고 덜 엄격한 포맷을 갖고 있습니다. Perl의 '좋은' 기능을 모두 갖고 있습니다: 컨스트럭트(construct), 문법 등등. 이는 Perl처럼 복잡하게 함이 없이 가능합니다. Perl은 많은 노력이 필요한 언어이기 때문에 80년대 말부터 지금까지 발전한것입니다. 그러나 PHP는 엄청난 속도로 성장하고 있습니다.

add a note add a note

User Contributed Notes 14 notes

cs dot abdullah at hotmail dot com
3 years ago
I have taken ZCE (Zend Certified Engineer) before couple of years and I am working in the field of Compiler Construction. However, from my opinion PHP is the best language that is used to design web solution because it extendable language. As a programmer in C, I found PHP internally as easy as externally.

PHP is the best ever !.
steve at caralan dot com
5 years ago
Comparison of programming languages is a pretty spurious exercise, but here goes:

I have programmed with Perl for many years and have yet to find anything I want to do that Perl can't deliver. It is justifiably described as the "Swiss Army Chainsaw" of programming.

I am much less experienced with PHP but have found it to be relatively lightweight. PHP isn't Perl.

However, in my opinion PHP is much easier to work with and does what it's designed to do more elegantly than Perl. PHP is usually the best option within the areas where PHP is designed to excel.

I wouldn't want to be without either tool. Having both is the best solution.
10 years ago
I have to note that a very big advantage of PHP over ASP is that PHP has much easier commands...

Take openening of a file in ASP...
First create a file object... I put this into a function because the line is simpy to long and I called it "Init fileobject"

Initfileobject     'The Sub I created in order not to type that idot line all the time
Set Fil = FileObject.OpenTextFile(Server.MapPath("data")&"\datafile")
datavar = Fil.ReadLine
CloseFile Fil
Set Fil = Nothing
Set FileObject = Nothing

Why always those objects...

The same thing in PHP

= fopen("data/datafile","r");
$datavar = fgets($fil);

That's all...

And that while VBScript is based on BASIC (BEGINNERS Allpurpose Symbolic Instruction Code)...

I code too shortly in PHP to make a full analysis yet, but the complex object structues of VBScript is something I really put in question, PHP has a much easier syntax when it comes to that...

One of the first things I saw was that PHP is based on C, which is one of the hardest programming languages in the world. That makes the syntax of for example the "for" statement less to my desire, which I like better in VBScript (ASP)... If you are an experienced C or C++ programmer, I think PHP makes automaticly the best choice out of PHP vs ASP.

But I did find out in only 1 hour that the syntax of PHP gives you much less typing than ASP, that is a fact. I think that for the rest the pick of language is pretty personal.

When it comes to stability. ASP servers crash very much. I don't think ASP itself is the evil one in this. ASP only runs on Windows servers, and we all know how much Windows crashes. I truely believe that also picks a part of the puzzle...
Web Consultant Since 1994
9 years ago
...Well, all I can say about ASP.NET and the .Net frameworks is that rather than adopt them we decided to switch all of our development to PHP and other open-source tools. We simply got tired of all the churing of the development platform from $soft: things like changing API's during final betas, undocumented api's etc.

Ive programmed in C, C++, VB, ASP (since the original beta in 1995) and ASP.Net, Com, Com+, .Net Frameworks and in C("sharp"). The fact of the matter is that most of these new and "improved" development tools dont save much, if any money, and are mostly, unnecessary. We have found PHP to be an excellent replacement for similar $soft tools and technologies for web development.

Its true that there is a bit more code required to supplement things that $soft and others give you for a price, but the bottom line is that most of these things are not very difficult to do properly. In our business there is a huge risk from not having access to source code and we simply cant be held hostage by a third party company: when you add up the dollar value of this risk for our business it far exceeds the few dollars we need to spend in extra supplemental coding - which is done once so its a one-time cost.
dir at badblue dot com
12 years ago
To ahabra,

Very interesting page.  I would ask the following, however as you investigate this topic further... you'll soon become the PHP vs. Java guru.

Your comparisons are interesting and well thought out.  I would also add some higher-level (less computer-science oriented, simply because the task at hand is generating web pages 'on the fly').  As a pure CS language, there is no doubt that Java is superior.  But as a web page generator, I have moved from a Java-centric approach to a PHP approach, leveraging servlets or beans as needed "under the covers".

Therefore, some higher-level things to consider:

1) Compare the complexity of real-world production applications ( vs ? in content management, vs. ? in discussion boards, jpgraph vs. ? in graphing).  In my mind, the proof is in the pudding - which technology results in the better, more production-ready applications?  They may be out there for Java - I would just like to know where they are and who is using them.

2) Compare slinging (generation) of markup which is where PHP excels (as it was designed to sling markup - this includes features such as character transformations, variable accessibility, web page captures (see the fopen call which captures a web page in a single function call).  Your point about a string being encapsulated in a string class is somewhat irrelevant if you are a programmer cranking markup.  Embedding object-oriented code into a page can be much more painful (and slower to execute) than leveraging traditional coding techniques.

3) Compare native database and directory support.  Java would have the advantage in generic database access (JDBC) but PHP has the advantage in LDAP support (JNDI has several bugs which we have run into - quite painful) and native database access (e.g., Oracle or MySQL integration).

Overall, well done - and a very popular topic!  It's worth building it out further.
darrenbang at yahoo dot com
1 year ago
PHP is just and interpreted language though it is strong enough to develop any kind of page you want to develop.

ASP.NET is a part of a framework which means you may use the framework's abilities. Your ASP.NET application can be a part of a mobile, Windows, Windows Service, Smart client or even unmanaged code supported.

ASP and PHP are both programming languages that are commonly used to create websites.
Both ASP and PHP are languages used to build Dynamic Web sites that can interact with Databases and exchange information.

To run ASP programs one needs IIS installed on a Windows platform server, which is not free. PHP programs run on Linux, which is free.

If we compare the speed of ASP and PHP then PHP has an upper hand. PHP code runs faster than ASP. ASP is built on COM based architecture, which is an overhead for the server whereas PHP code runs in its own memory space.

PHP programs can run on various platforms like Linux, Unix, Windows and Solaris whereas ASP is mainly associated with Windows platforms. However, ASP can run on a Linux platform with ASP-Apache installed on the server.

fabioissamu at yahoo dot com
7 years ago
Tim Bray, who - among many other things - co-edited the XML 1.0 and XML namespace definitions, was invited to the International PHP Conference to give a keynote about "How to combine PHP technology with Java based on Enterprise Systems". I had the pleasure to talk with him and I like his spirit. During his keynote, he presented some very interesting comparison between the popular development "frameworks" PHP, Ruby on Rails (RoR, Rails) and Java

in that he show PHP the first in scalability
bb at servertje dot nl
8 years ago
I think it's worth to mention that it's incredible easy to write a PHP module in C and use it in your scripts with the speed of true machine language. All the PHP API functions are there and there's plenty of examples due to the many existing modules and their source codes.

The advantage here is programming the relative simple business logic in PHP and programming those core functions that really require speed in PHP modules, if you really have to.
Compiled Java classes act more like optimised / confuscated scripts and still needs an interpreter in the end.

The only disadvantage about PHP is the somewhat quirky language and inconsistant (and long) function names, which makes it hard for newbies to learn from scratch.
good dot midget at gmail dot com
8 years ago
I think there's been a slight overlook within the comments about PHP's model for OOP.

Firstly, I was absolutely thrilled to see the enhancements of PHP5.  I've been using PHP for... gees...  a long time now.  But what's always been lacking has been fully implemented OOP.  Now, granted, there are ways to do things like method overloading, but c`mon.... really...  Now, I know the argument is that PHP is related to the web - not application development.  I believe that the PHP community today suffers from this mentality.  The fact of the matter is that the world is rapidly shifting towards an SOA mentality, and rich applications presented through the web.  In light of this PHP should be regarded as valuable tool for application development.

I would say that while PHP has tremendous strength, it equally lacks in its implementation of OOP requirements.  I find that most suggested "design patterns" are weak workarounds in PHP.  C# (.NET), Java -- hell even ActionScript have a fully OO implementation allowing effective implementation of recognized design patterns.  Futhermore, due to PHP's lack of OO support, true collaborative team development is greatly hindered.  This is particularly evidenced in the lack of strict type casting.  Legit development teams rely on this to effectively lock down their interfaces, implement error handling, etc etc etc.

I'm very dissappointed to see that languages (like C#), sponsored by the likes of M$ have been able to develop such mature OO languages so rapidly, while PHP remains... well... practically in the stone age.

Once these issues are addressed I think we'll see more support of PHP, and less resistance to its place in the enterprise.  Abstraction is a stupid thing to bicker about.  How long does it really take to write a good data abstraction layer - that can be repurposed.  What's more important is the capability of the language.

Hopefully IBM will jump in here and kick things into high gear.  Let's get rid of all the back support and compatabilities for legacy code in favor of maturing the language and increasing its value (and decreasing objections from the enterprise market)
daniel at cedilotte dot com
8 years ago
Another thing related to PHP vs ASP.

In PHP, it's possible to make sure your Include files are not included more than once. Where as in ASP/VBScript, you can't due to the fact that SSI is processed before the VB code.
9 years ago
I really must take issue with (Cash at nospam dot thesilverside dot com)'s comments regarding enterprise applications and PHP.

Yes, PHP is an interpreted language (but...PHP Accelerator? also you can write caching *with* PHP, also checkout, and have you seen the benchmarks for Pharrot?). Adding more tiers into your application is a recipe for disaster since it reduces scalability by creating bottlenecks/crossovers and has a big impact on transparency. I'll admit that for a very few applications, then server hardware is more expensive than developer time - like if you're turning around more than 500000 hits/hour, then it may work out cheaper to develop in 'C' with half the servers than PHP, but this is far from the sort of volume I've seen on an enterprise application. There's a lot been written elsewhere on PHP and scalability which I won't repeat here.

There are issues with using PHP for this kind of application. Firstly managment of privilege - but that applies (AFAIK) to any web-based system. There's also the problem of namespace collisions in large apps.

Since I regularly develop embedded applications with PHP using HTTP as the communications substrate for transactions spanning 6 or more origanisations, I'd like to know whay I shouldn't be using PHP / processing synchronously, and how I can create a near real-time system without synchronous operation.

It'd be a sad world to live in where there was only one programming language/methodoly/idiom - diversity is a great thing. Java provides beans and struts, Coldfusion provides fast development and .NET....(suggestions please). PHP comes closest to solving my problems, many of which are very much in the enterprise applications domain.
phalcomb at arbolnet dot com
11 years ago
My experience with ASP and PHP is about equal, I think they both serve equally as good of a purpose depending on what the programmer is trying to do. I do like the syntax of PHP a lot and the speed of it is great, although the client/server interactivity of ASP with Windows and MAC clients is what I'm excited to see grow with future versions of PHP.
mavi_br at someplace dot com
11 years ago
I've been working with PHP, JSP, Java and CFM for 2 years now.
I can tell that for web development only, php is not nearly as good as cfm on speed, on ease to use and on interaction.
On the other hand you just can't do anything very special with CF like opening a socket with the ease of php.
I would say : use what you need for your application, cfm is truly the fastest, as it has a daemon running instead of a per request, plus the ability to cache queries that is awesome.
php is fast but is a pain on some aspects and has loads of bugs.
JSP have almost no bug at all, or at least i did not find any, but it is hard to debug.
Good thing on JSP is that you can write real applications and have perfect interaction by using classes, plus it is much more of a serious language.The only problem is that you take at least twice times to make same program on JSP and it is not even close as well documented and easy to use as php.
developer at i-space dot org
12 years ago
If you ever tried to configure a web server for WAP, serving WML content you know it's not an easy job. You can easily make dynamic WML pages for mobile phone users with PHP. All the options and extras from DB+PHP oriented web-site can easily be transfomed into a WAP version of your site. With a single line - Header("Content-type: text/vnd.wap.wml"); you can be in another "mobile" dimension :). Take all you need ... and even more.
To Top