Live data from Hacker News

CoffeeScript's Time is Waning For Me

mattgreer.org

51–60 of 67 posts

Re: CoffeeScript's Time is Waning For Me

#51
> [tooling] is perfect with JavaScript

Tooling is terrible with JavaScript. Even if you use something like Tern, it's still really bad.

You can pass arbitrary arguments to functions. Types and arity isn't checked. Optional positional/named arguments (with default values) don't exist. Passing some options object and "foo = foo || 5" is the best you can do. You can't tell, with absolute certainty, that some object doesn't have some particular property. A string might have a "lenght" property (should have been "length", that was a typo).

Your IDE can make some educated guesses and offer some auto-complete suggestions based on that.

There is also type coercion. Maybe you really wanted to create NaN in a very elaborate manner. Multiplying some array with some object is totally legit. No squiggly line for that.

That's a far cry from being perfect.

Never used something like C# or Java? Dart's tooling is also pretty good, for example. Even AS3 offers much better tooling than JS. TypeScript does of course also offer way better tooling.

JavaScript's tooling is terrible, really.

Re: CoffeeScript's Time is Waning For Me

#52
post #44
post #8

Unlike the author, I love significant whitespace and am enjoying nimrod lately with it. I'd love to see a CoffeeScript variant for TypeScript. TypeScript has the structural things of CoffeeScript and more (OO paradigms, member visibility, modules, typing, etc) but much more verbose. I have tinkered w/ the CoffeeScript grammar/parser adding in a backslash to denote to type (e.g. "(x\int) -> x * x") and the TypeScript…

I love CoffeeScript and am excited about nimrod, but I don't see the point of TypeScript. Honestly I am fairly certain that it was largely created by Microsoft as part of the EEE strategy ( http://en.wikipedia.org/wiki/Embrace,_extend_and_extinguish ) since the main advantage of JavaScript is not having to supply types.

> since the main advantage of JavaScript is not having to supply types.

With TypeScript and Dart, the type annotations are optional. You don't have to use them.

With JavaScript, you can't add any type information. Using non-standard doc comments is the only option.

Also, the main advantage of JavaScript is that it's available in browsers.

Re: CoffeeScript's Time is Waning For Me

#53
post #45
post #23

I literally stop reading when he start whi..talking about hate on significant whitespace.

I literally hit downvote when he start whi..talking about whi..talking about hate on significant whitespace.

Unlike the whitespace in my code, your downvote is insignificant to me.

Re: CoffeeScript's Time is Waning For Me

#54
the only thing from coffeescript i think i will end up really missing is switch expressions. When used with conditional assignment it makes for code that is far prettier and more concise than nested if-then-else chains.

[1] https://gist.github.com/Vertice/ac357533da976990dc4d

Re: CoffeeScript's Time is Waning For Me

#55
CoffeeScript is waning for me as well but not for the same reason: Dart and/or Typescript seem to be superior solutions, both backed by companies that are going to keep their language alive for a very long time.

I'm curious which one will emerge, though.

Re: CoffeeScript's Time is Waning For Me

#56
post #46

I have similar issues with coffescript, specifically the pain of significant whitespace is noticable whenever I find myself recalling how to write a simple `setTimeout` (or any similarly structured function) calls correctly, which is pretty much every time I use one as I don't find it particularly natural or intuitive. Personally, though I'm looking at Dart rather than ES6.

This is how I do setTimeout: delay = (ms, func) -> setTimeout func, ms So you can write it like this: delay 100, -> console.log "100 ms passed"

The problem is it isn't the only situation this comes up in, and the fact that this has to be done at all is a testament to the problems with adding significant whitespace to a language not completely designed for it.

Re: CoffeeScript's Time is Waning For Me

#57
post #44
post #8

Unlike the author, I love significant whitespace and am enjoying nimrod lately with it. I'd love to see a CoffeeScript variant for TypeScript. TypeScript has the structural things of CoffeeScript and more (OO paradigms, member visibility, modules, typing, etc) but much more verbose. I have tinkered w/ the CoffeeScript grammar/parser adding in a backslash to denote to type (e.g. "(x\int) -> x * x") and the TypeScript…

I love CoffeeScript and am excited about nimrod, but I don't see the point of TypeScript. Honestly I am fairly certain that it was largely created by Microsoft as part of the EEE strategy ( http://en.wikipedia.org/wiki/Embrace,_extend_and_extinguish ) since the main advantage of JavaScript is not having to supply types.

I disagree. TypeScript not only attempts to be inline w/ upcoming ES/Harmony standards, but it is not pushed on you in any way. It's Apache licensed and it's not like MS is putting a TypeScript VM in their browser. I love TypeScript's typing system, especially type declarations which are based on whether something has something vs on its named type (i.e. duck typing). There are many editors from MS's free VS express to WebStorm plugins to event IDE's written in TypeScript themselves. I find the language work by MS these days (this, f#, etc) to be really community friendly as opposed to locking in.

Re "main advantage of JavaScript is not having to supply types", I am a static typing fanatic so I am just going to disagree here and spare everyone the religious (or as Yegge would say, political) war.

Re: CoffeeScript's Time is Waning For Me

#58
post #16
post #5

Earlier quoted context omitted.

I'm curious about this statement as well. It sounds like the author might be: - Creating big complex methods instead of breaking code into smaller (testable) ones? - Nesting callbacks multiple levels deep, instead of using something like Node Async to flatten out code flow? - Choosing a Coffeescript code style that leads him to put callbacks on their own line, or something like that? - Something else? Not implying th…

I'm the author of the blog post. Significant whitespace is pretty dividing, and really boils down to preference. I have a strong dislike for it, and have avoided any language with it, CoffeeScript being the only exception. Here is a typical snippet of my code as seen in my editor: http://i.imgur.com/2yVhgcz.png IMO, those four methods really bleed together and are hard to discern, not to mention the if statements. I…

Does that suggest you don't indent your code at all? Do you miss out on the cheapest visual cue to understanding your code? If you indent code already (with all the curly braces) then significant whitespace means your normal indentation sans 2 curly braces every time.

Re: CoffeeScript's Time is Waning For Me

#59
post #28
post #2

"As my project grows in size, significant whitespace becomes more and more of a problem. It’s just plain not readable or visually parsable. Your files become a wall of dense text. Damn you Python, damn you to hell!" I would appreciate an explanation of this paragraph. How exactly does project size compound issues with significant whitespace? Are you indenting five levels or something?

just want to drop another vote against against significant whitespace... i find it slows down my coding because rather than coding & then quickly tidying i instead have to obsess over this tidying at every step or the code won't work in the first place. I find it more efficient to do the code grouping as a "post-POC" task (or when things are starting to look confusing) and to leave the visual look to my discretion. I…

> i instead have to obsess over this tidying

I don't mean this as a personal attack, but your comment contains plenty of spelling errors, incorrect punctuation and capitalization, and inconsistency (e.g., use of both "&" and "and"). In my experience, people who aren't careful with syntax tend to detest significant white space, which is understandable.

Re: CoffeeScript's Time is Waning For Me

#60

I gave CoffeeScript a shot, and frankly I don't like these JS "wrapper" languages. First of all if you want anyone else to help you with your code its likely that they don't know the wrapper's syntax and will have to waste a bunch of time learning it. My boss got super excited about it when it first came out and it just caused a lot of headache and wasted time. First I (and all my coworkers) had to learn the language…

> will have to waste a bunch of time learning it.

Please define "bunch of time". I'm having trouble imagining how learning CoffeeScript would require more than a couple of hours for an experienced developer.

Post reply on HN