Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Use CoffeeScript! #2472

Closed
wants to merge 1 commit into from
Closed

Use CoffeeScript! #2472

wants to merge 1 commit into from

Conversation

mjackson
Copy link

@mjackson mjackson commented Jan 5, 2012

Come on guys. Time to upgrade.

Come on guys. Time to upgrade.
@thejh
Copy link

thejh commented Jan 5, 2012

Do the tests still run? Also, coco is better.

@mmalecki
Copy link

mmalecki commented Jan 5, 2012

+1, there's no way core can be written in JS. You need these advanced features and only CoffeeScript can provide them.

@mceachen
Copy link

mceachen commented Jan 5, 2012

YEAH! THIS ISN'T A TROLL! AT ALL! much.

@maccman
Copy link

maccman commented Jan 5, 2012

+1. Now I can actually read Node's source.

@kn
Copy link

kn commented Jan 5, 2012

Nice!

@alessioalex
Copy link

Dart is so much better, but we should ditch V8 in favor of SpiderMonkey too #lol

@ryantenney
Copy link

-1. Now I can't read Node's source.

@paulmillr
Copy link

+1. Now I am willing to read Node's source.

@chjj
Copy link

chjj commented Jan 5, 2012

You were supposed to wait until april 1st to do this!

@thejh
Copy link

thejh commented Jan 5, 2012

You should use is instead of == where possible.

@tj
Copy link

tj commented Jan 5, 2012

nom nom

@thejh
Copy link

thejh commented Jan 5, 2012

Also, you should omit call parens where possible, looks much better.

@pquerna pquerna closed this Jan 5, 2012
@pquerna
Copy link

pquerna commented Jan 5, 2012

Stop wasting our time.

@paulmillr
Copy link

node core devs cannot into jokes?

@mceachen
Copy link

mceachen commented Jan 5, 2012

"Wasting it with AWESOMENESS" - maccaw

@mjackson
Copy link
Author

mjackson commented Jan 5, 2012

Wha?! Do you realize how much time it took me to port the entire stdlib of node to CoffeeScript? It was so awesome!

@thejh
Copy link

thejh commented Jan 5, 2012

@mjijackson Sure you didn't use js2coffee? ;)

@sayrer
Copy link

sayrer commented Jan 5, 2012

15 896 / 6 501 = 2.44516228

I think you need to close this pull request 1.44516228 more times in order to maintain your current level of efficiency.

@jfhbrook
Copy link

jfhbrook commented Jan 5, 2012

Worthiness of troll attempt aside, I do find the differences in line counts interesting.

@hannahherbig
Copy link

Wow, this didn't last long at all.

@chjj
Copy link

chjj commented Jan 5, 2012

How long until this is posted on hacker news I wonder.

@thejh
Copy link

thejh commented Jan 5, 2012

@jesusabdullah Char count would probably say more.

@isaacs
Copy link

isaacs commented Jan 5, 2012

@mjijackson Sorry, I have to agree with @pquerna. Not a very well executed troll.

You're too well known of a noder (and not well-known as a crazy idiot), so it's obvious this is a joke. Too obvious to be funny, I'm afraid. It would have been better to start a new github account to do this from, get denied with no explanation, then have Hacker News blow up in flames over how much paul hates open source contributions, and node isn't community-friendly.

@jfhbrook
Copy link

jfhbrook commented Jan 5, 2012

@thejh probably.

If nothing else, this is definitely an interesting node/coffee case study, at least assuming he coffeescript is relatively idiomatic and not bizarro-generated.

@thejh
Copy link

thejh commented Jan 5, 2012

Hmm, 193440 chars coffee vs 433111 chars JS. And if he had used more cool syntax, it'd probably be even less chars.

Well, code length isn't everything, but I think this does say something.

@mmalecki
Copy link

mmalecki commented Jan 5, 2012

@isaacs has a point here.
/me goes to create a new account

@thejh
Copy link

thejh commented Jan 5, 2012

/me thinks js2coffee needs to become better

Also, we need js2coco.

@aslilac
Copy link

aslilac commented Jan 5, 2012

:o

@hlee
Copy link

hlee commented Jan 6, 2012

+1

@rmoriz
Copy link

rmoriz commented Jan 6, 2012

