Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,623 members, 7,816,564 topics. Date: Friday, 03 May 2024 at 01:13 PM

Coffeescript - What Is Coffeescript? - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Coffeescript - What Is Coffeescript? (3645 Views)

C++, Ruby, Coffeescript: A Visual Comparison Of Language Complexity / Coffeescript (2) (3) (4)

(1) (Reply) (Go Down)

Coffeescript - What Is Coffeescript? by wale4x35(m): 2:50pm On Dec 20, 2011
What is CoffeeScript?

CoffeeScript is a small programming language that compiles into JavaScript. It seeks to make writing JavaScript code better by providing you with a more consistent and succinct syntax, as well as by avoiding the "bad parts" and quirky/irregular nature of the JavaScript language.

http://jashkenas.github.com/coffee-script/

How CoffeeScript Works

The code writing and use process of CoffeeScript is simple:

   1. Write your code in a .coffee file
   2. Compile it into a .js file
   3. Include the .js file in your web page/s like you would any other JavaScript file


One thing I do not like is the compile part of the process.

[list]
[li]Have you used CoffeeScript before?[/li]
[li]Do you plan to use it?[/li]
[/list]

Share your views and thoughts.
Re: Coffeescript - What Is Coffeescript? by Nobody: 10:46pm On Dec 20, 2011
left to me i think about it and am like why bother not really anything specials i'd rather just stick to good habits than have a language do that for me, also if i have an error while writing coffeescript and compiled to js, i would have to look at coffee again. though it appeals more to ruby users than already javascript developers.
Re: Coffeescript - What Is Coffeescript? by ektbear: 11:07pm On Dec 20, 2011
I've heard about it before, never looked into it closely before this. Seems kind of cool. Thanks for posting.
Re: Coffeescript - What Is Coffeescript? by ektbear: 11:16pm On Dec 20, 2011
Reading through the tutorial seems heavily rubyish, lol. I'll have to look at this more.
Re: Coffeescript - What Is Coffeescript? by delomos(m): 12:06pm On Feb 05, 2012
wale4x35:

[list]
[li]Have you used CoffeeScript before?[/li]
[li]Do you plan to use it?[/li]
[/list]


Yes, I've used it but not on serious projects (I mostly do it with the other stack HAML/SASS), it's introduces interesting syntax to JS but then, when debugging, you have to go back to plain ol' JS -- in some way; my opinion is that people don't want to take the pain to learn the *good* parts of javascript and turn to the abstraction of coffeescript.

No doubt you can write faster, I like it ruby-like syntax (and some control structure it introduces to JS, unless, etc), but then,

IMO, I love syntax flexibility, that compiling thing is some biggie, though when I do coffeescript, I generally compile on the fly with: "Live Reload", and of course there's Node.js if you're so inclined.

For now, just plain javascript for me and it doesn't replace JS, it's more a compliment.

Btw, if you're want to pursue CffS, checkout my fork of this fine book: https://github.com/delomos/Smooth-CoffeeScript
Re: Coffeescript - What Is Coffeescript? by Fayimora(m): 12:53am On Feb 06, 2012
Coffee-script is AWESOME. However, if you dont write Ruby code or maybe python, you wouldn't see its use. I use CoffeeScript in my web development an its great. Some other things you should try out are HAML and SASS.
Re: Coffeescript - What Is Coffeescript? by ektbear: 8:25am On Feb 09, 2012
coffeescript is pretty cool.
Re: Coffeescript - What Is Coffeescript? by delomos(m): 12:24am On Feb 14, 2012
Took some time today to take another look at CoffeeScript through reading the beta of "Programming in Coffeescript" (due for release May/June 2012) -- a few interesting things with it lately but frankly, there's only so far abstraction should go, still sticking with vanilla Javascript.

Maybe it's the book (which I'm giving feedback to), or just me --- meehhhh.
Re: Coffeescript - What Is Coffeescript? by ektbear: 9:14am On Feb 14, 2012
delomos:

Took some time today to take another look at CoffeeScript through reading the beta of "Programming in Coffeescript" (due for release May/June 2012) -- a few interesting things with it lately but frankly, there's only so far abstraction should go, still sticking with vanilla Javascript.

