3 ms·
For those who have difficulties getting it: it's not about the browser not running JS, it's about the developer not needing to write JS and not needing to use l
by MrBra 9y ago
For those who have difficulties getting it: it's not about the browser not running JS, it's about the developer not needing to write JS and not needing to use libraries for managing the DOM. And more.
- krapp 9y agoI don't see how writing Ruby and managing a Ruby abstraction of the DOM is an improvement over writing JS and managing the DOM with that. Unless the only purpose to this is to just not write javascript.
- detuur 9y agoIt is. Its elevator pitch is literally "write your website in Ruby". I think it's very silly, especially considering that WebAssembly has just matured, and it's been coming for a looong time. Not to mention it's 10x better supported. If your website only runs on 90% of browsers out there, it's a terrible website. And this thing as far as I can tell only runs on last-gen Firefox and Chrome.
- MrBra 9y agoIt is not, check my answer to @krapp.
- MrBra 9y agoNot writing JS is not the only purpose: --- Ferro uses an object oriented programming style. You instantiate an object, that object in turn instantiates more child objects and add these as instance variables to itself. And so on, producing a hierarchy of object instances. This is called the Master Object Model (MOM). When an object is instanciated in the MOM, Ferro will add an element to the webbrowsers Document Object Model (DOM). The MOM keeps a reference to every DOM element. This erradicates the need for element lookups (jquery $ searches). If you need an element you know where to find it in the MOM. Getter methods are automatically added by Ferro for easy access to instance variables. - Some advantages Easy naming conventions: CSS classnames match Ruby classnames Easy naming conventions: every DOM element has same ID as the corresponding Ruby object. Useful when attaching javascript libraries to elements - What we DON'T need when using Ferro HTML Javascript DOM finders (like jQuery, Zepto, ...) Javascript libraries/frameworks that extend html (like Ember, Angular, JSX, Vue, Stimulus) Shadow DOM Javascript frameworks (like React) - File size Total size (Html+JS+CSS+AJAX) for a full application should be similar to a traditional application. All javascript for the linked website, including Opal, minified and gzipped is 89Kb. Compare that to jQuery: 73Kb, Ember: 111Kb, Angular: 111Kb, React: 35Kb. --- AND YES, writing code in Ruby rather than Javascript is seen as an improvement by many. Or must we necessarily wait for WebAssembly and C# ported to the web before we can enjoy a better programming language without feeling ashamed for avoiding JS?