Live data from Hacker News

Coffeekup

coffeekup.org

51–60 of 69 posts

Re: Coffeekup

#51
post #43
post #32

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.

why couldn't one write a haml parser for node.js? That would seem like a better strategy than invent a whole new syntax for markup.

Re: Coffeekup

#52
post #50
post #46

Earlier 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.

Project organization is your responsibility. How is this different from other modern frameworks? That CoffeeKup allows you to organize your projects as you see fit should be a point for its favor, not against.

(That is, unless you use Rails and believe in underlying organizational standards for everything. ;) )

Re: Coffeekup

#53
post #37

I 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…

Bonus points: it works on bookmarklets, browser plugins and greasemonkey scripts.

Even more added points: it can be refactored like any other code.

Re: Coffeekup

#54
post #19

Earlier 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.

You are of course correct, this was a horrible idea!

Re: Coffeekup

#56
This is wonderful. I am looking forward to someone creating a Coffeekup Gem. I will use this in my next Rails project. Thank you for this awesomeness.

Re: Coffeekup

#57
post #54

Earlier 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!

I don't know if this reply was read as being sarcasm, but It honestly wasn't. I was wrong about the whole idea, it would never work.

Re: Coffeekup

#58

Whilst 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.

"Abstractions are like tacos; I don't mind a little leaking so long as they hold together till I'm done." - https://twitter.com/MarkusQ/status/86136160652496896

Re: Coffeekup

#59
post #32

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?

Not sure what you mean here-- it's raw CoffeeScript syntax. The templates it produces are JavaScript functions.

Re: Coffeekup

#60
post #57
post #54

Earlier quoted context omitted.

You are of course correct, this was a horrible idea!

I don't know if this reply was read as being sarcasm, but It honestly wasn't. I was wrong about the whole idea, it would never work.

Eh, it's an interesting line of thinking.
Post reply on HN