baryshev / ect

Fastest JavaScript template engine with embedded CoffeeScript syntax
http://ectjs.com
MIT License
622 stars 69 forks source link

Documentation request: eco vs ect #33

Open izelnakri opened 11 years ago

izelnakri commented 11 years ago

Could you please explain the advantages of using ect other than its performance. PRos and cons of each language in general. It's the utmost necessity if you want to increase the user base. MOre detailed the analysis is, better. Also sorry for my ignorance, but why performance is important? Arent they all get compiled to html at the end. Does performance make any difference to the end user(a web site visitor).

lazzaronico commented 11 years ago

I just started using ECT, but found it really good. It gives you just what you need, and it does it in a really neat way (ie: using coffeescript syntax). So if you are a coffeescript user it will make your code much more consistent and will have basically no learning curve. I love that. If you are not a coffeescript user, than I see no significant advantage over others template engines.

I don't really know much on the precompilation thing, but I think that you are wrong. If you are populating an element with database data then that element (and maybe even number and kind of elements, considering multiple db results and conditionals) will be different each time, therefore I believe that the template needs to be reprocessed at each render.

izelnakri commented 11 years ago

I meant the comparison of ect to eco, not the comparison of coffeescript to other languages. I should have used 'templating language' instead of the word 'language' to be more exact in my first post. So I'd still be really happy to see a documentation of .eco vs .ect comparison.

The only thing I couldn't understand about the syntax is the colon ( : ). Why is it in the .ect? It's not a coffeescript syntax. Lastly, I've never thought about the database side of things. You're probably right on the reprocessing.

baryshev commented 11 years ago

There is 3 big differences between eco and ect:

  1. ECT was 4 times faster than eco.
  2. ECT includes smart template caching system from the box. You don't need to implement this functionality again and again.
  3. ECT supports inheritance, partials and blocks. This is a killer feature i think.

Also ECT support Multi-line expressions in templates and have a full backward compatibility with eco.