4 ms·
How Evan Moran replaced CSS/HTML/JS with OJJS
- ocfx 13y ago'Instead of the word ‘replace’ let's use "abstract away"...'
- evanmoran 13y agoOk, good point, I probably could have responded better=). What I was trying to say was that a lot of people focus on OJ's ability to create html/css and think that that is what it is for. They think that that means you can't CSS the way they are use to: with a designer created .css file. This isn't the case! Instead OJ is about making reusuable website objects -- check out the plugin page: http://ojjs.org/plugins.html http://ojjs.org/plugins.html. You can make a YouTubeVideo in one line, but, just as importantly, the OJ plugin lets you change the video's volume or pause and play. In short, OJ creates web building blocks that can live edit what they create.
- mikeyanderson 13y agoEvan, is it fair to say that it takes it a step toward Object Oriented web dev?
- evanmoran 13y agoThat is a good way to think about it. As programmers we are used to objects that give us methods and properties to change them. A Form object should have a submit function, a Table object have a addRow, removeRow function. OJ does this for the web.
- ocfx 13y agoI think you explained it pretty well. I was sniping at the title of the post "How Evan Moran replaced CSS/HTML/JS with OJJS" when you hinted that replaced might not be the best word choice. Pretty cool stuff though, I will have to give it a go.
- sealocal 13y agoYour response made perfect sense. I'm a novice web developer, and OJJS has my interest, especially after this interview.
- CoffeeDregs 13y agoI'm a little confused. Didn't ExtJS, Dojo, various jQuery plugins, etc do this same kind of thing years ago? And didn't we kind of find out that JS + CSS + HTML was acually a pretty nice separation of markup, formatting and functionality?
- evanmoran 13y agoThe separation is definitely still a good thing -- OJ isn't trying to break it! The only difference is now some of that separation can be done in code. Think separate functions or js files. One that creates the site and one that styles it. The separation doesn't have to be a completely separate format, it turns out functions are quite good at abstraction=) That said almost every example on the site is just creating HTML and JS (not CSS), so it would be very easy for you to use OJ to create everything and then style everything with .css files like you always have. So use it however you want, but please don't think it is trying to force markup and formatting together!
- doublerebel 13y agoThis concept of 'JS all the way down' is what hooked me on Titanium Mobile (crossplatform app framework) as soon as I started using it. It's a much lighter cognitive load, since I'm not constantly switching between varied featuresets and syntax of templates/HTML/CSS/JS. One of my favorite features, is that any piece of the app can instantly become a reusable, extendable module for another app. Since it's 'just JS' it always ports. In this way I share UI widgets between web apps and mobile apps. Generated CSS and HTML should be syntactically perfect, and JS has much better error handling than either CSS or HTML. With those traits, the resulting code can be better than a human could write on their own. The concept of JSON syntax for DOM creation has been around a long time -- HAML, JsonML, jQuery... And although the JS syntax can be verbose, CoffeeScript object notation is available, and quite similar to HAML and SASS. I hope we see a lot more of this.
- rojoca 13y agoHas anyone made a todomvc implementation using this?