Seaside: Your Next Web App Framework
linux-mag.com
linux-mag.com
does anyone else ever feel overwhelmed and have trouble deciding which tech is the best and which to devote time to mastering? I know it depends on the developer and the specific project, but for someone relatively new to web tech in general how should I determine which to pursue?
For example, when Rails was new, I built a small personal project with it (http://notifyr.com/). It was a pain to deploy and I wouldn't use it on a production site (not that it couldn't be done, I just didn't want to deal with it. We're talking pre-Mongrel), but understanding concepts like MVC or CoC changed the way I was coding PHP profoundly, and made it easier to get competent with Rails once it was more mature.
(There is an exception, though: Some people make a living following tech hype. When a new technology starts getting mentioned in places like Wired or the NY Times, there's bound to be an unmet demand for coders who can use it. This can be pretty lucrative, but OTOH working with people who get their tech perception from these sources can be, er, interesting)
As for knowing stuff like CSS, JQuery, Prototype etc, I treat it like foreign language - you need to know enough to get around, perhaps express simple ideas or read the newspaper if you stay for a while. But you rarely need to know it at a Shakespeare level.
I think I will continue to really focus on the things that I am comfortable with and read about and slowly investigate the mass of other things available out there. Thanks for the suggestion/info
<h3>hello</h3>
… in Seaside you write: html heading level: 3; with: 'hello'.
ouch.P.S. We, CLers, had various html-embedding formats battle it out over the years and it seems like CL-WHO won.
(:h3 "Hello)But, I've worked with many a developer who couldn't tell you why divs differ from spans.
Still think of the HTML in the same vein has producing JSON, XML, etc. The CSS is then just the design logic maintained (hopefully!) by the designer.
But there are many advantages to this way of having the html as smalltalk code. You can use the same refactoring tools you use on code to refactor your html. You use the same abstraction and composition mechanisms to structure your html. You use the same control structures for you html than for your code (which are very clear in smalltalk). You can put some html in a method and reuse it in many places, it's also easy for easier to create your own components or tags in seaside than it is in other web component frameworks I have used.
Its like:
html {
h3 { 'hello' }
}
... in Markapl (Perl) or Markaby (Ruby).Much nicer to build (display|markup) logic here than with HTML template methinks.
For the Smalltalk and Seaside experts here: is there a Smalltalk environment which supports Seaside, (ideally) runs on a Mac and doesn't make me learn a whole new set of UI conventions, keyboard shortcuts, and so on? (I'll accept a Windows or Unix environment I can run in a VM.) It does not have to be free or open-source, but must have a free trial version I can play with.
http://www.seaside.st/download/squeak
34.7MB - just extract and double click.
A picture of the UI here (300K):
http://farm3.static.flickr.com/2518/3745940640_d0c6c8062f_o_...
To get a feel, you could look at: http://localhost:8080/seaside/examples/examplebrowser (use the pulldown at the top left) and http://localhost:8080/seaside/tests/scriptaculous
Good luck, ...Stan
edit - It's on Pharo, which is essentially a version of Squeak completely cleaned up.
All free under MIT licence
Still there are solutions: http://continuity.tlt42.org/Performance_and_Scalability
Form verification always happens first on the client (to avoid a server roundtrip), and only if the user doesn't have JS enabled does it hit the server. When presented with that problem, not having continuations on the server isn't nearly as much pain as switching between languages to write the same verification code twice.
This isn't to say that using continuations for such a purpose isn't snazzy, it's just that, among all the crap you have to do to have form validation, that isn't big, in the total scheme of things.
Are there any really major uses of continuations? I remember hearing that Viaweb used a continuation-based thing to do color-picking and take you back to the same page, but nowadays that'd be done with Javascript popping a window up.
(This comment box's continuation expired. That's a pretty unhelpful application of continuations.)
What is it linux-mag? spell-checker wont let you say "git"?
If Objective-C is a gold Canadian dollar, Smalltalk is the Aureus die from which the imperial roman wealth was forged.
Beautiful. Because of that imagery, I'm looking more into Smalltalk now.
Deleted comment
"Wrote" my own over the last few days, but was told by fellow CL'ers it's already been done.
What I did was generate the database tables, the html form rendering code (each class as a form), the server side function to validate the form input along with the client-side input validating javascript. That is:
(defview user ()
((name :type string :display-info :text)
(passwd :type string :display-info :password)))
generates all of the following:1) A CLSQL Object<-->RDBMS ORM thinggie. The class definition defines a table in the database (transparently), and each class instansiation creates a database record. You use (find-object :class 'user :id objec-id) to get it back; the code takes care of mapping a SQL select result-set to a single USER object or a list of objects.
2) It automatically generates DISPLAY-USER method for each class, which generates a semantically sane HTML form. For has id="user_class" and class="defview". You can customize the "rendering" of each class by customizing the unique element ID, or the whole set of generated views by customizing the CSS class.
3) It automatically generates the viewing page example.com/class-name, and it takes arguments as example.com/class-name/object-id. If not object ID is supplied you get an object creation form where all the editable slots are rendered.
4) It automatically generates example.com/class-name/validate, which is a server side script which you can use to validate the input of /class-name the creation method.
--
I have been on this fucker for the last 3 days and today I reverse engineered a whole site from a database of 34 tables. In ONE day. Took me two days to write the macro to do this, but I did it, and it's not pretty.
So far it jus supported html input types text and password, and textarea. I added a new "widget" called :label, which is input text with readonly="true".
My Ajax-fu is still weak and i am sick of this hack of mine already. Specially since someone told me there established tools that do this. UnCommonWeb and Lisp on Lines.
meh.
They all work fabulously and I can't imagine why I'd spend time trying to change tools, when I can get better at designing software and business processes.
Also, since its a completely client-side framework, it can still work together with server-side frameworks like Sinatra and Rails. That means I haven't lost the time I spent learning Ruby.
That's not good enough for me.
I started with BASIC. I learned PERL and did some CGI stuff with it. Then I learned PHP. I used PHP for a long time, and would rate myself as expert level, especially based on writing good solid OOP code and using good OOP principles. Now, I was happy with what I could do with it... until I wasn't. It worked, but not fabulously.
Then I saw some Rails controller code, my jaw dropped, and I knew I had to learn it. My growth as a PHP dev had been, in retrospect, largely about mitigating the crappiness of PHP. Ruby is a different ballgame altogether.
I haven't had that experience with anything else since. Probably some day it will happen. But til then, the only complaint I've possibly got against Ruby/Rails/Sinatra is that deployment is not the easiest thing... and that's an ancillary problem I rarely have to deal with.
Most of the other things are new for the sake of being new.
I looked into Seaside over 2 years ago. I find it cumbersome, and I asked a question at a Seaside talk, similar to one of the other commentors here, about the templating -- which has to be done that way for the object/state serializations -- and Avi Bryant was a dick to me, to boot.
I'm sure it works great for what he's doing, but it doesn't appeal to me. I don't need or want to write revolutionary data transformation software. I want to write the best damn webapps for "boring, simple" problems that everyone else thinks are solved -- that have yet, in my mind, to ever be given a thoughtful, amazing UI.
So Ruby and Rails are practically custom-made for me -- and, as I said, they work fabulously.