Coffee-script usage

20 views
Skip to first unread message

DavidA

unread,
Apr 22, 2012, 12:31:28 PM4/22/12
to Fulcrum Devel
Hi, I'm a beginning web developer and I noticed that fulcrum uses a
lot of Javascript. Tracking bugs in Javascript is kinda hard so I'm
teaching myself coffee script and I'm practicing converting
fulcrum .js files to .coffee files.
I'm no expert, but I was wondering if there was interest in doing
that, I can start submitting pull requests for the few files I've
converted. What's the consensus? I for one find coffee-script way
easier to read and debug than plain Javascript.

Eumir Gaspar

unread,
Apr 22, 2012, 7:41:53 PM4/22/12
to fulcru...@googlegroups.com
Just saw your reply to the html vs haml thing and i find it weird that it's easier for you to debug coffeescript than javascript and then say the other thing for haml and html. being a beginning web developer, i would suggest that you stick with the basics(html and javascript) first because any abstraction would just add to the complication. If you didn't know what your code in haml/coffeescript compiles to, how would you debug it?

That's just me though and I'm sure there are a lot who will suggest differently. I do love haml and coffeescript but I would think that any beginning developer should first dive into the basics before going forward with any abstracting layer.

Malcolm Locke

unread,
Apr 24, 2012, 7:22:54 AM4/24/12
to fulcru...@googlegroups.com

Hi David,

There may come a point in the future when the project converts to
CoffeeScript, or something similar, but I'm not quite ready for it at
the moment. My main motivations are:

- I'm still learning Javascript, and am not comfortable moving to a meta
language at this point. This is a pretty weak argument, and taking it
to it's logical conclusion would mean that I should write all my code
in assembly. But it is how I feel at the moment. I can see the
appeal of CoffeeScript, and would appreciate the more concise syntax,
but I haven't yet been driven to distraction by Javascript ... yet.

- I worry about the longevity of the alt.js languages, and that if we
take the trouble to convert the Javascript to CoffeeScript, tomorrow
some new hotness will come along and we'll have to convert to that.
One constant in the equation is Javascript, all these languages are
going to be compiling down to it for a while to come IMHO.

If I was starting the project today, I would seriously consider
CoffeeScript. But given the amount of code we have already, I'm not
sure if it's worth it.

As always though, it's on the table for discussion. Maybe I'm just a
Luddite ...

Malc

Steven Talcott Smith

unread,
Apr 24, 2012, 8:03:09 AM4/24/12
to fulcru...@googlegroups.com
Hi Malcolm, thank you for creating fulcrum and open sourcing it.  Fulcrum is a nice project that is at once quite useful and functional and demonstrates some important newer technologies and techniques yet also small enough and contained enough to be able to hack on.

Having moved quickly from hacking on fulcrum to learn a little backbone to now going full bore with coffee script and backbone on a new project, I vote for encouraging David to go ahead with the conversion.  It will be a chance for you to learn coffeescript which once you get over the newness becomes rather indispensable.  It's not going away any time soon.  More likely the ideas will get incorporated into some future javascript.  The new hotness phenomena is part of our craft and we are always in the business of mastering something new.  Let's not let fear of the new shut us down or restrain someone else's progress.  Enthusiasm is a delicate thing.    I welcome David's conversion to CoffeeScript.  People may look to fulcrum for examples of real coffeescript.  That would be cool!

Tom Harrison

unread,
Apr 24, 2012, 9:12:51 AM4/24/12
to fulcru...@googlegroups.com
Hey Malcolm --

Saw this thread and thought I would share a couple thoughts -- I think we may have similar views.

I share your concern that meta-langauges on top of JS may not survive/thrive.  But I keep seeing it pop up in non-Rails places.  While it's true that it's not directly debuggable, it quickly becomes clear how the JS produced by the CS compiler matches up -- there's a surprisingly small amount of inscrutable magic going on.  But yeah, until browsers natively parse CS, the whole precompile thing is likely to be a challenge.

I also am not much of a JS guru -- I can get things done, but I never quite grokked it.  It was learning CoffeeScript that helped me over the edge in learning JS at another level, ironically.  I think there's a strong parallel between C and early C++ to JS and CoffeeScript.  CoffeeScript seems a far more sane approach to a language than JS -- but still, in the end, just producing pure JS ... for now.

Tom

Steven Talcott Smith

unread,
Apr 24, 2012, 11:27:07 AM4/24/12
to fulcru...@googlegroups.com, fulcru...@googlegroups.com
Forgot to mention, one of the top devs here in the phillipines produced a js2coffee conversion tool that really helps when youre just starting out.  


Try just pasting your js in there.  It's easy.

Sent from my iPhone
Reply all
Reply to author
Forward
0 new messages