谷歌应用程序引擎——Java还是Python?

时间:2021-07-26 02:14:23

I noticed that this was asked in the following post. Has anyone used both and can conclusively tell me which is better? It seems like python might be a little easier to implement and faster?

我注意到这是在下面的帖子中被问到的。有没有人两者都用过,并能最终告诉我哪个更好?看起来python可能更容易实现和更快?

10 个解决方案

#1


17  

By this time, both implementations are reasonably mature and solid, and their functionality is pretty similar (I don't think it's quite 100% equal yet, but, moving in that direction). So, if you already know only one of the two languages, I'd say "just go for it". If you already know both, you don't need my advice;-).

到目前为止,这两种实现都相当成熟和可靠,它们的功能也非常相似(我不认为它们是100%相等的,但是,朝着这个方向前进)。所以,如果你已经知道这两种语言中的一种,我就会说“去学吧”。如果你已经知道这两个,你不需要我的建议;

If you know neither, but are rarin' to try some of the non-Java languages that are (more or less;-) supported on the JVM side of GAE (I believe this includes Scala, server-side Javascript, JRuby, etc), then it's worth trying. If you know neither, and don't want to risk a "not-first-class-supported language", I'd definitely agree with your observation that Python's faster to learn (but of course I'm biased in favor of Python;-).

如果您两者都不知道,但是很少尝试在GAE的JVM端(我认为这包括Scala、服务器端Javascript、JRuby等)支持的一些非java语言,那么这是值得一试的。如果您两者都不知道,并且不想冒险使用“不优先类支持的语言”,那么我绝对同意您的观察,即Python学习速度更快(当然,我偏爱Python;-)。

#2


8  

I have used both, and my conclusion is that biggest difference is in libraries. In theory both have good libraries to do almost everything but in practice many libraries don't work with app engine:

我两者都用过,我的结论是最大的区别在于图书馆。理论上,它们都有很好的库来做几乎所有的事情,但实际上许多库都不能与应用程序引擎一起工作:

  • All Java libraries are pure Java and should work, but as app engine does not allow threads and not even all *java.** dependencies it is... lets say problematic.
  • 所有的Java库都是纯Java的,应该可以工作,但是因为应用程序引擎不允许线程,甚至不允许所有的* Java。* *依赖它是……假设问题。
  • Python on the other hand have way less libraries out there, and many are just wrappers for native C libraries, which don't work either. :(
  • 另一方面,Python有更少的库,而且许多只是本地C库的包装器,它们也不能工作。:(

As both versions have such bad support for libraries, I call it tie. For very simple "just to show some content" -web app you don't need any external libraries of course.

由于两个版本对库的支持都很差,所以我将其称为tie。对于非常简单的“只是显示一些内容”——web应用程序,当然不需要任何外部库。

I use now Python because it rules. ;)

我现在用Python是因为它有规则。,)

#3


4  

"Better" is always subjective. For GAE, the choice of which is better for you depends on what you're most familiar with. If you've got experience with Java, use that, and if you've got experience with Python, use that. I don't think there's any objective criteria that would point to one being "better" than the other.

“更好”永远是主观的。对于GAE来说,选择哪种更好取决于您最熟悉的内容。如果您有使用Java的经验,那么请使用它,如果您有Python的经验,请使用它。我不认为有任何客观的标准可以指出其中一个比另一个“好”。

#4


3  

Its not just the language that you need to consider here. Libraries, frameworks, and tools are also relevant factors.

这不仅仅是你需要考虑的语言。库、框架和工具也是相关的因素。

If you have no background in either language or web development, I would suspect Python would be easier to get off the ground with. It has been around longer, there is likely more support and knowledge available. Doing something simple is generally simple to do and the Python framework is in my opinion more lightweight.

如果您没有任何语言或web开发的背景,我想Python会更容易入门。它已经存在很长时间了,可能会有更多的支持和知识。做一些简单的事情通常很简单,在我看来Python框架更轻量级。

Despite this, I would rather use Java. However, my reasons are controversial and I don't want to troll :D.

尽管如此,我还是宁愿使用Java。然而,我的理由是有争议的,我不想说。

#5


3  

Python was the language Google AppEngine was originally designed for, and it has been supported for longer than Java (which only got included comparatively recently). Additionally, Guido van Rossum, the creator of Python, works on the Python side of AppEngine. The same can not be said about Java's creator.

Python是谷歌AppEngine最初设计的语言,它的支持时间比Java要长(Java最近才加入)。此外,Python的创建者Guido van Rossum也在AppEngine的Python方面工作。对于Java的创建者来说,情况并非如此。

It seems that there is more documentation and articles about Python on AppEngine than Java, probably because Python has been used in AppEngine for longer.

