The Little Book on CoffeeScript
The Little Book on CoffeeScript
stockNum.App Something new is just around the corner ðð
programming notes. mainly about JavaScript / jQuery. [@Takazudo] [takazudo@gmail.com] Hint: alt + / CoffeeScriptã¯æ¯ãå¦ãã¨ãã話ã¯ãCoffeeScriptã調ã¹ã¦ããã°å¦å¿ãªãã«å¼ã£ããã話é¡ã§ãèªåãããã«ã¤ãã¦ã¯ããªãèãããããããä½åããã®ããã°ã§ãæ¸ããã¨ãããCoffeeScriptãããªã¼ã¨æã£ã¦ã¯ãã¦ãããï¼ï¼ï¼ã¶æã¯ãã£ã¨CoffeeScriptã§JavaScriptãæ¸ãã¦ãããã ãã©ããããç¹ã¯ãã¡ããããã«ãããæ¸ãã¦ãããã¡ã«ãæåã¯è¦ãã¦ãªãã£ãåé¡ãè¦ãã¦ãããããæããããã®ã§ããã®ç¹ã«ã¤ãã¦å°ãæ¸ãã¾ãã ãªã CoffeeScript ãããã - 0xff.toBlog()ãªã CoffeeScript ããã¡ã - å¬éãã«æ¶ãè¡ãå¶æ
æ å ±æ度ãé«ãä½é¢ãæ°ã«ããITä¼æ¥ã®çããã¯ãä»æ¥ã¯ãã£ãã¨å¸°ãã¨è¨ããã¦ãã®ã§ããããã¨ãªããªã£ãã¨ã³ã¸ãã¢éãcho45ããã®é£ãéã«é£ããã¦ããã¹ã«ãã¦ããã®ã ã¨æããã¾ããå¼ç¤¾ãæããudzuraããããããã¹ã«ãã¦ãã®ãã¿ã¦ã¾ããã æãªã®ã§å¤§åå©ã«åå ãã¨ããããä»ã®æ¹ãè¨åãã¦ããªãããªãcoffee-scriptã®è¯ãé¢ãã«ã¤ãã¦æ¸ãããã¨æã£ã¦ãã¾ãã -> ã®ã¨ã¤ãªã¢ã¹ããé¢æ°ãªãã¸ã§ã¯ãã®æèãå¤ãã > ã®é¢æ°å®ç¾©ã¯JSæ¬æ¥ã®é¢æ°åè¨èªã¸ã®æèãå¼ã³è¦ã¾ãã¾ãããããããä»ã¾ã§ãé¢æ°åãã©ãã®è¨èªããã³ã·ã£ã«ã ã£ãããã«é¢æ°ãªãã¸ã§ã¯ããæåæ°çãªåé¡ã§ä½¿ãã«ããã£ãã®ã§ãã ãã³ãã¬ã¼ãã¨ã³ã¸ã³ã®Coffeekupã§ã¯ãé«éé¢æ°ã®å ¥ãåã«ãã£ã¦DOMã表ç¾ãããªãã¦ãã¨ããã£ã¦ã¾ãã doctype 5 html -> head -> meta charset:
ã¯ã¦ãªã°ã«ã¼ãã®çµäºæ¥ã2020å¹´1æ31æ¥(é)ã«æ±ºå®ãã¾ãã 以ä¸ã®ã¨ã³ããªã®éããä»å¹´æ«ãç®å¦ã«ã¯ã¦ãªã°ã«ã¼ããçµäºäºå®ã§ããæ¨ããç¥ãããã¦ããã¾ããã 2019å¹´æ«ãç®å¦ã«ãã¯ã¦ãªã°ã«ã¼ãã®æä¾ãçµäºããäºå®ã§ã - ã¯ã¦ãªã°ã«ã¼ãæ¥è¨ ãã®ãã³ãæ£å¼ã«çµäºæ¥ã決å®ãããã¾ããã®ã§ã以ä¸ã®éãã確èªãã ããã çµäºæ¥: 2020å¹´1æ31æ¥(é) ã¨ã¯ã¹ãã¼ãå¸æç³è«æé:2020å¹´1æ31æ¥(é) çµäºæ¥ä»¥éã¯ãã¯ã¦ãªã°ã«ã¼ãã®é²è¦§ããã³æ稿ã¯è¡ãã¾ãããæ¥è¨ã®ã¨ã¯ã¹ãã¼ããå¿ è¦ãªæ¹ã¯ä»¥ä¸ã®è¨äºã«ãããã£ã¦æç¶ãããã¦ãã ããã ã¯ã¦ãªã°ã«ã¼ãã«æ稿ãããæ¥è¨ãã¼ã¿ã®ã¨ã¯ã¹ãã¼ãã«ã¤ã㦠- ã¯ã¦ãªã°ã«ã¼ãæ¥è¨ ãå©ç¨ã®ã¿ãªãã¾ã«ã¯ãè¿·æãããããããã¾ãããã©ãããããããé¡ããããã¾ãã 2020-06-25 è¿½è¨ ã¯ã¦ãªã°ã«ã¼ãæ¥è¨ã®ã¨ã¯ã¹ãã¼ããã¼ã¿ã¯2020å¹´2æ28
20111011 è¿½è¨ node.jsãã¤ã³ã¹ãã¼ã«ããªãã¨.coffeeå ã®æ¥æ¬èªã.jsã«ã³ã³ãã¤ã«ãããå¾ã«æ¬ è½ããåé¡ãããã¾ããã brew install node.js ã§ãnode.jsãã¤ã³ã¹ãã¼ã«ãããã¨ããããããã¾ãã Homebrew㯠https://github.com/mxcl/homebrew/wiki/installation ãåèã«ç°¡åã«ã¤ã³ã¹ãã¼ã«ã§ãã¾ãã ããçJSã¯è§¦ããªã Titaniumã§ãã¸ãã¯ãæ¸ãã¦ãã¦çJSã®éåãã«çµ¶æãã¦ããã¨ãããCoffeeScriptã®ãã¨ãæãåºãã¦é£ããå«ãã§è§¦ã£ã¦ãªãã£ãã®ã§è©¦ãã«CoffeeScriptã触ã£ã¦ã¿ãã壮絶è¯ãã£ãã®ã§ãããTitaniumãCoffeeScriptã§æ¸ããã¨æãã¾ããã Guardã§èªåã³ã³ãã¤ã« CoffeeScriptã¯ã³ã³ãã¤ã«ãããã¨ã§JavaScriptã®
å人製ä½ã®ã·ã¹ãã ã®jsãcoffeeã«å®å ¨ç§»è¡ããã®ã§ãã®éæãæ¸ãã¾ããããã¾ã§ãå人çãªææ³ã§ããæãæ¹ã¯äººããããã§ãã ã¡ãªã¿ã«åã¯åå¼·ãå ¼ãã¦æã§ç§»è¡ããã¾ããããjs2coffeeã¨ãããã¼ã«ã使ãã¨èªåã§å¤æãã¦ããããããã§ãã #å ã«çµè« coffeeã®æ¹ãããã¨æãã ããããæ¹å¤ã«ãjsæ¸ãã°ããããããã¨ããã®ããããã©ã極端ãªè©±ããã¢ã»ã³ãã©æ¸ãã°ããããããã¨é«ç´è¨èªãåºã¦ããé ã«è¨ã£ã¦ã人ã¨ä¸»å¼µã®æ¹åæ§ã¯ä¼¼ã¦ãã¨æãã極端ããããã©ã jsã«ã¯è½ã¨ãç©´ããã£ã±ããããæ £ãã¦ããã¾ã«ã¯ã¾ããvarãå¿ããããé¢æ°ã®é ã§å ¨é¨ã®varãåæãããã¨ãããã©ã¯ãã£ã¹ã«å¾ã£ã¦ãããåé·ã«ãªã£ã¦ç®¡çããã³ã¹ãé«ããªã£ããã coffeeã使ãã¨ããããä½è¨ãªåé¡ãæèããªãã¦ãããªãã®ã¯ã¨ã¦ã大ããã ãããjsã§ã§ãããã¨ã®å ¨ã¦ãcoffeeã§ã§ããã工夫ãå¿ è¦ã«ãªã
æè¿CoffeeScriptçéã®ããã´ã¹ãã£ã¢(æ»èª)ãè³ããã¦ãããCoffeeScriptã使ãã¹ããã使ãããã¹ããï¼ãã¨ãã話é¡ã«ã¤ãã¦ã¾ã¨ãã¦ã¿ãã 以ä¸ã®è¨äºç´¹ä»ã¯è¶ 訳ãã¤è¦ç´ãªã®ã§è©³ããç¥ããã人ã¯å è¨äºãåç §ã®ãã¨ã ãã¨ã®çºç«¯ã¯ãã®è¨äºã SnackJSã®ä½è ãCoffeeScriptããã£ã¹ãã A Case Against Using CoffeeScript by Ryan Florence ãããã°ã®åé¡ CoffeeScriptãçæããJavaScriptã¯ãã¡ãã¨ãã¦ãããã©ãçµå±ã¯èªåãæ¸ããã³ã¼ããããªãããèªã¿ã«ãããèªåã§ç´æ¥æ¸ããã»ããè¦ãããã ããã«CoffeeScriptããããã°ããã¯ã¼ã¯ããã¼ã¯å¤§å¤ã ã ã¾ãåé¡ãJavaScriptå ã®ã©ãã§çºçããã®ããçªãæ¢ãã(CoffeeScriptã®ã³ã¼ãã¨è¡åä½ã§å¯¾å¿ãã¦ãªããã大å¤ã )
ã£ã¦ãæ¥æ¬ã®ã®ã¼ã¯ãªããããããã ãããªã¼ ã¿ãªããCoffeeScript使ã£ã¦ã¾ããï¼ã¡ãã£ã¨jsããã人ãªãããè¦ãããã¦ãææ³ãå¹³æã§ããã¤RubyãPythonã½ãæ¡å¼µããã¦ãã®ã§é常ã«ã¹ãã¬ã¹ãå°ãªãã§ã ããããå ã®JSã®ç¹æ§ãã»ã¨ãã©å¦¨ããªãããã«ãªã£ã¦ãã®ã§ãjsã§ã§ãã¦coffeeã§ã§ããªããã¨ã¯ã»ã¨ãã©ãªãã(ã¾ã£ãããªãããã¯ã¡ããã¨ç¢ºããã¦ã¾ããã⦠ãªãã¨æãã¾ã) é°å²æ°ãã¤ã³ãã³ããããã¯ã®Rubyè¨æ³ã®ãããªå°è±¡ã ã¨ããããã§å ãã¿ã¯ 10 CoffeeScript One Liners to Impress Your Friends | ricardo.cc ã§ã CoffeeScriptã¤ã³ã¹ãã¼ã«æ¸ãªãã$ coffee -iãããã㯠$ coffee ã§å¯¾è©±ã¤ã³ã¿ããªã¿èµ·åãã¾ã 1. ãªã¹ãã«å«ã¾ããã¢ã¤ãã ã2åã« coffeescript
ããã«ã¡ã¯ãæ¯å¹´è±ç²çã«ãªãããã¦ãã飯å¡ã§ãã æè¿ã®Node.jsã®æ®åãªã©ã«ãã£ã¦ãµã¼ããµã¤ãJavaScriptçéãçãä¸ãã£ã¦ãã¾ãã ãããªããããªJavaScriptãã©ã¯ã«ãã¤ã¨ã¬ã¬ã³ãã«æ¸ãããã®CoffeeScriptã¨ããè¨èªããã¥ã¼ããªã¢ã«é¢¨ã«ç´¹ä»ãã¾ãã ä½ãããã®ã©ã¤ãã©ãªãèªåã§æ¸ãç¨åº¦ã«JavaScriptã§éçºãã¦ãã人ã¯çµ¶å¯¾ã«ä½¿ã£ãã»ããããã¨æãã¾ãã JavaScriptãç¥ã£ã¦ããã°1-2æéç¨åº¦ã§ååé§ä½¿ã§ããããã«ãªãã¾ãã ï¼2011/6/28ï¼@m_satyræ§ã«ãææé ããç®æãä¿®æ£ãã¾ãããï¼ ç®æ¬¡ CoffeeScriptã¨ã¯ï¼ ã¤ã³ã¹ãã¼ã« Hello World æ§æ é¢æ° å¤æ°å±é Objectã®çæ ã«ã¼ã åå¨ãã§ã㯠ãã¢ããã¥ã¡ã³ã thisã®ãã¤ã³ã ã¯ã©ã¹ ç¡åé¢æ° {var} Tips ?ã®ä½¿ãåã åå¨ãã§ãã¯
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}