Giter Club home page Giter Club logo

jaesque's Introduction

The Jaesque Style

this is javascript

Fantastical bits

  • Put each statement on its own line(s)
  • Don't add ; at the end of your statements
  • If your statement is impure; mark it with a ; in the front!
    • Why? Javascript expressions always play well with Automatic Semi-colon Insertion. It is the prefixes in statements which potentially cause problems (e.g. hello () \n [] .forEach (...) on the next line is confused with hello () [] .forEach, which gives errors like Unexpected token ]). So we can safely escape statements, and only statements! And the only statements that are not 'impure' are variable assignments, which also respect Automatic Semi-colon Insertion.
    • e.g. No console .log (x). It's impure, so ;console .log (x)
  • If your function is impure; make it {;}!
    • e.g. No x => console .log (x). It's impure, so x => {;console .log (x)}
  • Don't use this, use require ('thiss')
  • No function statements
  • Make your functions generic. Use x, y, z, t, u, v, w, q, r, s, ... for the parameters (Unless they are really specific, obviously unreusable)
    • What is this? basically the 'ABC' song triplets/quadruplets/quintuplets
  • Add spaces between tokens
  • Avoid suffixes smaller than the prefix. It is undiscoverable.
    • e.g. This is bad. The significant call operator () is undiscoverable! Is this a function or the value?
var result = (x => {
   ...
   var computation = step_1 + step_2
   return result
}) ()
  • Mark your sentence with the one significant prefix (if its in a phrase), hide the rest on the previous line. Encourage the leading member to follow the [ or (
    • e.g. (the prefix here is o)
var result = Oo (something,
  o (x => x .parent),
  o (R .reduce ((sum, x) => sum + x, 0)))

or

var q = [ document .querySelector ('fire')
  , document .querySelector ('earth')
  , document .querySelector ('air')
  , document .querySelector ('water') ]
  • Collapse the )s, }s, etc.

Aesthetic bits

  • Use tabs
  • Use single quotes ''
  • Use snake_case (since hyphen-case does not work)
  • Do add a space before .. The property is a word!
    • e.g. document .body .style .backgroundImage = 'url(doge.png)'
  • Use arrow functions, and only arrow functions!
  • Arrow functions with one parameter, take no brackets
  • Curry!
  • Use var, and var only
  • Try to not mutate vars
  • No class statements
  • Write your unfinished code as ...

jaesque's People

Contributors

herbsalad avatar

Watchers

 avatar  avatar

jaesque's Issues

functors on adts?

howto deal with isomorphisms on data types? when i have two types that are compatible?

next, i need a functor that takes an adt to the sum of its terms, with each term wrapped into a monad of suitable coarseness, so i can construct the adt piece by piece.

How to do optional parameters?

maybe make a param, so first call in curried function will check whether was given by param. If not, recurse to param-ed version with default params. Make wrapper function to let param functions be easy to make.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.