在AppEngine上关于Python的文档和文章似乎比Java多,这可能是因为Python在AppEngine中使用的时间更长。

My advise: Use Python. But that doesn't mean Java is a bad choice, because it is not, I just think Python is a better choice in this instance.

我的建议:使用Python。但这并不意味着Java是一个糟糕的选择,因为它不是,我只是认为在这个实例中Python是一个更好的选择。

#6


2  

Python ( subjectively speaking )

Python(主观地说)

#7


1  

.py chosen here for all gae projects for reasons more readable, less lines code, higher level same time java has more ways to solve a given problem. Approx estimate same function with python is 1/10 the code compared to java.

这里为所有gae项目选择.py的原因是可读性更强,代码更少,级别更高,同时java有更多的方法来解决给定的问题。与python估计相同的函数值是java的1/10。

#8


1  

i use python, becouse always can get the best of django in appengine

我使用python,因为在appengine中,库斯总是可以获得django的最好性能

#9


0  

I use Groovy (Grails) with GAE. It has Java's library universe and you should have roughly the same LOC compared to Python. Yeah, its not 100% Java (if you want to), but very close. The BIG difference is roughly the JavaVM speed, that's one of the reasons Groovy (Grails) has gained so much popularity - especially people like my who dislike Python .)

我在GAE中使用Groovy (Grails)。它拥有Java的库,与Python相比,您应该拥有大致相同的LOC。是的,它不是100%的Java(如果你想的话),但是非常接近。最大的区别大概是JavaVM速度,这是Groovy (Grails)如此受欢迎的原因之一——尤其是像我这样不喜欢Python的人)。

#10


0  

It maybe possible to use Jython in appengine so you could use both. One thing I would say about the python productivity vs Java productivity argument is Java has excellent IDE's to speed up development where as Python is really lacking in this area because of its dynamic nature. So even though I prefer to use Python as a language, I don't believe it gives quite the productivity boost compared to Java when using a new framework. Also I have as yet not been able to get the python version of google app engine to work in Netbeans which is a royal pain.

也许可以在appengine中使用Jython,这样您就可以同时使用它们了。关于python生产力与Java生产力的争论,我想说的一件事是,Java有优秀的IDE来加速开发,因为python由于其动态特性而在这方面确实缺乏。因此,尽管我更喜欢将Python作为一种语言来使用,但我认为在使用新框架时,与Java相比,它并没有带来很大的生产力提升。此外,我还没能让python版本的谷歌应用程序引擎在Netbeans中工作,这是一个巨大的痛苦。

#1


17  

By this time, both implementations are reasonably mature and solid, and their functionality is pretty similar (I don't think it's quite 100% equal yet, but, moving in that direction). So, if you already know only one of the two languages, I'd say "just go for it". If you already know both, you don't need my advice;-).

到目前为止,这两种实现都相当成熟和可靠,它们的功能也非常相似(我不认为它们是100%相等的,但是,朝着这个方向前进)。所以,如果你已经知道这两种语言中的一种,我就会说“去学吧”。如果你已经知道这两个,你不需要我的建议;

If you know neither, but are rarin' to try some of the non-Java languages that are (more or less;-) supported on the JVM side of GAE (I believe this includes Scala, server-side Javascript, JRuby, etc), then it's worth trying. If you know neither, and don't want to risk a "not-first-class-supported language", I'd definitely agree with your observation that Python's faster to learn (but of course I'm biased in favor of Python;-).

如果您两者都不知道,但是很少尝试在GAE的JVM端(我认为这包括Scala、服务器端Javascript、JRuby等)支持的一些非java语言,那么这是值得一试的。如果您两者都不知道,并且不想冒险使用“不优先类支持的语言”,那么我绝对同意您的观察,即Python学习速度更快(当然,我偏爱Python;-)。

#2


8  

I have used both, and my conclusion is that biggest difference is in libraries. In theory both have good libraries to do almost everything but in practice many libraries don't work with app engine:

我两者都用过,我的结论是最大的区别在于图书馆。理论上,它们都有很好的库来做几乎所有的事情,但实际上许多库都不能与应用程序引擎一起工作:

  • All Java libraries are pure Java and should work, but as app engine does not allow threads and not even all *java.** dependencies it is... lets say problematic.
  • 所有的Java库都是纯Java的,应该可以工作,但是因为应用程序引擎不允许线程,甚至不允许所有的* Java。* *依赖它是……假设问题。
  • Python on the other hand have way less libraries out there, and many are just wrappers for native C libraries, which don't work either. :(
  • 另一方面,Python有更少的库,而且许多只是本地C库的包装器,它们也不能工作。:(

As both versions have such bad support for libraries, I call it tie. For very simple "just to show some content" -web app you don't need any external libraries of course.

由于两个版本对库的支持都很差,所以我将其称为tie。对于非常简单的“只是显示一些内容”——web应用程序,当然不需要任何外部库。

I use now Python because it rules. ;)

我现在用Python是因为它有规则。,)

#3


4  

"Better" is always subjective. For GAE, the choice of which is better for you depends on what you're most familiar with. If you've got experience with Java, use that, and if you've got experience with Python, use that. I don't think there's any objective criteria that would point to one being "better" than the other.

“更好”永远是主观的。对于GAE来说,选择哪种更好取决于您最熟悉的内容。如果您有使用Java的经验,那么请使用它,如果您有Python的经验,请使用它。我不认为有任何客观的标准可以指出其中一个比另一个“好”。

#4


3  

Its not just the language that you need to consider here. Libraries, frameworks, and tools are also relevant factors.

这不仅仅是你需要考虑的语言。库、框架和工具也是相关的因素。

If you have no background in either language or web development, I would suspect Python would be easier to get off the ground with. It has been around longer, there is likely more support and knowledge available. Doing something simple is generally simple to do and the Python framework is in my opinion more lightweight.

如果您没有任何语言或web开发的背景,我想Python会更容易入门。它已经存在很长时间了,可能会有更多的支持和知识。做一些简单的事情通常很简单,在我看来Python框架更轻量级。

Despite this, I would rather use Java. However, my reasons are controversial and I don't want to troll :D.

尽管如此,我还是宁愿使用Java。然而,我的理由是有争议的,我不想说。

#5


3  

Python was the language Google AppEngine was originally designed for, and it has been supported for longer than Java (which only got included comparatively recently). Additionally, Guido van Rossum, the creator of Python, works on the Python side of AppEngine. The same can not be said about Java's creator.

Python是谷歌AppEngine最初设计的语言,它的支持时间比Java要长(Java最近才加入)。此外,Python的创建者Guido van Rossum也在AppEngine的Python方面工作。对于Java的创建者来说,情况并非如此。

It seems that there is more documentation and articles about Python on AppEngine than Java, probably because Python has been used in AppEngine for longer.

在AppEngine上关于Python的文档和文章似乎比Java多,这可能是因为Python在AppEngine中使用的时间更长。

My advise: Use Python. But that doesn't mean Java is a bad choice, because it is not, I just think Python is a better choice in this instance.

我的建议:使用Python。但这并不意味着Java是一个糟糕的选择,因为它不是,我只是认为在这个实例中Python是一个更好的选择。

#6


2  

Python ( subjectively speaking )

Python(主观地说)

#7


1  

.py chosen here for all gae projects for reasons more readable, less lines code, higher level same time java has more ways to solve a given problem. Approx estimate same function with python is 1/10 the code compared to java.

这里为所有gae项目选择.py的原因是可读性更强,代码更少,级别更高,同时java有更多的方法来解决给定的问题。与python估计相同的函数值是java的1/10。

#8


1  

i use python, becouse always can get the best of django in appengine

我使用python,因为在appengine中,库斯总是可以获得django的最好性能

#9


0  

I use Groovy (Grails) with GAE. It has Java's library universe and you should have roughly the same LOC compared to Python. Yeah, its not 100% Java (if you want to), but very close. The BIG difference is roughly the JavaVM speed, that's one of the reasons Groovy (Grails) has gained so much popularity - especially people like my who dislike Python .)

我在GAE中使用Groovy (Grails)。它拥有Java的库,与Python相比,您应该拥有大致相同的LOC。是的,它不是100%的Java(如果你想的话),但是非常接近。最大的区别大概是JavaVM速度,这是Groovy (Grails)如此受欢迎的原因之一——尤其是像我这样不喜欢Python的人)。

#10


0  

It maybe possible to use Jython in appengine so you could use both. One thing I would say about the python productivity vs Java productivity argument is Java has excellent IDE's to speed up development where as Python is really lacking in this area because of its dynamic nature. So even though I prefer to use Python as a language, I don't believe it gives quite the productivity boost compared to Java when using a new framework. Also I have as yet not been able to get the python version of google app engine to work in Netbeans which is a royal pain.

也许可以在appengine中使用Jython,这样您就可以同时使用它们了。关于python生产力与Java生产力的争论,我想说的一件事是,Java有优秀的IDE来加速开发,因为python由于其动态特性而在这方面确实缺乏。因此,尽管我更喜欢将Python作为一种语言来使用,但我认为在使用新框架时,与Java相比,它并没有带来很大的生产力提升。此外,我还没能让python版本的谷歌应用程序引擎在Netbeans中工作,这是一个巨大的痛苦。