By
www.indiesjxe.com www.indiesinc.com
• What is Coffee Script ?
• How it can help us ?
• Coffee in Browse ?
• Advantage?
• Disadvantage?
Coffee Script
Basic Introduction
What is Coffee Script-1
• Coffee Script is a programming language that transcompiles to
JavaScript that means source code ...
What is Coffee Script-1
• The golden rule of Coffee Script is: "It's just JavaScript". The code
compiles one-to-one into t...
What is Coffee Script -2
• Cooperate with already existing JS libraries (like
jQuery, Facebook JS SDK, Google API etc.)
• ...
How it can help us ?
• Less lines of code with better readability,
• Code easy to understand, and maintain
• Standard code...
Example
Coffee Script in Your Browser
1. <script src=“coffee-script.js” type=“text/javascript”></script>
2. <script type=“text/Cof...
Advantages
• All the good Feature of java script are present in coffee
script
• English Like syntax and no return statemen...
Advantages
• The ability to write code that works in old versions of
Internet Explorer without having to compromise or
shi...
Disadvantages
• When you are using coffee script , there`s an additional
compilation step involved in the process.
• Coffe...
Disadvantages
• Priority rules are not always intuitive, sometimes causing
sub-expressions to end up in unexpected places....
The Final Word
• Sole purpose is to remove the rough edges from the java
script and provide a smooth way of programming in...
www.indiesinc.com
Upcoming SlideShare
Loading in …5
×

Introduction to Coffeescript

326 views
190 views

Published on

Coffee Script is a programming language that transcompiles to JavaScript that means source code of a coffee script as its input and outputs the source code into another programming language.

We are Java service provider company. Visit us
http://www.indiesinc.com

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
326
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Introduction to Coffeescript

  1. 1. By www.indiesjxe.com www.indiesinc.com
  2. 2. • What is Coffee Script ? • How it can help us ? • Coffee in Browse ? • Advantage? • Disadvantage?
  3. 3. Coffee Script Basic Introduction
  4. 4. What is Coffee Script-1 • Coffee Script is a programming language that transcompiles to JavaScript that means source code of a coffee script as its input and outputs the source code into another programming language. • The language adds syntactic sugar inspired by Ruby, Python and Haskell to enhance JavaScript's brevity and readability, adding sophisticated features like list comprehension and pattern matching. • Coffee Script is an attempt to expose the good parts of JavaScript
  5. 5. What is Coffee Script-1 • The golden rule of Coffee Script is: "It's just JavaScript". The code compiles one-to-one into the equivalent JS, and there is no interpretation at runtime. • You can use any existing JavaScript library seamlessly from Coffee Script (and vice-versa). a simple way. The compiled output is readable and pretty-printed, will work in every JavaScript runtime, and tends to run as fast or faster than the equivalent handwritten JavaScript.
  6. 6. What is Coffee Script -2 • Cooperate with already existing JS libraries (like jQuery, Facebook JS SDK, Google API etc.) • Code compiles one-to-one into the equivalent JS • Pass through JSLint without warnings
  7. 7. How it can help us ? • Less lines of code with better readability, • Code easy to understand, and maintain • Standard code encapsulation and variables • Protection (no var anymore) • But... even if you are writing code in CoffeeScript You should know how JavaScript`s concepts work
  8. 8. Example
  9. 9. Coffee Script in Your Browser 1. <script src=“coffee-script.js” type=“text/javascript”></script> 2. <script type=“text/CoffeScript”> 3. firstname = prompt “what is your first name?” 4. lastname= prompt “what is your last name ?” 5. fullname=firstname+ lastname 6. Alert “Hello, #{fullname}” 7. </script>
  10. 10. Advantages • All the good Feature of java script are present in coffee script • English Like syntax and no return statement required. • You don`t have to debug any “ }” in your script • With the proper use of white space you can make your script more readable as well as maintainable
  11. 11. Advantages • The ability to write code that works in old versions of Internet Explorer without having to compromise or shim • Not having to worry about JavaScript pitfalls like trailing commas and automatic semicolon insertion • Cleaned up semantics where every language construct can be used as part of a larger expression
  12. 12. Disadvantages • When you are using coffee script , there`s an additional compilation step involved in the process. • Coffee Script is very sensitive to whitespace, counting a tab as a single space. • The compiler provides very rudimentary diagnostic information in the case of errors.
  13. 13. Disadvantages • Priority rules are not always intuitive, sometimes causing sub-expressions to end up in unexpected places. • Debugging is a major problem because the compiled code is not always readable. • But Coffee script team is trying to solve this in the future
  14. 14. The Final Word • Sole purpose is to remove the rough edges from the java script and provide a smooth way of programming in JavaScript • Now Programming in JavaScript has an easy way and hard way –the choice is yours. • To learn Coffee script syntax you can refer Coffeescript.org
  15. 15. www.indiesinc.com

×