Maria framework connects Smalltalk, MVC to JavaScript

Maria's founder advocates for simplicity rather than the JavaScript community's Frankenstein-esque approach to JavaScript frameworks

connect hands puzzle pieces join fit

Smalltalk, the venerated object-oriented language technology from the 1970s, and MVC are being leveraged in JavaScript development via the Maria framework.

Developed by programmer Peter Michaux, Maria is billed as the "MVC framework for JavaScript applications," providing "real" MVC, Smalltalk MVC, and "The Gang of Four" MVC, referring to the authors of the book, "Design Patterns: Elements of Reusable Object-Oriented Software." MVC, for Model-View-Controller, arose out of Smalltalk.

In a blog post published this past weekend, Michaux laments the evolution of JavaScript frameworks. "The original Smalltalk MVC is an elegant way to structure an application. Unfortunately, the JavaScript community takes more inspiration from Dr. Frankenstein than from Smalltalk," he says. "The community appears to have done its best to saw off many good parts from MVC and bolt on unnecessary ugly bits to create framework monsters unsuitable for building real-world JavaScript applications." When asked via email to name specific JavaScript frameworks that fall into this category, he responded, "All of them do it."

Michaux reasons that the JavaScript community had not looked at Smalltalk code to see how MVC was implemented there. "Had they had the interest and patience to do so, rather than jumping in with their own largely unproven ideas," he says, "they would have seen a easy path to translating Smalltalk's MVC into beautifully organized JavaScript applications."

A developer who has used Maria remains an advocate of Smalltalk, even if it was developed so long ago. "There is one thing Smalltalk can teach us: The value of simplicity and regularity," says J. Vincent Toups, a consulting engineer and data scientist for Agri-Esprit.

"Many languages, JavaScript in particular, but I also think of Ruby, impose enormous 'cognitive load' on the programmer in attempt to make certain things convenient. Smalltalk is extraordinarily simple and well-designed," says Toups, who has used Maria to build a Web interface for a data model related to farm management and information analysis.

When comparing JavaScript to Smalltalk, Toups says he can think of only one instance when Smalltalk's design seems outdated, and it is an obscure example: variables bound as arguments to block do not have lexical scope and can be overwritten if a block re-enters itself. "In essentially every other way, Smalltalk is the nicer platform, excluding network effects like the size of the community, which are of differential value depending on your goals."

Another Maria user, James Ladd, CTO at VRM (vendor relationship management) vendor MyWave, also lauded the framework. "Maria MVC makes the development of JavaScript apps cleaner and easier as it provides a place for the behavior and concerns of the app that are easy for developers to understand coupled with a known pattern for how the app will behave," said Ladd, who also is the developer of Redline Smalltalk, which puts Smalltalk on the JVM.

Although Michaux describes Maria as feature-complete, there will be upgrades: "Likely, the next version will be a documentation upgrade that is in progress and be numbered 1.1.1.The nice thing about Maria is that it isn't constantly changing on the developers that use it. It is a good library that is stable."

To comment on this article and other InfoWorld content, visit InfoWorld's LinkedIn page, Facebook page and Twitter stream.
Related:
From CIO: 8 Free Online Courses to Grow Your Tech Skills
Notice to our Readers
We're now using social media to take your comments and feedback. Learn more about this here.