Thursday, February 09, 2006

Processing Notes, 8 February 2006

Last night's lecture topic was shape grammars. Since we spent much of the time on background and theory, my Processing reflections are skimpy-er.

Method listing: I tend to find the sophisticated code completion features of environments like Eclipse to be overkill, but one specific tidbit would help novices learning to program with Processing: Method listing, or being able to see a list of all the methods defined on an object. Don't bother with changing what I'm typing — no one ever wants that — but instead follow another common interface metaphor: Select a bit of code, right-click, [Processing parses that tab's AST-and-thinks,] and then show a list of methods in the context menu. Oh and if you don't have a right mouse button, stop drinking the koolaid.

This is important for Java-specific classes, since Sun goes through great effort to bury and obscure the JDK documentation. Kinda like their API... (Thank you javadocs.org.) Coping with inconsistent naming schemes is another good reason (.println() for “print line” but .printMatrix() for “print matrix”). And lastly, method listing would encourage better software design, as the names chosen for methods will be more visible by “trickling up.”

Arrays as primitives: The newer releases of the Sun's JDK reveal one of the early design mistakes in Java, since arrays have become progressively more like proper high-level data types. Processing should embrace this by providing someArray.length() as a pseudo-method on arrays (note the parens), instead of the inconsistent someArray.length. For novices, inconsistency details matter.

Duck typing: Not so much a Processing enhancement, but my crying over another in a long line of student questions about the utter madness of teaching novices un-duck typed languages:

Student: Why do we have to cast what comes out of the vector?
Lecturer: Because Java is a overly typed language.
Student: Huh?
Lecturer: Because it's faster. Or something.
Student: But don't we usually ignore performance problems while learning to program...?
Lecturer: /cries

On on that cheery note, that's it for this week.

0 Comments:

Post a Comment

<< Home