处理与(普通)Java
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4227177/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Processing vs. (plain) Java
提问by Gabe Johnson
A lot of people in my lab use Processing. Certainly their work is cool, but I wonder what is the advantage to using Processing over plain old Java? Does it let me do things that I otherwise would be really difficult?
我实验室里的很多人都在使用Processing。当然他们的工作很酷,但我想知道使用 Processing 比普通的旧 Java 有什么优势?它能让我做一些我本来会很困难的事情吗?
Yes, I have looked around at http://processing.orgbut it doesn't really explain why Processing is anything more that just Java with a neat IDE and set of libraries.
是的,我已经环顾了http://processing.org,但它并没有真正解释为什么 Processing 不仅仅是具有简洁的 IDE 和一组库的 Java。
采纳答案by Carlo del Mundo
Just put it this way--- it looks like Processing is just creating another abstraction layer to "mask" certain programmatic elements in Java that would be deemed "difficult" for a beginner.
就这么说吧——看起来Processing 只是在创建另一个抽象层来“屏蔽”Java 中的某些程序元素,这些元素对于初学者来说是“困难的”。
In essence, abstraction allows us to actually "do stuff more easily" with less background knowledge on the subject. If you were to create/process images in plain Java, that would be a headache.
从本质上讲,抽象使我们能够以较少的背景知识“更轻松地做事”。如果您要使用纯 Java 创建/处理图像,那将是一件令人头疼的事情。
Processing looks like it creates that framework so all you do is use the tools available (maybe drag/drop if I'm not mistaken?) to create a finished product without doing the nitty-gritty stuff.
Processing 看起来像是创建了那个框架,所以你要做的就是使用可用的工具(如果我没记错的话,也许可以拖/放?)来创建一个成品,而无需做任何细节的事情。
回答by cgp
Just a total guess (I know nothing about Processing), but people like to be expressive, and Java is about the least elegant language I know. If Processing allows you to be elegant, it probably would be pretty attractive to people who feel as I do about Java.
只是一个完全的猜测(我对处理一无所知),但人们喜欢表达,而 Java 是我所知道的最不优雅的语言。如果Processing 能让你变得优雅,那么它可能对那些和我一样对Java 有看法的人很有吸引力。
回答by slebetman
It is basically just rebranding. It is aimed at artists, musicians, hobbyist and 10 year olds rather than programmers. If you tell an art student that he has to learn Java he'll likely balk at the idea. Java is a fairly complicated language after all and he'd have wrap his head around OOP concepts (which, contrary to propoganda, is not intuitive to normal non-programmer humans).
它基本上只是品牌重塑。它面向艺术家、音乐家、业余爱好者和 10 岁的孩子,而不是程序员。如果你告诉一个艺术专业的学生他必须学习 Java,他可能会拒绝这个想法。Java 毕竟是一种相当复杂的语言,他会围绕着 OOP 概念(与宣传相反,对于普通的非程序员人类来说并不直观)。
Processing (and its sister languages Processing.js and Wiring (which is in C)) is more a programming style + a very large, easy to use, well documented library. Programs in Processing are generally procedural in nature rather than OO. Programs are not expected to be larger than a single file though you can do it if you want to. On the other hand, the library included is very high level and you can get a lot done in just a dozen lines of code.
Processing(及其姊妹语言 Processing.js 和 Wiring(使用 C 语言))更像是一种编程风格 + 一个非常大、易于使用、文档齐全的库。Processing 中的程序本质上通常是程序性的,而不是面向对象的。预计程序不会比单个文件大,但如果您愿意,您可以这样做。另一方面,包含的库是非常高级的,您可以在短短十几行代码中完成很多工作。
Why bastardize Java/javascript/C this way? Well, it's to remove as many barriers as possible to writing code. Remember the target audience. You're supposed to be able to teach Processing to your 12 year old daughter in a couple of afternoons and she should be able to animate pink hearts and unicorns across the screen if she wants to.
为什么要以这种方式混杂 Java/javascript/C?嗯,这是为了尽可能多地消除编写代码的障碍。记住目标受众。您应该能够在几个下午内将 Processing 教给您 12 岁的女儿,如果她愿意,她应该能够在屏幕上制作粉红色的心形和独角兽动画。
回答by Kobby
Coming from a former new media art student who uses Processing a lot as well as Open Frameworksand Cinder, Processing in its own self contained universe is great for creating interesting interactive and non interactive graphics, sound and even 3d models at times. But anyone with advanced knowledge or interest in Processing, will quickly learn that anything worthwhile to create other than a fun effect will most likely require an understanding and implementation of OOP principles, along with realizing that Processing isn't the end all be all and the the rest of Java is there to play with and start to use Processing as a library inside eclipse or another IDE, for Java development, just like anyone with advanced knowledge or interest in Open Frameworks or Cinder will see the limits there and start to use them as toolkits for C++ development.
来自一位前新媒体艺术学生,他经常使用 Processing 以及Open Frameworks和Cinder, 在它自己的自包含宇宙中处理非常适合创建有趣的交互式和非交互式图形、声音甚至 3d 模型。但是任何对处理具有高级知识或兴趣的人都会很快了解到,除了有趣的效果之外,任何值得创造的东西很可能都需要理解和实施 OOP 原则,同时意识到处理并不是一切的最终目的。 Java 的其余部分可以使用并开始使用 Processing 作为 Eclipse 或其他 IDE 中的库,用于 Java 开发,就像任何对开放框架或 Cinder 具有高级知识或兴趣的人都会看到那里的限制并开始使用它们作为 C++ 开发的工具包。
An art student may not learn Java or C++ in order to create software, but we do learn those languages in order to create things that look, interact, feel, and sound interesting. And Processing makes a lot of sense as a starting point for that purpose. The truth is that any one who is only creating single file sketches exclusively in the Processing language with no OOP implementation is no more a beginner or noob at programming than Software Engineering student who hasn't fully grasped the concept of OOP.
艺术专业的学生可能不会为了创建软件而学习 Java 或 C++,但我们确实学习这些语言是为了创建看起来、交互、感觉和听起来都很有趣的东西。处理作为该目的的起点非常有意义。事实是,与没有完全掌握 OOP 概念的软件工程专业学生相比,任何仅使用处理语言创建单个文件草图而没有 OOP 实现的人都不再是编程的初学者或菜鸟。
回答by kevinf7
Processing makes creating visual effects, animation (2D and 3D), interactivity, etc easy. The framework is already more or less set up to create such programs and many unnecessary Java elements are hidden. I say hidden because the programmer can still access the full blown Java language if they wish to, and that is the beauty of Processing. It allows beginners to create programs without all the messy overhead and as you grow you can draw on more advanced concepts.
处理使创建视觉效果、动画(2D 和 3D)、交互性等变得容易。该框架已经或多或少地设置为创建此类程序,并且隐藏了许多不必要的 Java 元素。我说隐藏是因为程序员仍然可以访问完整的 Java 语言,如果他们愿意的话,这就是 Processing 的美妙之处。它允许初学者创建程序而无需所有杂乱的开销,并且随着您的成长,您可以借鉴更高级的概念。
To the other respondents that say Processing is not object oriented - of course it is! It is built on Java after all. Like I said earlier it is up to the programmer. If he wishes to create more advanced programs he can do so and pull on all the power of object oriented.
对于其他说处理不是面向对象的受访者 - 当然是!毕竟它是建立在 Java 之上的。就像我之前说的,这取决于程序员。如果他希望创建更高级的程序,他可以这样做并利用面向对象的所有功能。