-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefer EJS over Jade? #26
Comments
I usually love Jade terse syntax, and most of all I love it's mixin abilities. EJS does not offer a <!-- insead of -->
<div class="user-avatar"><img src="<%= GravatarUtil.toURL(user.getEmail(), 128) %>"></div>
<!-- you can use -->
<hub:avatar user="<%= user %>" size="128" /> In jade you can do it similarly (see the docs for an example). Jade, also, force you to remove logics in the views. Every logic will get your views "dirty", and I usually see this as a feature. About embedded js, you can always do the following: - var rand = function () {
- return Math.random() > 0.5 ? "selected" : "normal";
- };
menu
ul
li.menu-item(class=rand()) Notice how classes are merged At the same time I do understand you concerns about Jade, I was thinking about the switch too. But I'll miss the extension structure... |
Do you guys going to use express? 3.x version have changes related to On 3 February 2013 23:41, Pier Paolo Ramon notifications@github.com wrote:
|
We''re already on Express 3 ;) |
Oh, good. On 3 February 2013 23:48, Pier Paolo Ramon notifications@github.com wrote:
|
Mh... From (rails based) Hobo's DRYML (which in my opinion should be written DryML) there's a node port which implements EJS like syntax which support taglibs in a similar manner... but looks terrible, and DryML itself it's like taking the good parts of JSP and the bad parts. It's like taking 10 years old errors into fresh new frameworks. Cool! |
Oh, @Integral, welcome aboard! |
@yuchi Yeah I went through all stages of template languages as well. Erb, HAML, SASS, Mustache et al. However for me I figured out even if I break the rules sometimes intentionally, views can be kept dry by just using a dumb templateing mechanism and have less complexity. And then while you're in the middle of implementing an exciting feature, there's nothing wrong with calling Date.toDateString() and the likes from within the template (that's not logic for me) :) Well if we consider a switch I'd just use underscore's _.template method and accept we don't have taglibs. Otherwise we can stick with Jade. Just wanted to bring up that discussion before we have more template code to maintain. |
@Integral welcome! :) |
Mh, ok. Let's make it. We'll have stronger consistencies between the parts of the Substance stack. But... we should try it a little before going "full dumb" (quote), I'm scared of spaghetti templates. In fact jade forced me to stay clean. |
@yuchi Do you think we should just tackle this? If we'd like to switch to EJS we should do it earlier than later I guess. I'll put my focus more on the composer side for the coming weeks, so maybe you or @vectorsize would like to look into this? |
Ok, I close this issue. I'm creating the real one. |
I find myself disliking the Jade template language... ;) so I wonder if we shouldn't switch to EJS instead.
What's your opinion on that, @yuchi ?
The text was updated successfully, but these errors were encountered: