PHP与Java / J2EE相比 [英] PHP compared to Java/J2EE
问题描述
我想知道我是否可以得到一个合理的民事(没有开始任何
巨大的战争)关于服务器端的意见PHP与服务器端相比
Java。
我已经是近十年的Java开发人员,而且我是
很高兴。但是,我不禁注意到我住的地方有大量基于PHP的开发项目,
我在搜索时也注意到了在互联网上准备好了 -
制作了很多用PHP构建的Web应用程序。
作为一个面向对象的程序员我一直认为PHP更像是一种用于在单个网页上执行操作或编写小型应用程序的b / b
脚本语言,并且Java / J2EE更适合于
写大型应用程序,但也许这不再是真的。
让我知道你的想法。谢谢。
弗兰克
Hi,
I''m wondering if I can get a reasonably civil (without starting any
huge wars) opinion on how server-side PHP compares to server-side
Java.
I''ve been strictly a Java developer for almost 10 years now, and I''m
pretty happy with it. However, I can''t help but notice that there are
a significant amount of PHP-based development projects where I live,
and I''ve also noticed when searching around the internet for ready-
made web applications that a lot of them are in PHP.
As an object-oriented programmer I''ve always assumed PHP was more of a
scripting language for doing things on individual web pages or writing
small applications and that Java/J2EE was better positioned for
writing large applications, but maybe that''s no longer true.
Let me know what you think. Thanks.
Frank
推荐答案
11月14日下午2:35,flarosa < fr ... @ franklarosa.comwrote:
On Nov 14, 2:35 pm, flarosa <fr...@franklarosa.comwrote:
我想知道我是否能得到关于服务器端PHP与服务器端的对比情况(或者说是
Java)的合理民事(没有开始任何
巨大的战争)意见。
我已经严格地成为Java开发人员已有近10年了,而且我很高兴.b
$ b非常高兴。但是,我不禁注意到我住的地方有大量基于PHP的开发项目,
我在搜索时也注意到了在互联网上准备好了 -
制作了很多用PHP构建的Web应用程序。
作为一个面向对象的程序员我一直认为PHP更像是一种用于在单个网页上执行操作或编写小型应用程序的b / b
脚本语言,并且Java / J2EE更适合于
写大型应用程序,但也许这不再是真的。
让我知道你的想法。谢谢。
Frank
Hi,
I''m wondering if I can get a reasonably civil (without starting any
huge wars) opinion on how server-side PHP compares to server-side
Java.
I''ve been strictly a Java developer for almost 10 years now, and I''m
pretty happy with it. However, I can''t help but notice that there are
a significant amount of PHP-based development projects where I live,
and I''ve also noticed when searching around the internet for ready-
made web applications that a lot of them are in PHP.
As an object-oriented programmer I''ve always assumed PHP was more of a
scripting language for doing things on individual web pages or writing
small applications and that Java/J2EE was better positioned for
writing large applications, but maybe that''s no longer true.
Let me know what you think. Thanks.
Frank
Frank,
前一段时间我问自己同样的问题。大多数答案我在b $ b发现它:
http://www.tbray.org/ongoing/When/20...-Frameworks
希望它有所帮助
Frank,
I asked myself the same question some time ago. most of the answer i
found it at:
http://www.tbray.org/ongoing/When/20...ing-Frameworks
hope it helps
flarosa写道:
flarosa wrote :
>
我想知道我是否可以得到一个合理的民事(没有开始任何
巨大的战争)关于服务器端PHP与服务器端的比较的意见
Java。
我已经严格地成为了Java开发人员近10年了,而且我很高兴.b
$ b非常高兴。但是,我不禁注意到我住的地方有大量基于PHP的开发项目,
我在搜索时也注意到了在互联网上准备好了 -
制作了很多用PHP构建的Web应用程序。
作为一个面向对象的程序员我一直认为PHP更像是一种用于在单个网页上执行操作或编写小型应用程序的b / b
脚本语言,并且Java / J2EE更适合于
写大型应用程序,但也许这不再是真的。
Hi,
I''m wondering if I can get a reasonably civil (without starting any
huge wars) opinion on how server-side PHP compares to server-side
Java.
I''ve been strictly a Java developer for almost 10 years now, and I''m
pretty happy with it. However, I can''t help but notice that there are
a significant amount of PHP-based development projects where I live,
and I''ve also noticed when searching around the internet for ready-
made web applications that a lot of them are in PHP.
As an object-oriented programmer I''ve always assumed PHP was more of a
scripting language for doing things on individual web pages or writing
small applications and that Java/J2EE was better positioned for
writing large applications, but maybe that''s no longer true.
我已经完成了工作
PHP
- 脚本语言。除非您使用预编译器,否则每次页面命中时都会读取和解释源代码,但是然后主机服务器必须有一个特殊的Apache扩展才能运行它。
- 因为上面使用很多常量是很昂贵的,所以
你得到了很多神奇的数字
- 某种OO。它有类,但是实现并不完整。
事实之后它被拴上了,所以你可以将OO与程序混合。
- 其中一个重要特征是包括的能力(或要求)
文件。这样你就可以从许多较小的文件构建一个网页。
但是,包含文件可能在父文件中使用的任何变量必须由父文件创建。文件。所以你可以包含一个文件
,它需要一个变量,只是因为变量
不存在而导致崩溃。使调试变得困难。
- 按设计,演示代码与业务逻辑混合
- 非常适合小型项目
Java
- 编译语言。编译器生成字节码。服务器读取字节码的
并使用Java Runtime Environment(JRE)来运行它。
- 所有常量都由编译器解析,所以使用很多常量
使代码更具可读性。
- JRE将检查代码执行路径,并将在
优化它。因此,代码运行的时间越长,运行的速度就越快。
- 设计是OO还是b $ b - 非常适合大型项目。
因此,对于小型简单项目,我使用PHP。对于任何严肃的事我都会使用
Java。
I have done work in both
PHP
- scripting language. The source code gets read and interpreted every
time a page hit occurs, unless you are using a precompiler, but then
the host server must have a special Apache extension to run it.
- becuase of the above it is expensive to use a lot of constants, so
you end up with a lot of magic numbers
- sort of OO. It has classes, but the implementation is not complete.
It was bolted on after the fact, so you can mix OO with procedural.
- one of the big features is the ability to "include" (or "requires") a
file. That way you build up a web page from many smaller files.
However, any variable which an included file might use from the parent
file, must be created by the parent file. So you may include a file
which requires a variable, only to have it crash becasue that variable
is not present. Makes debugging difficult.
- by design, presentation code is mixed with business logic
- great for small projects
Java
- compiled language. The compiler produces byte-code. The server reads
the byte code and uses the Java Runtime Environment (JRE) to run it.
- All constants are resolved by the compiler, so using many constants
makes the code more readable.
- The JRE will inspect the code execution path and will optimize it on
the fly. So the longer your code runs, the faster it runs.
- Is OO by design
- great for large projects.
So for small simple projects I use PHP. For anything serious I use
Java.
0.02
-
Wojtek :-)
0.02
--
Wojtek :-)
这篇关于PHP与Java / J2EE相比的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!