Hacker News new | past | comments | ask | show | jobs | submit | more jedschmidt's comments login

This is great feedback.

- The caps are there to prevent global namespace collisions, since the chances of UPPERCASE global variables existing is smaller. I don't want to add lowercase names to the global, but they would be fine on the domo object itself, so maybe I should put both UPPER and lower there anyway.

- The CSS may be more verbose that LESS in JavaScript, but it compiles much faster and there's only 228 of code needed to get it. If you want sugar, just use CoffeeScript and it's probably even cleaner than LESS.

https://github.com/jed/domo/blob/master/docs/index.coffee#L1...

- The STYLE keyword is just there because that's where the "on" function lives. You could assign it to a local variable make the reference shorter.

- Yes, with bare JavaScript this is probably true, but the idea is to make sugar optional. Add your own and it looks like HAML:

https://github.com/jed/domo/blob/master/docs/index.coffee#L3...


Thanks for the reply Jed, yeah I understand your decisions and some of the advantages of going with CoffeeScript. I will definitely keep an eye on the project going forward. Just a quick thought:

- Maybe better syntax highlighting of the core elements on the website might help with new potential users.


I (the author) agree. It's not for nostalgia's sake, but to avoid namespace collisions on the global object.


Right. This entire page could've been rendered on the server. The point is that you can choose the best tradeoff for your app.


Hello there, author here.

I'm still working on how to get the message across, but the idea is this:

We all know CSS. We all know HTML. Most of us agree that neither is powerful enough to build modern web apps, hence the explosion of CSS-preprocessors and templating engines.

If we're going to build tools to improve browser technologies like CSS and HTML, let's build them using another browser technology: JavaScript. Instead of adding incompatible extensions to CSS and HTML, let's first port them as-is to JavaScript syntax and then do the extending there, where at least the tools we build will interoperate.

Instead of learning increasingly arcane/proprietary/underpowered syntax for looping or doing arithmetic or writing functions, let's just use the tools we already have. Not to mention this gives us a streamlined development process and lower cognitive overhead for free.

Feedback welcome.


Looks like a neat idea, but I see a few technical problems with it:

- afaik, <meta> doesn't work properly if injected via js (e.g. try the viewport meta tag to control screen width in an ipad)

- <object> (for Flash fallbacks in IE) and a few other tags also have DOM API composability issues (i.e. you need to innerHTML an entire snippet rather than using appendChild's)


This is great feedback, will definitely look into this.


I think this is the right philosophy and it is going to do some amazing things in the near future. Here's my interpretation:

http://aakilfernandes.com/uiji.html

I think the emphasis on callbacks has been the weakest point, domo looks promising.


I believe I understand the concept, and the purpose, but this seems limited to specific types of web apps. General sites (news, blogs, and most services) - this approach would not make the most sense, since JavaScript interacting with the DOM does not compare speed-wise at this time.

This would work well for example and demo sites (portfolios, resumes, showcaes, etc) and possibly web games. It could be useful for building in-app content, such as if you have a large project like lucidchart.com - you could use something like this to build dialogs, modals, help content, and those types of things easily, in page, by loading a javascript asset on demand rather than running a request for more HTML/CSS/etc.


High quality code. Good job!

Template engines allow you to reuse template as functions. I do not believe this system promotes reusable markup. If this is intended for simple static HTML, I would rather use static HTML -- pre-generated using HAML or mustache.

Determine the global object: why not just pass this into your closure function?


Put your domo code into a function that takes data and returns a DOM object. BAM, there's your template.

Your JavaScript code can only have one global object, I don't see a reason to pass it in instead of finding it for you.


Great project. Loved the idea.


How do you think this compares to Perl::Mason? How are you avoiding the same pitfalls that Mason has? complicated failure modes, pretty much impossible to improve timing and create on demand resource prefetching without increasing complexity greatly?


I don't know much about Mason, but this isn't a templating engine; it's just a wrapper library on top of the DOM API. Since it doesn't need any compilation or coordination outside of the JavaScript process, it's much less complex, and composes well without passing partials and other cruft into the template data.


Hey there (author here), can you explain what you mean by decoupling? I'm not sure how this is any less decoupled; you can still keep everything modular in separate files/systems. You can use this to compile your CSS and still LINK it as a separate file, for example.


Exactly. Instead of learning arbitrary meta-languages on top of these technologies, I think we're better off just porting the syntax to JavaScript and using a more reliable and well-tested foundation to build abstractions.


Don't hate the provider, hate the meme:

http://knowyourmeme.com/memes/overly-attached-girlfriend


They're actually referencing the Ryan Gosling meme, not OAG. There's an image of him right on the page.


These are definitely good concerns.

- Performance: It's about half of Underscore.js on Webkit[1], so it's not so horrible, and has yet to be optimized at all (such as by using document fragments, etc.)

- Readability: The JS statement here is only long to show a unified example. Since the inputs and outputs of each call are DOM nodes, everything is trivially composable, something not possible with XML/CSS.

- Error recovery: Yes, having seen the error output of things like LESS, I see this as a feature.

- Namespacing: Absolutely agree. I think this is best solved the way jQuery and other libraries do it: pollute by default, and then let the developer "opt out" using noConflict.

[1]: http://jsperf.com/underscore-vs-domo/


You can still preserve modularity by pulling styles and markup into their own JavaScript modules and requiring them as you would any other module.


As discussed previously on HN: http://news.ycombinator.com/item?id=4366555


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: