What is CaffeineScript Good For?

Shane Brinkman-Davis Delamore edited this page Mar 16, 2018 · 7 revisions

Related: Language Comparison, Benefits and Highlights

While CaffeineScript is an excellent choice for any JavaScript project, there are certain areas where it particularly excels:

React-Style Example

CaffeineScript

import &ArtSuite

class Login extends Component

  render: ->
    Element
      TextElement
        text: :username
        size: ww: 1 hch: 1

      TextInputElement
        placeholder: "" enter username here
        size: ww: 1 hch: 1

JavaScript

let {Component, Element, TextElement, TextInputElement} = require('art-suite');

class Login extends Component {
  render() {
    return Element(
      TextElement({ text: "username", size: { ww: 1, hch: 1 } }),
      TextInputElement({
        placeholder: "enter username here",
        size: { ww: 1, hch: 1 }
      })
    );
  }
}
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.