Friday, August 19, 2011

CoffeeShit, The CoffeeScript Parody



    ... because script happens!




This silly project does not want to offend the CoffeeScript creator neither any CoffeeScript user, hoping both have sense of humor :D



About

Every cult movie has one or more parodies ... well, every cult technology as well (or at least it should)!

This idiotic project is on github with a better explanation, a suite of unit tests, and both source code and the partially manually minified one ( manually because I have discovered a nice bug with closure compiler and eval there ... )



About The Name

You can check the library by yourself and realize I have used all worst possible practices in order to simulate a different syntax within the one allowed by JavaScript.

Such pile of shit I wrote to mimic an excellent project as CoffeeScript is could not have a better name, imo.

If you feel insulted by this idiotic experiment please let me know and I'll do my best to let people try it under a different name.



Example



// CoffeeScript

square = (x) -> x * x

fill = (container, liquid = "coffee") ->

"Filling the #{container} with #{liquid}..."

mood = greatlyImproved if singing

eat food for food in ['toast', 'cheese', 'wine']

winner = yes if pick in [47, 92, 13]

speed ?= 75



// CoffeeShit

square = 'x'['->']('x * x')

fill = ['container', 'liquid = "coffee"']['->'](

'Filling the #{container} with #{liquid}...'

)

mood = greatlyImproved.if(singing)

'eat(food)'.for('food').in(['toast', 'cheese', 'wine'])

winner = yes.if(pick.in([47, 92, 13]))

'speed'['?='](75)



Many more in the landing page, even more inside unit tests file.



As Summary

I really could not resist :D

This post aim is to let you write some comment, have fun with CoffeeShit!

No comments:

Post a Comment