Maybe it's the book (which I'm giving feedback to), or just me --- meehhhh.

Elaborate? Specific examples?
Re: Coffeescript - What Is Coffeescript? by delomos(m): 11:46am On Feb 14, 2012
@ekt_bear
This days, most of javascript work is heavy on jQuery which itself tries to abstract the working with the DOM, so say I want to do the oft AJAX thingy, say we're doing, using just JS/jQ:

$.get('somepage.php', {s:s_query }, function(data, xhr){
if(!xhr.success) { console.log("some error"wink; }else {
$('#some_id').html(data) }
}, json);

^^^ that is sure some heavy abstraction from writing pure XMLHttpRequest, then in CoffeeScript:

$.get 'somepage.php' ,{s:s_query}, ->(data, xhr)
if !xhr.success
console.log "some error"
else
$('#some_id').html data
,json

(which then compiles into JS that binds locally, and even more abstracted [synatically] ).

One misconception most folks have about CoffeeScript is that it frees you from understanding javascript -- well, wrong. One has to actually understand JS well, quite well actually to find CoffeeScript useful (since you have to debug in JS anyways).

jQ makes working with the day-to-day JS abstracted enough -- and frankly, getting used to some of CS idioms is too much trouble is all you're really doing is manipulating DOMs.
Re: Coffeescript - What Is Coffeescript? by ektbear: 12:05pm On Feb 14, 2012
I prefer the CS syntax above to the JS.

The JS takes more time to read, at least for me.
Re: Coffeescript - What Is Coffeescript? by delomos(m): 2:48pm On Feb 14, 2012
I agree, CS is definitely easier to read/write (though I must agree, there's a more readable way to write that block -- but it'll deviate a bit off JS idioms e.g. use anonymous function if function is not called elsewhere, which many language frown upon but I think is sweet, as you mention, not exactly pleasantly readable)

But don't forget you still have to compile, and debug a JS file (CS is only giving "syntax sugar"). In my mind, I'd most likely use CS is I'm doing a hardcore JS project, oooouch , but then there's Backbone.js , Dojo, Mootools, and other serious JS libraries that won't be in CS anytime soon.
Re: Coffeescript - What Is Coffeescript? by wale4x35(m): 5:30am On Mar 16, 2012
Its actually good to see how hard people around the globe are pushing JavaScript to the limits.

I would say in about 5-10 years, desktop application would become history.

Another JS library note.js http://nodejs.org/ makes it easy to write network applications using javscript.

Imagine serving web pages from javascript grin grin grin
Re: Coffeescript - What Is Coffeescript? by harakiri(m): 9:45am On Mar 16, 2012
Interesting stuff.
Re: Coffeescript - What Is Coffeescript? by snthesis(m): 11:36am On Mar 16, 2012
coffee is bad for d health as it contains caffeine tongue
Re: Coffeescript - What Is Coffeescript? by sparko1(m): 11:51am On Mar 16, 2012
please anyone help me with any institution where i can learn java or individuals who can teach please reply with valid information, no scam please!!!
Re: Coffeescript - What Is Coffeescript? by candylips(m): 3:23pm On Mar 16, 2012
whats wrong with jquery
Re: Coffeescript - What Is Coffeescript? by wale4x35(m): 4:22pm On Mar 16, 2012
sparko1: please anyone help me with any institution where i can learn java or individuals who can teach please reply with valid information, no scam please!!!

Do you have any previous programming experience?

Try google out your answers.
Re: Coffeescript - What Is Coffeescript? by levi4real07yahoocom: 11:12pm On Mar 16, 2012
Fellows pls, I love 2 program & develope as an engineer bt don't ve any one around me 2 get me dere. Pls pick me up 2 be at ur service & God will reward u.
Re: Coffeescript - What Is Coffeescript? by wale4x35(m): 2:38pm On Mar 30, 2012
Friends,

Another JS library - RaphaelJS http://www.raphaeljs.com for rendering graphics using SVG.

I am currently using it in the project attached below.

Its strange that little is known about this amazing library!!

(1) (Reply)

Daily Coding Problem / Let's Talk About OpenAI ChatGPT. What's The Future of Developers ? / How Many Devices Can Be Connected To Elonmusk Starlink In Nigeria?

(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. 32
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.