Just looking at the syntax and thinking about how I would write things in it, this looks strictly inferior to Haml; there's syntax in here that appears to exist solely to shoehorn this into Coffeescript's grammar. What does this do better than Haml to make up for that?
I think the main advantage is it doesn't require Haml. I use Haml whenever possible, but I could see this being very useful for Node.js or other JS/CS-based apps.
Coffeekup
51–60 of 69 posts
Re: Coffeekup
#52Earlier quoted context omitted.
The style is applied through CSS. The CoffeScript is unobtrusive. The template and the sever logic are distinct (but there's an indentation error in the request handling code). It's about logical, not necessarily physical separation. For small apps, having everything in one place is actually very convenient. See also _why's Camping: http://camping.rubyforge.org/ (nowadays maintained by judofyr a.k.a. Magnus Holm)
Yeah, but this only goes well for smallish projects. If you have files that start to reach 2000 lines, the last thing you'll want is a mixture of model, view, and controller logic in a single file. PHP had this back in 1999, and I don't think we want to go there again.
(That is, unless you use Rails and believe in underlying organizational standards for everything. ;) )
Re: Coffeekup
#53I love CoffeeScript but I don't understand this. HTML / HAML / SHPAML are document languages. CoffeeScript is a programming language. An element that contains another element isn't a function. I don't see any reason to make it one. If you want a templating language, why not use one, rather than having an unnecessary 'space dash greater than' to indicate elements are contained within each other?
The example that really made sense for me was from "Smooth Coffeescript" in which the author writes an entire nodejs app in one file. Here, I'll show you: http://autotelicum.github.com/Smooth-CoffeeScript/ webpage = kup.render -> doctype 5 html -> head -> meta charset: 'utf-8' title 'My drawing | My awesome website' style ''' body {font-family: sans-serif} header , nav, section , footer {display: block} ''' coffeescr…
Even more added points: it can be refactored like any other code.
Re: Coffeekup
#54Earlier quoted context omitted.
Just reading your comment, it occurred to me that this is an editor problem. What we actually need are editors in which you can set you language (haml, slim, less etc), and then those are compiled and saved, in realtime to html, erb, css etc. Not having used too much Coffee Script yet, I don't know what the transformation from CS -> JS -> CS would result in, but I believe HAML -> HTML -> HAML would be pretty much 1:1…
I can see such a conversion like that leading to a scenario where someone writes some broken markup and the conversion to and from formats only makes the situation worse.
Re: Coffeekup
#55Re: Coffeekup
#56Re: Coffeekup
#57Earlier quoted context omitted.
I can see such a conversion like that leading to a scenario where someone writes some broken markup and the conversion to and from formats only makes the situation worse.
You are of course correct, this was a horrible idea!
Re: Coffeekup
#58Whilst I appreciate the effort that people put into these things, I really don't like this sudden obsession of adding another layer of abstraction over everything. Abstrations are hard to debug, require a learning curve of 2x the original problem and are rarely complete.
Re: Coffeekup
#59Just looking at the syntax and thinking about how I would write things in it, this looks strictly inferior to Haml; there's syntax in here that appears to exist solely to shoehorn this into Coffeescript's grammar. What does this do better than Haml to make up for that?