Layout vs. CSS for new project

Added by Sergey Perunov 10 months ago

Hi everyone,

First of all I'd like to say that I tried Googling and searching for this answer here and did not find it. Perhaps I did not do a good enough job, and I apologize if this topic has been beaten to death already.

Also, I'm just starting with Wt and I think it is absolutely awesome. For those of you who are working on it: keep up the good work, it makes all the sense in the world and I hope the community around this grows.

So my question (and I would suggest this be made more obvious in the tutorials):
What is the recommended way of developing a new site, with layouts or CSS? I understand that both are supported, and some designers feel more comfortable with CSS and that's why it might be chosen. But assuming those are not the issues, you have a 2-person project where both people are C++ devs and would feel comfortable with both. What is recommended / has less issues / better idea in general? Is there an 'official' answer (or some non-obvious drawbacks and benefits)?

Thanks for any input.


Replies (8)

RE: Layout vs. CSS for new project - Added by Vincenzo Romano 10 months ago

My EUR 0.01 contribution is that it depends.
If your "look and feel" needs to change or to be controlled by program, than the layouts are the answer.
If all is more or less static, then the CSS is a lighter solution, not necessarily easier, though.

RE: Layout vs. CSS for new project - Added by Sergey Perunov 10 months ago

Sorry, what do you mean by lighter and not easier? Do you mean it will have faster performance?

RE: Layout vs. CSS for new project - Added by Vincenzo Romano 10 months ago

CSS will be served by the HTTP server with very little CPU intervention: it'd be a static file, not output produced by a program.
So it's "lighter".
CSS needs very good skills (which I don't have) especially in complex styles. This is why I call it "not easy" for myself.
But, again, I think a lod depends on the specific situation ...

RE: Layout vs. CSS for new project - Added by Sergey Perunov 10 months ago

Ok, I see your point. Thank you.

RE: Layout vs. CSS for new project - Added by Saif Rehman 10 months ago

If you are familiar with CSS then my suggestion would be to use CSS instead of Wt Layouts since some of their features relies on JavaScript. However if you are new to CSS then you may use Wt Layouts which may seem easier to you. However if you care about making the website accessible to even those without JavaScript you should learn to use CSS.

The problem with CSS is that for some features you may have to use a few tricks to work around the different browser's handling.

I hope this helps.

RE: Layout vs. CSS for new project - Added by Koen Deforche 10 months ago

My 0.05 cents.

I recommend CSS -- it has benefits for example if you later want to support mobile clients, for which you can use so-called "responsive" design (layout adapting in more signficant ways to the formfactor of the device: when you have less screen space it could arrange things vertically instead of horizontally).

Layout managers have considerably improved in 3.2.2, and add value mostly when you want to vertically arrange contents to distribute excess space in a specific way, or if you want the user to have resize handles between different widgets. This is mostly when you are building "desktop-like" user interfaces.

Performance is I think of less concern -- both will be fast on a decent browser, and both will be slow on IE 6 :-)

Regards,
koen

RE: Layout vs. CSS for new project - Added by Vincenzo Romano 10 months ago

Server performances won't be affected by the CSS approach which will put loads on the client alone.
Viceversa, programatic (Wt) approaches will add workload to the server and, very likely, also to the client because of the way the layout are rendered (nested <DIV>s, <SPAN>s and <TABLE>s).

RE: Layout vs. CSS for new project - Added by Wim Dumon 10 months ago

Vincenzo,

I wouldn't worry about that - you'll probably not notice.

Wim.

(1-8/8)