News for hackers. Stuff that matters.
Re:No more CSS and HTML, just JS by cocoflunchy on Friday September 13, 2013 @03:34PM (#6382599)
Well, it's only 11 000 lines of js... Plus Backbone, plus jQuery, plus underscore, plus ace. Loading the source page takes about 15s on my computer... I'm not sure I would like my index.html to like this https://github.com/ojjs/ojjs.github.com/blob/master/index.ht...
Re:No more CSS and HTML, just JS by mistermumble on Friday September 13, 2013 @03:46PM (#6382662)
Yes, it seems like added complexity and reduced performance for uncertain benefit.

The whole point of HTML and CSS is to be declarative, non-procedural ways of specifying presentation and UX behavior. The rationale is that designers writing CSS rules is safer than developers writing Javascript code -- for those cases where the desired result can be achieved with either approach.

So why turn back the clock and go back to messing with code and debugging it? Unless I am missing something, heavy-weight pages with potential for bugs does not seem like a win.

Re:No more CSS and HTML, just JS by tomphoolery on Friday September 13, 2013 @06:58PM (#6383718)
HTML is a language for describing documents, right? The way I see it, there is an issue with HTML today. These days, many web developers are now exploring alternatives to a documents-based paradigm, and gearing their apps toward being "long-lived", while retaining the URLs and graphical support that modern browsers give us. Ember is a great example of this, there's very little markup you actually have to write when using Ember views and components. I don't really build "web sites" anymore, I build "web applications" which are typically one page but include all of the application's contents within that page. They do act the same, but are coded in wildly different ways.

Don't get me wrong, I like HTML and I'm not trying to disrespect what was arguably the first foray I had with "programming". But if we are intending to make the web into something more along the lines of a massively distributed application runtime, rather than a repository of documents that anyone can access, where does a document markup description language fit into all that? When developing some (kinds of) applications, I feel that HTML only serves as an obstacle, rather than a means of helping me make the app. I feel like I do most of my "real work" in CSS and JavaScript.

Re:No more CSS and HTML, just JS by pjtops on Friday September 13, 2013 @10:09PM (#6384345)
I think the web will always be more about delivering content, rather than manipulating data. Apps are all about data, documents are all about content. HTML and CSS are not fading away, they are actually getting bigger, and breaking into the desktop. I love javascript, but its more likely of being replaced by another scripting languange to work with HTML and CSS, than actually being a replacement for HTML & CSS.
Re:No more CSS and HTML, just JS by zanny on Saturday September 14, 2013 @10:48AM (#6385693)
The reason this is happening at all in the first place is because html / css / js is the only platform agnostic toolkit. Everything else lacks support somewhere, and the big businesses behind technologies will actively avoid supporting someone elses otherwise cross platform framework.

Same thing with dynamic languages. You cannot write a Java, Python, or Ruby app and expect it to run on any device. Just doesn't work when you need to also distribute the runtime framework on a per platform basis.

Similarly, you have semi-portable C# and C++ through Mono and Qt that reach pretty much every major platform (the primary limiter is ios being so locked down) but they both need to do ugly repackaging of their entire toolkit runtime and framework that has to somehow jump through hoops to get installed locally whenever you try to install such a program.

But you can expect html, css, and js on everything. And that is why everyone tries to stick completely tangential computing techologies (html is not a widget toolkit) and hope for the best. Because it is the only write once, run everywhere where the run everywhere actually happens, even if your site ends up being double in size for mobile and desktop versions or reactive with tons of overhead in element scaling, plus all the conditionals for old versions of IE, having to import require.js or something to check for feature compatability, etc.

But you can work with that. You can write megabytes of JS to try to weasel around the mess. There is literally nothing you can do to get a python app running on average joes iphone.

I really hope qml can take off in a big way, and become a standard of some sort. It is in my experience the portable ui toolkit for actual applications that is portable and looks native since 5.2, and it even lets you script it in js so you never have to compile anything with a qmlscene binary. And it is designed ground up to have any resource local or networked.

Re:No more CSS and HTML, just JS by mistermumble on Friday September 13, 2013 @08:59PM (#6384168)
I agree with your comment that HTML by itself is insufficient for a rich user experience. But my post talked about both HTML and CSS. These two, plus the minimum amount of Javascript code necessary to deliver a rich experience.

Nowadays, there's a lot that can be done with modern CSS that in the past required Javascript code -- from dynamic menus to 3d effects to responsive web design. This is a good thing.

Code is a breeding ground for bugs (especially dynamic code with callbacks, evals, unusual inheritance model, unconventional scoping rules, etc) in a way that declarative rules are not.

Re:No more CSS and HTML, just JS by kunai on Friday September 13, 2013 @07:04PM (#6383755)
Why can't it be both?

Applications are still, in essence, a type of interactive view hierarchy of document. The web can serve up both types of data: document-based (e.g. Wikipedia) and application-based (e.g. Gmail). Being able to have a core toolchain of three inter-related languages that can communicate with each other that you can use as required should be the final goal. For instance, if you're writing a web application, you could only use CSS/JS, and if you needed to write a very simple blog, you could use all three, or just HTML and CSS.

Having more options never hurt anyone. Better JIT of JavaScript code would break pure JS open, allowing full apps to be written without language fragmentation. Those who will still require stylesheets can use them as they wish. It's a win-win situation on both ends.

Re:No more CSS and HTML, just JS by zalew on Friday September 13, 2013 @07:11PM (#6383785)
> he web can serve up both types of data: document-based (e.g. Wikipedia) and application-based (e.g. Gmail).

an email message is a document too.

Re:No more CSS and HTML, just JS by evincarofautumn on Saturday September 14, 2013 @04:11AM (#6385021)
> an email message is a document too.

An email client is not.

Re:No more CSS and HTML, just JS by evanmoran on Friday September 13, 2013 @03:55PM (#6382727)
The goal for OJ is create reusable UI building blocks. So I agree completely that keeping sites simple and declarative is the way forward. I would argue though that if the abstraction well reasoned it doesn't matter if it is in HTML or in JS. It still simplifies things for the programmer and maintainer.

Or another way to say it -- Imagine you can insert a YouTubeVideo as simply as you can insert a div. If that YouTubeVideo component is well tested, then you are actually saving your self time and will make a more robust site.

Re:No more CSS and HTML, just JS by ulisesrmzroche on Friday September 13, 2013 @05:59PM (#6383456)
Web Components are already here and they're part of HTML5 itself. What does this do to differentiate itself? To me, at first glance, it looks like a dead project already.
Re:No more CSS and HTML, just JS by rickjames28 on Friday September 13, 2013 @07:36PM (#6383895)
Yeah, once I read his explanation web components immediately came to mind. You know what the status of web components is in the major browser engines?
Re:No more CSS and HTML, just JS by ulisesrmzroche on Friday September 13, 2013 @07:50PM (#6383954)
Natively, on most evergreen browsers, mutation observers and a limited shadow-dom on chrome canary. The polymer project gets you all the way though, check http://www.polymer-project.org/compatibility.html.
Re:No more CSS and HTML, just JS by diminish on Friday September 13, 2013 @04:04PM (#6382773)
could be great if i could describe the reusable UI building blocks in a markup language, do their formatting separately with style sheet fragments and add a simple scripting language for actions and animations.
Re:No more CSS and HTML, just JS by JanezStupar on Friday September 13, 2013 @05:01PM (#6383134)
Yeah I vote that it be our first priority to implement those immediately after we complete our framework.

And then we can have laymen code the templates and styling because it will be so simple.

It will be glorious!

Re:No more CSS and HTML, just JS by meemoo on Friday September 13, 2013 @05:27PM (#6383278)
Sounds like the Custom Element standard that's coming soon. http://www.polymer-project.org/ makes polyfills to use it today.
Re:No more CSS and HTML, just JS by evanmoran on Friday September 13, 2013 @05:26PM (#6383269)
Just to clarify -- The only dependency of oj.js is jQuery. Clearly if you want to use Backbone for model binding it has an Underscore dependency and if you want to use the AceEditor plugin then you will need Ace. So don't think you need all of these files to use OJ!

Also just for those who didn't realize, this is the initial release of OJ and was written by just one dude. As people start using it and a people give feedback it is just going to get faster, smaller, and better. Let me assure you perf and filesize are big priorities, as is better Express and Node templating integration.

Re:No more CSS and HTML, just JS by cocoflunchy on Friday September 13, 2013 @07:42PM (#6383918)
Yeah, I'm kind of bummed now that my snarky, not very useful comment is at the top here :/

Congrats on the release, I wish you luck for the rest!

Re:No more CSS and HTML, just JS by evanmoran on Friday September 13, 2013 @08:02PM (#6384019)
Thanks man. Really appreciate the positive thoughts=).
Re:No more CSS and HTML, just JS by diminish on Friday September 13, 2013 @03:42PM (#6382641)
When will we write a full browser in js and render to canvas?
Re:No more CSS and HTML, just JS by sorghum on Friday September 13, 2013 @03:48PM (#6382670)
Today if you feel like it: http://html2canvas.hertzen.com/
Re:No more CSS and HTML, just JS by nkassis on Friday September 13, 2013 @04:52PM (#6383068)
Just like the Flash sites from a decade ago.
Re:No more CSS and HTML, just JS by mstrem on Friday September 13, 2013 @09:03PM (#6384182)
I agree, also I personally prefer the idea of having things separate, HTML for the structure, CSS for the style, and JavaScript for the behavior. You can create very clean and neat pages like that especially if you don't mix each technology e.g. keep everything separate in different files..

I am however open to new ways of doing things so I will keep an eye on this, but I must admit, that index page looks a lot more daunting to edit than a normal HTML page, especially if you are not familiar with JavaScript.

Re:No more CSS and HTML, just JS by iopq on Saturday September 14, 2013 @03:26AM (#6384958)
Except CSS sucks for styling. You can't even make a "scroll to top button" disappear with CSS because it doesn't know if the document is at the top. CSS is missing a ton of things.
Re:No more CSS and HTML, just JS by hrjet on Saturday September 14, 2013 @11:25AM (#6385846)
One could argue if that is "style" or "behaviour".
Re:No more CSS and HTML, just JS by iopq on Monday September 16, 2013 @02:05AM (#6391879)
I mean I want that button to disappear when the page is already scrolled to the top. The scrolling up part I'm fine with making with JS. I just don't feel right about attaching a scroll handler to have a very unoptimized implementation of such a thing since that scroll handler will fire EVERY SINGLE SCROLL. But the browser could optimize away "is document at the top" CSS calls by knowing we scrolled down (and by definition we can't be at the top then).