Hacker News new | ask | show | jobs
by torkable 4239 days ago
object oriented JS, gross
4 comments

It's not js, it's Processing, which is a simplified version of Java with an elegant, simple API for doing graphics and visual art. It compiles to Javascript via Processing.js.
Better not define any functions or arrays then, they're objects and that would be "gross"
Actually functions or array being objects internally has nothing to do with "object-oriented" as style of writing code. Here it is about style, which is obviously dictated by Processing (and thus Proseccing.js) being ideologically object-oriented. So, well, yeah, it is quite more object-oriented than "proper" code in js, although I don't see why it is such a problem for the person you relply to.
Well actually it does. Every time you do an someArray.push(val), that's "object oriented as a style of writing code".

If you're referring to the style in the article (ie the Java code), well that's classical object oriented.

Better abandon any front-end JS, too...
It's Java...
well, close to. Processing is based on Java, but has a simplified syntax, different visibility model, and different scoping rules. Primarily due to how pde source code gets aggregated into a single class which can be compiled to run in the JVM, but because it's not actually Java any non-JVM implementation of a Procesing runner can pretty much ignore Java entirely and simply implement the much simpler Processing interpretation.
don't be daft, OO is far more classy...