Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,150,786 members, 7,810,051 topics. Date: Friday, 26 April 2024 at 07:24 PM |
Nairaland Forum / Science/Technology / Programming / Coffeescript (1258 Views)
C++, Ruby, Coffeescript: A Visual Comparison Of Language Complexity / Coffeescript - What Is Coffeescript? (2) (3) (4)
(1) (Reply)
Coffeescript by kadeerna: 2:59pm On Jun 06, 2012 |
Languages that follow the C (C++) influenced syntaxes have been becoming more and more of a pain to write in, thanks to the rapid introduction and uptake of languages with easier semantics to understand, and easier to write on the fingers. The Javascript langugage used in billions of web pages today derives many of its constructs from C. In other words, it is a pain to write today.
What is wrong with the above block, a lot!. - function <- what is that? It won't kadeerna, it won't be anything else. - { ... } <- OK? - ; <- Don't even get me started on this one. Follow the brouhaha over a single missing | left out in the comments on Github for the Bootstrap css library project - alert(...) <- (.)_(.) - var <- Resharper (in VS), and Webstorm don't gimme a break on this one Compare the above written block to its equivalent in CoffeeScript.
Does that look sexy or what? Coffeescript is a language (extension to javascript) for that brings Ruby styled constructs and ease of coding to the language we all love, Javascript. The language which drops a lot of the syntactical noise of Javascript compiles down to easy to read, compiled, and optimized Javascript which is read, and executed by the browser in client side usage or a Javascript engine like V8 in server-side usages like NodeJS environments. You cant try it out in you browser here: http://coffeescript.org Noise like function keywords, parentheses, braces, semi-colons, var are eliminated allowing the developer code their application logic in sweet memories of last nights .... and not of tracking down a missing ;. In the speak of the languages' creators, "CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way." Quite a lot of Ruby style constructs have been imported to almost seamlessly supplement the Javascript language in a new way. For example,
Ok, thats plenty for 1 post me thinks. You should get the gist by now. CoffeeScript is simply amazing. It is indentation based too using whitespace to delimit blocks of code. It had reduced LOCs of our projects by as much as 1/3 in one instance. It is readable, easy on the eye, easy to hack, strongly in development. I left out a lot of really time saving features of the language. |
(1) (Reply)
C's And C++ Base / Game Developer Needed For A Project / Withdrawal Issues On Fiverr - Payoneer
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 13 |