6 ms·
The Little Book on CoffeeScript
- latch 15y agoExcellent work. FWIW, from my experience with The Little MongoDB Book, people love epub format.
- maccman 15y agoAny suggestions on how to go about converting it (Markdown) to epub?
- latch 15y agoWell, I went from markdown to pdf using pandoc/latex/markdown2pdf and then I think I used calibre. However, I just tried taking one of your html files and converting it directly to epub (again, using calibre, which is free)..and it did a pretty good job. I think if you can merge the chapters together and spend a bit of time tweaking it, you'll end up with a nice ebook.
- scq 15y agoCalibre can convert directly from markdown to epub: ebook-convert ebook.txt ebook.epub --formatting-type markdown or you can use the UI.
- DanBC 15y agoCalibre does not like PDF. It sometimes works, but the Calibre team recommend using against using PDF anywhere in the workflow. Calibre also comes bundled with a bunch of command line tools which, in my opinion, are much nicer than Calibre itself.
- wavephorm 15y agoWhy is this language continually hyped to no end on HN?
- michaelchisari 15y agoAlthough it dignifies your question, I'd say it's because it's the first breath of fresh air in client-side development people have had in a long time. Having a real choice in that space is a big deal. Do you have specific criticisms of CoffeeScript? That would probably have made for a more productive comment.
- wavephorm 15y agoIt just wreaks of fanboyism when every comment or question that doesn't give praise to coffeescript is downvoted.
- starwed 15y agoOk, point to a specific comment/question that you think was unfairly downvoted.
- kevinpet 15y agoThe top level comment starting this thread seems to be a valid enough question to have generated some discussion, but it's showing grayed out to me.
- starwed 15y agoIt got real answers. I imagine it was downvoted for its aggressive wording, coupled with the poster's later commments about 'fanboyism'.
- 2132135131 15y agoI never got that behavior, there is nothing in the guidelines that said "Don't be aggressive and don't call people fanboys even if you think so and have something to show supporting that" The closest that I can see in approach to comments is that you have to be civil and not say things in you wouldn't say in real life. The original post was not guilty on any of those counts. By no means was it an rude or uncivil comment, I see no name calling and he did support his statement in subsequent comments. If you are going to be a baby about it and can't take being called a fanboy then please accept that being called fanboy is uncivil and push to include that into the approach to comments.
- barmstrong 15y agoI love CoffeeScript. The only thing that seems unintuitive about it is how functions get defined, and perhaps the meaningful whitespace (no 'end' on blocks). I've always wondered why they made coffee-script syntax so close to ruby without going all the way. "Write javascript in ruby" would have been a killer feature and tagline, but instead we're 80% of the way there with occasional expectations still being broken and new quirks to learn. Anyway...still a huge improvement overall so don't want to sound negative. Just something I was curious about.
- michaelchisari 15y agoI don't think a direct translation of Ruby -> Javascript would have made much sense, though. It makes much more sense to custom mould a new language to the needs of Javascript, than to try and fit Ruby into a whole new context. I started looking into making a parser that took CoffeeScript and parsed it into PHP, and the farther I got spec'ing things out, the less the CoffeeScript syntax made sense for the context of PHP. So it would make more sense to start new, and create a new syntax that fits better. I'm assuming the same process may have occurred for CoffeeScript. Anyways, as someone who greatly prefers Python over Ruby, I love using whitespace for blocks.
- fizx 15y agoRuby has a 6000 LOC yacc parser for the grammar. I would bet that Coffee's grammar is smaller, tighter, and less full of perlisms.
- InclinedPlane 15y agohttps://github.com/jashkenas/coffee-script/blob/master/src/grammar.coffee https://github.com/jashkenas/coffee-script/blob/master/src/g...
- starwed 15y agoAs someone who learned coffeescript last weekend, it took me literally minutes to figure out enough to translate some javascript I'd written. And I've never even used a significant-whitespace language before. That someone who knows javascript can so trivially pick up coffeescript says a lot about why they chose the syntax they did.
- kevinpet 15y agoI was excited when I saw the title, disappointed when I started reading the book. I'm hoping someone with sufficient expertise can write a guide to coffeescript that doesn't defer to "just like javascript, except X". That is, something that talks about coffeescript, covering it from start to finish, without distracting with talk about javascript.
- secoif 15y agoYou can't talk about coffeescript without talking about JavaScript, and that's the whole point of coffeescript: "it's just JavaScript". You need to know both languages to use it effectively.
- Volpe 15y agoI don agree with that. Sure knowing JavaScript is helpful in debugging. But you can be very effective with coffeescript without knowing too much about JavaScript.
- secoif 15y agoI guess you could, but you'd be making life harder for yourself, and other developers. Consider a website mockup by a designer with html/css experience and one without: the one with no html/css experience may be designing a total headache, and be completely oblivious to that fact.
- kevinpet 15y agoYou can't talk about javascript without talking about the execution environment, object system, and so on, which happens to be shared with javascript, but there is no more reason to discuss javascript when talking about coffeescript than to talk about the assembly-like output of javap when talking about java. Coffeescript has a different syntax than javascript, and it is totally pointless to say "you don't need to type 'var'". It would be better to talk about how scoping works in coffescript. It happens that everything that's been written about coffeescript so far is about convincing javascript users to switch or helping javascript users to switch. That's not the only way.
- wallfly 15y ago"The Little Book.." was the first instructional text I read on CoffeeScript, i.e. beyond Coffee's home page hosted on GitHub. I followed up with the following free e-book, which I highly recommend: Smooth CoffeeScript http://autotelicum.github.com/Smooth-CoffeeScript/ http://autotelicum.github.com/Smooth-CoffeeScript/
- js4all 15y agoVery nice. That book seems to be complete on every aspect of CoffeeScript.
- exogen 15y agoI realize the situation may have been different when the Applications chapter was written, but I would be careful of the subtle jQuery.tmpl "endorsement" in the "JavaScript templates" section. jQuery.tmpl is unmaintained, slow, and very broken. It may be worth changing the example.
- maccman 15y agoYes, you might be right there. Eco would probably be a better choice (CoffeeScript syntax). I'll see if I can find time to change it.
- codabrink 15y agoIs there a good way to compile this into an ebook? I'd love to have this on my kindle.
- mhitza 15y agoHere's my PDF conversion of the book http://dl.dropbox.com/u/6746847/little-coffee.pdf http://dl.dropbox.com/u/6746847/little-coffee.pdf The links point to URL's though.