Git Product home page Git Product logo

Comments (5)

vinipsmaker avatar vinipsmaker commented on September 28, 2024

I find no discussion on templating. I can think of several ways to implement a templating system with tufao, but, would like to hear why it's not there already?

Basically I don't know what is the right answer. What is the right template system? Are you sure? Why? Will your answer be the same tomorrow?

Maybe I could spend some time thinking about a good interface that could abstract all template systems, then I wouldn't mind to include the most popular template systems on Tufão.

I can only assume no one has though it necessary, and everyone is just using strings for HTML. Which is incredibly cumbersome.

I think template is important. qt-mustache is mentioned on the wiki.

from tufao.

treaves avatar treaves commented on September 28, 2024

If you think there is a right answer (or that a single answer is even possible), you don't understand software (or, more generally, problem solving). The goal with software specifically is to pick something reasonable, make sure the interface is in place, so that as better solutions come along, they are painless to implement. It's called 'refactoring'.

If it is easy to incorporate something like qt-mustache, there is nothing wrong to deferring the templating to it. An example would be great. Actually, an example on returning more than a little HTML would be great.

I just created a resource file (qrc) with some HTML files in it, and compiled it into my "hello" app. The HTML files use the standard Qt string templating, with the QString::arg() calls. I'd never say it's the 'right' solution, but it works, and could very easily be abstracted out, into something like qt-mustache. Then, it would be easy to have a Template class, that return codes , headers, & what-not could be set on, and the return from the handle requests would simply be to template.renderTemplate(args) or some-such.

A solution doesn't need to be large & daunting. And a poor solution is often better than no solution.

from tufao.

vinipsmaker avatar vinipsmaker commented on September 28, 2024

@treaves, fair enough. Let me express my concern reasonably.

I don't want to Tufão users to refactor their code after every Tufão release because I didn't invest enough time thinking about a good interface.

There is no code and there is a link to another template system on the wiki. So we can say the reason is laziness or lack of interest (or time).

from tufao.

vinipsmaker avatar vinipsmaker commented on September 28, 2024

@treaves, PS: I liked your comment.

from tufao.

nurettin avatar nurettin commented on September 28, 2024

I've been watching tufao for some time.
In my experience, much of the web is moving towards client side html rendering. (You know, Google's AngularJS, EmberJS, etc.)
In other words you may not have to do anything other than helping the users deliver data easily in various formats such as Json, Protobuf, Xml or even Base91.

from tufao.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.