Project

General

Profile

Feature #2795

Provide a "Wt for Ruby on Rails users" Document

Added by I. Lazaridis over 8 years ago. Updated over 8 years ago.

Status:
Feedback
Priority:
Normal
Assignee:
Target version:
-
Start date:
03/11/2014
Due date:
% Done:

0%

Estimated time:

Description

In order to simplify the adoption from users coming from other frameworks and languages, a series of documents can be provided, starting with one which affects Rails (Ruby on Rails) users.

Use Case

A developer has implemented a web-application in Rails. He decides to port parts over to C. After a little research, he decides to use wt.

This developer finds a document which explain some basic differences of the languages, concepts of the framework etc. Those can be just a few lines of text.

After this, a very basic and general process is described, which enables to migrate parts of a Rails application to wt (e.g. a part of the application that should be able to run on an embedded device).

#1

Updated by I. Lazaridis over 8 years ago

from RE: Blog Examples and Wt Best Practices

The use of boost::bind() is usually not necessary, unless you really want to pass some variable to the bound function, as in this case. Just take a look at the other examples. But actually, the use of WServer itself is already optional and advanced.

I simply refuse to accept (in any case) such code on the topmost level of a simple web-app.

As said: "It starts with saying: "I want this, thus it's simpler for users"".

The minimum skeleton for a working application is the hello world example. This is what a "ruby user" should look at first.

There is no "should look". Users choose to pick an example of interest (like I picked blog).

Don't forget that "ruby users" (which btw. could use ruby just because of a customer requirement) are potential "wt users" and potential "emweb customers".

#2

Updated by Koen Deforche over 8 years ago

  • Status changed from New to Feedback
  • Assignee set to Koen Deforche

I. Lazaridis wrote:

from RE: Blog Examples and Wt Best Practices

> The use of boost::bind() is usually not necessary, unless you really want to pass some variable to the bound function, as in this case. Just take a look at the other examples. But actually, the use of WServer itself is already optional and advanced.

I simply refuse to accept (in any case) such code on the topmost level of a simple web-app.

As said: "It starts with saying: "I want this, thus it's simpler for users"".

I don't disagree with making things simpler. In fact, Wt wouldn't exist if we didn't want to make web development simpler.

But there's a fallacy that what is simpler for a user is better for a user. Some things look simple but are in fact complex. For example, you could create APIs with lots of overloaded functions so that the user has more freedom in calling this API. But for another reader of the same code it would take much more time to find out what is actually happening.

[The same goes for the major criticism I have with frameworks like spring, or Ruby-on-Rails: a lot of 'magic' happens which makes things 'simpler' for the user, but in the end it will bite you back because sooner than later you will need to learn and remember all the magic].

To be honest, I had problems with understand 'boost::bind()' the first time too. And the second time as well. And if C+11 would have existed 10 years ago, then probably a lot of boost::bind() would not have been used, in favor of using a C11 lambda, which has a lower learning curve. But boost::bind() is, in C98, simply the best tool to bind an actual parameter to a callback function. The alternative in this case would be to use a global variable (sin!) or a lambda function (which didn't exist in C98). Perhaps in Ruby there exists a counter-part for boost::bind() which makes it easy to explain to Ruby users; or perhaps not. I don't know Ruby, but surely welcome the idea in your other post to make a Ruby-to-C+(Wt) guide.

> The minimum skeleton for a working application is the hello world example. This is what a "ruby user" should look at first.

There is no "should look". Users choose to pick an example of interest (like I picked blog).

If I go with my 6-year old son to the library, he'll want to pick a book of interest 'Lord of the Rings'. I'll suggest him to start with 'Peter Pan' instead. I'll try to explain him that he'll enjoy it better and can read Tolkien later, and I'm sure you will agree.

Don't forget that "ruby users" (which btw. could use ruby just because of a customer requirement) are potential "wt users" and potential "emweb customers".

Sure, and we're happy that indeed several former Ruby users are now Wt users and Emweb customers. And that's why we direct them to the examples (and the Wt tutorial) which we believe are best to help him to understand how to develop a Wt application.

Like the homepage, the blog example serves a double role: it's not only an example, but it's also an actual application that runs the Wt homepage. The example is not purely didactic in nature; it's also an actual application with real requirements.

[If you think that's misleading well then you should consider that most other (all?) "web frameworks" either do not actually use their own framework for their homepage or blog, or if they do, it's not example or even public code.]

Regards,

koen

#3

Updated by I. Lazaridis over 8 years ago

I've read everything carefully, and you should know that I agree with many things (like e.g. the magic-negativity, frameworks not using their own tools for the website etc., spring=disaster)

Just know that I have experience with hardware-description/verification languages, have done embedded design, have dealt with very complex code. I choose your blog example. And I failed to grasp whats going on with wt (hangman-example looks better btw.).

Your examples/docu/tutorials, the whole "entry user experience" needs some rework. I simply hope that you are aware of this fact. You, as the core developer, should focus on the library. An independent entity can spot (during his teach-in) the entry barriers.

(btw: I tend to have this detail grade and simplification tendency for around 2 to 3 months, then I "switch" to a "lazy" library user who is familiar with the library, and deals mostly with his application problems.)

Also available in: Atom PDF