Yet Another Web Scaffolding Framework? Thoughts on PayPal’s Kraken

Most people have at least heard of web scaffolding frameworks that provide a generated structure and convenience libraries for a combination component framework and continuation server to quickly write relatively simple web applications. The best known is most likely Rails in the Ruby language, but the origial archetype of such frameworks is the Seaside framework in Smalltalk.

PayPal has recently released another such framework called Kraken. Like Rails and Grails, Kraken closely parallels the generated directory structure, page routing engine and component service libraries of Seaside. However PayPal’s framework is written over node.js and a couple of other common JavaScript libraries.

Why write another, and why in JavaScript? The single major factor promoting JavaScript in web development is simple, virtually every browser supports it on every platform, including mobile browsers. Since Kraken is a server library, though, the advantage here is very indirect – forcing developers that primarily write server side code to write in JavaScript has the side effect of having people in development that are more focused on code and code issues learn JavaScript, and this benefits the UI work already being done in HTML5 and JavaScript, because the needed JavaScript can be written by developers who have become very familiar with it, rather than by designers whose primary interest is not coding. The importance of an interactive UI within a web application is something retail and financial software architects are acutely aware of, and something that improves the JavaScript functions necessary to achieve a good interactive web UI will be seen as a big advantage, even if it simultaneously jeopardizes both code quality and application scalability on the server side.

JavaScript does have a few advantages on the server. Unlike Ruby it is mostly virtualized, which means writing on one platform and running on another is nearly irrelevant. This has become more of an issue in the few years since Rails arrived on the scene as a result of the proportion of developers/designers favouring Mac OS X as a development platform for various reasons. Ruby’s extensive use of native C libraries becomes an impediment when the target server platform is unlikely to be Mac OS X. It also allows a very quick write / test cycle, since JavaScript code is dynamically interpreted, there is no need for a build/deploy task between code changes and test. In this aspect JavaScript with Kraken is closer in terms of development convenience and speed to Smalltalk with Seaside, both having significant advantages over Ruby/Rails or Groovy/Grails.

So what’s not to like? Well, mainly, JavaScript itself. Like any other architectural choice, the use of a particular language over another is not going to guarantee a good or bad system – architecture can only make writing good code and keeping the overall system design clean easier or more difficult. That said, a language as poorly constructed as JavaScript makes writing good web application server code about as difficult as a language choice can make it. What passes for object oriented code in JavaScript would no doubt send Alan Kay into apoplectic rage at the application of the term in a language that barely pretends to support the paradigm. Just as it can in other bastardized hybrid languages like C++, good code can be written in JavaScript, but even good code won’t look like it. The worse problem is similar to the problems that plague structured programming in C and object programming in C++. No matter how good the developers’ intentions might be, if it’s easier to write spaghetti when deadlines are looming, developers will write spaghetti.


One thought on “Yet Another Web Scaffolding Framework? Thoughts on PayPal’s Kraken

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s