Skip to content
This repository
Browse code

Mention that sockjs-node is written in CoffeeScript.

  • Loading branch information...
commit 7f5e7df67799c3ce9f0db71c9705d21d21656389 1 parent a476ca2
Marek majek authored

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. +2 1  README.md
3  README.md
Source Rendered
@@ -9,7 +9,8 @@ SockJS-node server
9 9 ==================
10 10
11 11 SockJS-node is a Node.js server side counterpart of
12   -[SockJS-client browser library](https://github.com/sockjs/sockjs-client).
  12 +[SockJS-client browser library](https://github.com/sockjs/sockjs-client)
  13 +written in CoffeeScript.
13 14
14 15 To install `sockjs-node` run:
15 16

8 comments on commit 7f5e7df

Mariusz Nowak

Majek, just wondering, why it's written in CoffeeScript ?
I wanted to use it, but this fact is a big stopper for me (and I believe many JS programmers). I'm not into CS, and I'd like to work with readable JS code.

ludicast

To put in my $0.02 -

I'd argue that both CS and JS are very readable. Since we are entering a point that about 1/4 of JS libraries are written in CS (my estimate, not actual statistic), knowing both is becoming essential.

Because of Rails, I have transitioned to CS myself. However the times when I need to read/edit JS it is always easy to drop down to it. I am not geting into any religious wars but I will say this in favor of CS:

Code written in it is about 1/3 shorter than corresponding JS code. Since all code has bugs, less code means less bugs.

Marek
Owner

I don't mind neither CS nor JS. In fact, the sockjs-client is written in pure JS.

But the server side - it doesn't really matter. It's always going to be executed on node, so whether it's written in JS or CS - no difference. I choose CS for:

  • the code is shorter
  • the code is easier to maintain
  • CS has simple inheritance (including super keyword) which is exactly what I need, I don't like to reinvent that.
  • CS has some features that encourage good programming style (like bind, unpack, simpler function declarations), which is what I need.

CS has some disadvantages, but as I said before, it's always going to be run on node, and I ship compiled javascript in npm. So unless you're going to hack on sockjs-node (in which case you will have bigger problems - you would need to understand my code), you shouldn't really notice that it's CS.

Mariusz Nowak

@majek,

Problem is, that investigating bugs in such code is much more difficult for those who are not into CS, so naturally you are limiting users and supporters of your tool.
If I decide to use it, but something will not run as I expect then instead of trying to figure out what is the cause I will just abandon the tool, and I'm speaking generally in name of all JS programmers not writing CS.

Michael Bridgen
Owner

@medikoo Maybe instead of insisting things be rewritten into JavaScript, you could learn CoffeeScript?
I realise this rhetorical question does not generalise. But CoffeeScript is not far from JavaScript, and a better-designed language.

Mariusz Nowak

@squaremo CS is not language on it's own, to use it well you need to also know JS, it's just sugar that allows some programmers to be more productive with JS, that's it. If you write something that you want to be used by other JS programmers, it's better if it's written directly in JS.

I'm also not insisting on rewrite, I was just surprised by this decision and wanted to know the reason.

ludicast

@medikoo -

No to nitpick, but CS definitely is a language, it just gets translated into JS. There is nothing stopping someone from compiling it to machine code, running it on the JVM, or whatever, the same as any other language. It's just that the interpretation pipeline works well enough that this is what guys stick with.

Coffeescript is fast becoming a need-to-know language in the JS world. Play with it for an hour, that is all that needs to be done to pick it up. I have yet to find a good programmer who played with coffeescript and did not instantly prefer it. Sam Stephenson, creator of Prototype says that thanks to CS he never has to write another line of JS. And Brenden Eichs is taking influence from CS for the next version of JS. True story.

I'm not going to argue whether coffeescript is a better language (it is, by far and away). But at its heart it adheres to JS semantics and is easy enough to debug (I know because I've written shitty code myself that I've had to debug :)).

Michael Bridgen
Owner

@medikoo I don't want to pile it on, but I will say -- I'm surprised that you're surprised ..

Please sign in to comment.
Something went wrong with that request. Please try again.