Twitter 应用程序开发:PHP 或 javascript...请帮助
Twitter 应用程序开发的首选方法是
使用 Javascript 还是使用 PHP,
如果我们使用 PHP 而不是 Javascript,我们真的可以做更多的事情吗?
其中任何一个在未来都会被弃用吗
?谢谢!
What is the preferred method for twitter application development
Using Javascript or using PHP
Is it true we can do more things if we use PHP instead of Javascript
Is any one of them going to be deprecated in future
Efforrts Appreciated Thanks!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这取决于你想做什么。如果你想要一些能够完成基本的推文抓取功能的东西,可能是 JS。如果您想做更智能的事情,例如计算关键字,那么您将需要 PHP。
它们中的任何一个都会被弃用吗?你得问问推特,希望他们不要改变主意。他们可以随时关闭任何东西。
It depends on what you want to do. If you want something that will do basic grabbing of tweets, probably JS. If you want to do smarter things like count keywords, then you'll need PHP.
Will either of them be deprecated? You'd have to ask Twitter, and hope they don't change their minds. They can turn anything off at any time.
如果您正在讨论在 Web 应用程序中使用 PHP 和 javascript,最重要的区别是:
PHP 在服务器上运行。 JS运行在客户端。
您还可以在服务器上运行 JS 文件,但这不是通常的方法。
JS 会将流量从客户端发送到它所连接的 Web 服务器。 JS 非常容易受到攻击,因为它在你无法控制的地方运行。如果您使用 JS 轮询来自不同域的数据,Web 浏览器有时会有点保守(基本上它们首先询问目标服务器是否允许这种行为)。
PHP 将使流量从您的服务器流向它所连接的服务器。由于你(几乎)完全控制它,所以攻击起来更困难。
如果您能更详细地说明您打算做什么类型的应用程序,也许选择会更容易。
If you are talking about using PHP and javascript in a web application the paramount difference is:
PHP runs on the server. JS runs on the client.
You could also run JS files on the server, but this isn't the usual way.
JS will cause traffic from the client to the web servers it connects. JS is very attackable as it is run where you have no control. Web browsers are sometimes a bit conservative if you use JS to poll data from different domains (basically they ask first the target server if it allows this behaviour).
PHP will cause traffic from your server to the servers it connects. It is harder to attack as you have (almost) full control over it.
If you could specify more in detail what kind of application you are intending to do, perhaps the choice would be easier.
如果你有选择的话,我会说 JS 更好,因为它的异步特性使其速度更快。
If you had a choice, I'd say JS is better as it's considerably faster through it's asynchronous nature.