python互联网开发比java快_在快速开发方面,是什么让其他语言比Java更快?

在花了多年时间构建java驱动的webapps之后,我转而使用PHP,对我来说,这种差异主要是因为要设置的东西要少得多,而且像PHP这样的语言都是松散类型的,这意味着你不必费劲地将东西转换成其他东西,代码行数行似乎有点过火。在

java示例://omitting the lines and lines of stuff to set up a request and

//the try catch and the exeptions that *might* get thrown

String numberInput = request.getAttribute('numberInput');

int result=0;

if (numberInput!=null && numberInput.length()>0)

{

result=Integer.parseInt(numberInput)+1;

//but now we need to wrap this in a try/catch to catch NFE exeptions

}

//can't just echo it, need to set up an output thingy... ommitting all that too

out.print(result);

out.flush();

out.close();

要使用PHP实现相同的功能:

^{pr2}$

这对我来说是最大的好处,因为在必须验证用户输入时,我总是对java感到沮丧。每次我都要做很多事情,每次输入,在PHP中都是不必要的。当然,验证仍然必须完成,在PHP中要容易得多。在

希望这有帮助。在

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值