top | item 4607448

DoubleDollarJS.com

76 points| DaNmarner | 13 years ago |doubledollarjs.com

50 comments

order
[+] jv22222|13 years ago|reply
The author here. This project was not ready for public release or review. Examples and docs need to be created etc. Should have been behind a firewall. Thanks for all your feedback.
[+] nateabele|13 years ago|reply
What exactly is the reasoning behind embedding a bunch of HTML as template strings? Wouldn't it make way more sense to separate those out?

Why would one choose something like this over Angular or Ember?

[+] incongruity|13 years ago|reply
=) well, live it up and go ahead and use this as a platform for your ideas – I'm sure many would like to hear about it/your plans for it in greater detail, if you're so inclined.
[+] ilaksh|13 years ago|reply
I can't get passed the way the code is formatted. Please just write it the way people normally write JavaScript:

    $$ ({
      home: {
        route: {
          defaultOnly : true
        }
      }
    })​
Or in CoffeeScript:

    $$
      home:
        route:
          defaultOnly: true
    
Other than that, this is sort of interesting. Reminds me of Couch Apps, which I could never get the hang of and eventually had to stop messing with. Everything is declared according to a specific structure, but its hard to figure out what structure you are supposed to use for a given task. High learning curve and difficult translation from imperative thought to this type of patterned declaration.
[+] lukifer|13 years ago|reply
Taste is subjective. I write my JS pretty much the way DoubleDollar does. Of course, CoffeeScript makes it moot. :)
[+] fooandbarify|13 years ago|reply
Geez, a lot of jerks on HN today. jv22222, thanks for making this. You're obviously putting a lot of work into it. I can't say that it particularly interests me at this point, but I'm glad that you and people like you work hard on things and open-source them.
[+] zacharyvoase|13 years ago|reply
Is this a parody? I'm genuinely having trouble discerning.
[+] reitzensteinm|13 years ago|reply
Nope, it's been developed by Justin Vincent of the TechZing podcast.

He spent about five minutes on the latest show explaining it... but frankly I still have no clue what it is.

[+] lukifer|13 years ago|reply
I like the $$ syntax, but DoubleDollarJS is not a great name, so I can see why you would think that.
[+] redidas|13 years ago|reply
Is this an actual HN comment?
[+] akumpf|13 years ago|reply
It's awesome. Really, I love it.

The core of it: dealing with the DOM kind of sucks, and as much as keeping 3 main file types around (.html, .css, .js) for web development isn't too much of a pain, the fact that HTML sits between everything muddies the water quite a bit.

Sure, $$ needs some more love and a community to pick it up and run, but kudos to you for getting it out there and having a solid philosophy (tiny robust kernel, super extensible, consistent docs). And yes, I'd write the code more compactly (the de facto js notation mentioned in another comment), but whatever, that's easy to translate.

I say all this because our team is working on an app ( http://luunr.com ) and toggling back and forth between HTML and JS is borderline silly (we looked at things like Angular and couldn't get behind them, feels to rigid and baked in my book). Would have loved to experiment with this a few weeks ago when we started.

Keep up the good fight and continue developing $$!

[+] duiker101|13 years ago|reply
Scrolling the homepage gave me a strong WTF feeling. This looks really really confusing.
[+] mamcx|13 years ago|reply
I don't see why everyone here say this is terrible or bad. What problem it have?
[+] johnpolacek|13 years ago|reply
JS Devs - I think if you can open up your minds and take a look at what is actually a new and interesting approach to a JS framework, you'll be glad you did. Take a look at the examples. There's definitely some potential with this one.
[+] incongruity|13 years ago|reply
Not to be harsh, but can you give an explanation/argument that includes substantive reasons for why there's potential?

The above seems awfully close to a dogmatic sort of "if you don't get it, the fault is with you" kind of statement.

[+] jschrf|13 years ago|reply
I'm curious as to why numerous JS frameworks create DOM structure via string concatenation, or by putting markup in script tags. That's an automatic fail, in my books. No matter how interesting or useful a JS framework looks, I just can't get past the need to mix markup and code.
[+] bballbackus|13 years ago|reply
The script-markup mixture used by DoubleDollar or Backbone is really just a necessary quirk to achieve templating functionality. I haven't seen it done better honestly.

Try it, you're refusal to "get past the need to mix markup and code" is restricting you from some pretty helpful functionality if you build JS heavy web apps!

[+] ewolf|13 years ago|reply
That's one awful lot of parantheses for a hello world.
[+] ehutch79|13 years ago|reply
Towers of power should be discouraged all around, let alone in hello world examples.
[+] columbo|13 years ago|reply
The entire thing doesn't work in Linux/Chromium

		$$.js:28Uncaught SyntaxError: Unexpected token default
		$$.(hooks).js:11Uncaught ReferenceError: $$ is not defined
		$$.(core).js:246Uncaught SyntaxError: Unexpected token delete
		$$.(router).js:1Uncaught ReferenceError: $$ is not defined
		$$.(bindings).js:23Uncaught SyntaxError: Unexpected token default
		$$.content.js:1Uncaught ReferenceError: $$ is not defined
		$$.home.js:9Uncaught SyntaxError: Unexpected token default
		$$._bootstrap.js:26Uncaught ReferenceError: $$ is not defined
		Uncaught LiveEdit Failure: Failed to compile new version of script: SyntaxError: Unexpected token :
[+] pfraze|13 years ago|reply
I'm having trouble understanding what the framework offers. Though I appreciate seeing code quickly, I'd like a better overview of what it does.
[+] vidarh|13 years ago|reply
Same here. It looks like a loader plus some extensions that offer routing, and history/back/forward management plus a lot of conventions.

A comparison of what it offers compared to at least a couple of the major libraries offering those things would've been useful...

[+] hk__2|13 years ago|reply
In Chrome/Chromium, $$() is a shortcut for document.querySelectorAll().
[+] yahelc|13 years ago|reply
Only in the Webkit Inspector console, nowhere else. $ is also a shortcut (I forget for what though).

They're over-written by a page if that page defines that variable globally in some way.

[+] grandalf|13 years ago|reply
While the visual style of the code may be perplexing to most of us, I imagine it might make javascript far easier for a dyslexic person to read.
[+] pacomerh|13 years ago|reply
Hm, this is a very particular way of working with Javascript. The formatting is very strange.
[+] Dirlewanger|13 years ago|reply
Another day, another ho-hum JS doo-hicky thing-a-ma-jigger...