Re:Show HN: DubJS: A New Way to Build Web Apps
by lucian1900 on Tuesday September 11, 2012 @08:21AM
(#4504979)
I think it could totally fly with a language with good declarative support. Why learn separate syntax (html, css) when all you need is some declarative semantics?
Clojure has this sort of thing and any other homoiconic language gets it for free.
Re:Show HN: DubJS: A New Way to Build Web Apps
by keen on Tuesday September 11, 2012 @08:26AM
(#4505002)
Thanks, that is my thinking: learning three separate languages is a big burden, especially on beginners.
Re:Show HN: DubJS: A New Way to Build Web Apps
by Xymak1y on Tuesday September 11, 2012 @09:02AM
(#4505152)
You would need to know them a bit at least - for debugging.
Re:Show HN: DubJS: A New Way to Build Web Apps
by keen on Tuesday September 11, 2012 @08:25AM
(#4504987)
Thanks for your honest feedback.
Would you mind explaining what you mean by "the lack of opinionated language design infers on code"? Are you referring to the fact that it's not specialised for either layout or presentation?
Re:Show HN: DubJS: A New Way to Build Web Apps
by mmariani on Tuesday September 11, 2012 @09:21AM
(#4505228)
No. Javascript is just a general purpose language. It could very well serve as a DSL for layout or presentation. But the browsers already have that, it's called HTML and CSS.
What I'm referring to is Javascript syntax. It's way too ambiguous which often leeds to programming errors. For instance: the global variables gaffe, the scope mess, the sloppy prototypal implementation, etc.
Hiding that behind a compiler doesn't make the problems go away. It makes them worse.
Re:Show HN: DubJS: A New Way to Build Web Apps
by keen on Tuesday September 11, 2012 @01:50PM
(#4506793)
For what it's worth, my intention is to overcome some of those issues that you mention. First, I assume you're talking about accidental pollution of the global scope (by omitting 'var'), which can be avoided: see CoffeeScript. Also, I have some ideas to improve the 'scope mess', as well as prototypes.
Writing everything in JS isn't gonna make it better all of a sudden, even if it's sanitized JS. HTML and CSS are fine for the jobs they do which is data description and layout.
The problem is JS itself. Specifically, the lack of opinionated language design infers on code. Then we end up having to reinvent the wheel all over again, and again. And we all know how productive that can be.
We have two options here. Writing in yet another language and compiling to JS or writing a JS framework that works around its flaws. I vote for the latter.