doushang3352 2012-01-04 14:58
浏览 36
已采纳

PHP使用JavaScript或Flash

This isn't really a code related question, and if it belongs on programmers SE then please migrate it.

I'm working on a project with two other people: I'm doing the PHP/Databases/anything networking related, and I have yet to decide what the other two less experienced programmers are going to do.

If one was to make a browser based game that is multiplayer, should I get the other two to write the basics for the game in Flash or JavaScript?

After they write some code, I will have to review it and link the php and such, but I'm not that familiar with Flash or JavaScript. Which language should I recommend they write the basics in?

  • 写回答

3条回答 默认 最新

  • dourang20110122 2012-01-04 21:36
    关注

    The best answer is: if you can do it, write in NaCl. Hold tight, I'll explain :)

    JavaScript is ultimate crap. Flash is less so, but they stand too close to each other to really tell the difference.

    There is a way, the future should be, as in the best case: the browser vendors agree to standardize the virtual machine, and then we will have plenty of languages to use on the web, better and best. So far we are only limited to an excavated AlphaBasic-like slowpoke JavaScript and extremely unfriendly to end-users, Flash, which is almost the same as JavaScript, except for it doesn't manipulate DOM of HTML pages, but has it's own means of displaying things, and is considerably faster.

    Why use NaCl - a technology, although not widely supported, it is ideologically right - it is an interface for you to run everything you wish the way you like it. You won't find any old cagers like Brendan Eich, who live in the middle ages of programming and would oppose any reasonable innovation to "their" language. Neither battling enterprise giants, driven by marketing concerns only. Of course, Google is just another such enterprise, but so far they don't have to share their plans with anyone else, they can actually do it right, or almost right :) Google has taken very different from Adobe approach on this issue, and, hopefully, this will pan out well for them.

    Adobe, or better said, Macromedia, at the time had these plans about Flash and JS running in the same VM, they even managed to convince Mozilla to join in the game and thus Tamarin project was started. The standardization committee lobbied the initiative, and thus JavaScript remained at version ES3 (the 2000 year standard). The proposed ES5 (the next version) is acknowledged by the authors to have major flaws. Besides, the authors would go on to say that they aren't fixing any defects, or canceling any improperly functioning features - this is because of "battling enterprises" involved, and no one willing to do any extra work, in order to actually make the language / development environment better. Instead, we got a brainwashing campaign telling us how HTML is the new thing etc.

    There are some interesting efforts at abstracting the platform and writing the code using better tools, in a better language - Haxe would be my tool of choice if I ever considered one. It allows in a very intelligent way to program for Flash and JavaScript just the same. It is also possible to write C++ in Haxe, so, even though no special binding for NaCl exists, this shouldn't be impossible in general.

    PS. Sorry for the long post and the "politically-engaged" reaction. I just couldn't miss the opportunity :)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案
  • ¥15 两块ADC0804用proteus仿真时,出现异常
  • ¥15 关于风控系统,如何去选择