Skip to content

CoffeeScript/JavaScript library for my distinctive code style

License

Notifications You must be signed in to change notification settings

shurko0x4cfd/Raffinade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Raffinade

Effort to transform CoffeeScript to prefix language. In order to avoid nested constructions and achieving code elegance.

Example issue and approaches to resolve:

# Issue
# Nested construction, cumbersomity

value = (some_function argument)[key]
# Approach

### Get property ###
gp = (key, obj) -> obj[key]
# Result

value = gp key some_function argument
# CS produce code returns lalest expression, altought some time need not this
# return, therefore this code is redundant. Possible to append undefined in
# last line, but this require one line

some_function = ->
    some_code
    undefined

# Looks better idea use prefix function ala JS void operator

v = -> undefined # Kind of JS void

some_function = -> v some_code