node is dead anyway. Dart ftw.

@joshkehn
Copy link

joshkehn commented Jan 6, 2012

@tylermwashburn I don't see how gossip === !true is cleaner then !gossip.

Here is a great one. gossip is weakly true translates to gossip === weakly(true). How do you like this no-symbol syntax?

@davej
Copy link

davej commented Jan 6, 2012

@visionmedia @AlejandroMG Technically gossip === !true is not the same as !gossip, the first uses the identity operator and the second implicitly uses the equality operator (thus no type conversion is performed). They will produce different truthiness values when gossip is an empty string for example.

@tj
Copy link

tj commented Jan 6, 2012

@davej in context... that's like people using typeof === 'foo' when it's always a string, you just have to actually use your mind

@davej
Copy link

davej commented Jan 6, 2012

@visionmedia Sure, I was just pointing out that they are not the same thing and there are instances where !gossip wouldn't be what you want. Personally, I think it's easier just to get into the habit of using === or !== all the time because it's more explicit and less likely to introduce bugs.

@tj
Copy link

tj commented Jan 6, 2012

I think I wouldn't want to use someone's software if they didn't know how to decide between == and ===

@otakustay
Copy link

I love coffee, but one question, why is buffer.coffee EMPTY?

@derdesign
Copy link

js → coffee → back to js, heh

@sandro-pasquali
Copy link

@davej @visionmedia It's a debate similar to the CS/JS one. Is it better to subsidize the original developer by spending the code maintenance time of future developers, or is it better to spread the cost evenly?

CS wants to gain followers, so promotion of the former benefits make more sense.
JS has a much larger presence in large scale application development (where the costs of maintenance are much more important -- debugging tools/ease, staffing availability, standardized coding conventions, consistent interfaces, actual financial cost...many more), so ignoring those costs rings hollow.

@davej
Copy link

davej commented Jan 6, 2012

@visionmedia It's not about knowing how to decide between == and ===, it's about saving yourself (and people reading your code) the hassle when === will do what you want. Sure, you can do a few little tricks when you know that null == undefined and 0 == '' but why bother, you're just making your code less understandable for the sake of a few characters.

@gf3
Copy link

gf3 commented Jan 6, 2012

@NuckChorris You just reinvented AppleScript.

@zachstronaut
Copy link

Learn JavaScript.

@aslilac
Copy link

aslilac commented Jan 6, 2012

Guys, holy fuck. I know how to program. I know !gossip is shorter/cleaner/whatever.

It was an example.

@jswartwood
Copy link

In JS !gossip === shorter/cleaner/whatever

@sirwan
Copy link

sirwan commented Jan 7, 2012

Coffee script is why programmers are disliked amongst our inter-disciplinary colleagues.

@sandywu
Copy link

sandywu commented Jan 7, 2012

-1

@yocontra
Copy link

yocontra commented Jan 7, 2012

9/10 A- would troll again!

@crux
Copy link

crux commented Jan 8, 2012

-1 no need for code hipsters fad

@CallToPower
Copy link

-1

1 similar comment
@iwege
Copy link

iwege commented Jan 9, 2012

-1

@xxoo
Copy link

xxoo commented Jan 11, 2012

awesome post

@rmoriz
Copy link

rmoriz commented Jan 11, 2012

does anyone remember PHP? they argued about backslashes as namespace separators. Bloody amateurs.

@eos87
Copy link

eos87 commented Jan 12, 2012

DRY!

-1

@canweriotnow
Copy link

This is almost as funny as that time @dhh switched Rails over to CoffeeScript by default.... only he wasn't trolling.

@Denommus
Copy link

@mjijackson I think that if you're not trolling and are being serious about that, you have all the liberty of forking node and make your own project in CoffeScript based on it.

@tj
Copy link

tj commented Jul 27, 2012

@Denommus it's a troll

@chjj
Copy link

chjj commented Jul 27, 2012

I still think we should have waited til april fools for this. I was disappointed when I saw it in january.

@billymoon
Copy link

js2Coffee (and back)

square = (x) -> x * x
var square;

square = function(x) {
  return x * x;
};
square = undefined
square = (x) ->
  x * x
var square;

square = void 0;

square = function(x) {
  return x * x;
};

etc...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet