nkohari / forge

a dependency injector for node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A conventional note

vmadman opened this issue · comments

First things first: I'm fairly certain that the existence of this framework will be controversial. The general sentiment is that in a loosely-typed, dynamic language like JavaScript, framework-aided dependency injection is unnecessary.

First, those people are dumb. There's nothing about Node or Javascript that makes DI any less applicable.

Second, CoffeeScript is to JavaScript as C++ is to Assembly. Although it compiles to Javascript... its not Javascript. This is an important distinction, I think... along the lines of ordering hot cocoa and receiving coffee.

They aren't dumb, they're just misguided. :)

Not sure what you're driving at with your second point. CoffeeScript is just a dialect; a more apt comparison is that CoffeeScript is to JavaScript as American English is to English. Forge is written in CoffeeScript, but doesn't require CoffeeScript to use -- the transpiled JavaScript is included in the npm package and in the repository:

https://github.com/nkohari/forge/tree/master/build

You lost me on the hot cocoa and coffee metaphor. Did you have a question about something?

They aren't dumb, they're just misguided. :)

Misguided would imply that they've only been presented with one side of the argument. Almost everyone has read about both sides.. and after consideration, they've arrived at the wrong conclusions. It's made worse by the fact that they take the time to argue such a point without any basis in fact. So, no, dumb is more appropriate... but if one wanted to be kind about it, "shallow" might work as well.

CoffeeScript is just a dialect; a more apt comparison is that CoffeeScript is to JavaScript as American English is to English.

I think it would be hard to fabricate a statement that is less accurate than that. My analogy used two programming languages being compiled into two others, you zoomed all the way out to human language. That's exactly backwards in any search for precision, I think.

First, the term "transpiled" is a trendy word, and I subscribe to it, but it is in fact just another form of "compiled". Even the few differences that exist are largely subjective. You take a source language that cannot be executed on its own, compile it into a target language that can be, and then you execute it.

Assembly is the result of compiling C++, and Javascript is the result of compiling Coffeescript. You can also, equally, execute assembly without C++ (see also: executable programs) but you cannot alter the program without knowing C++, or at least, it is substantially more difficult.

Likewise, C++ is not the only language that can be compiled into assembly.. which would relate directly to other transpiled languages, such as Typescript.

Dialects, on the other hand, are variations on the usage of a single language. For the most part, everything a British person says is valid (even if not necessarily proper) English, and vice versa, regardless of what country you live in. CoffeeScript has almost nothing in common with Javascript. Calling it a dialect would be at least very similar to calling PHP a dialect of Ruby.

Frameworks and, to a lesser degree, libraries, are more akin to dialect.

Twist it, turn it, rename it, whatever... CoffeeScript is not Javascript. I am a Javascript developer, and arguably an expert (to the extent that someone might call themselves that).. and I can't read or modify your Coffeescript, and no amount of reading in the MDN is going to get me any closer to being able to.

On the other hand, my American English dictionary would certainly help me to understand British slang, since they use the same words... only in different ways.

I have no problem with CoffeeScript, and I certainly have no right to command anything upon anyone. I only want to point out that, in as sincere of a way as I can, that a failure to recognize them as separate languages hurts both communities. The least of which is that you undoubtedly tend to prefer libraries written in CoffeeScript, since you like it better, and I tend to prefer libraries written in Javascript.. and yet we have to filter through an unpartitioned field.

I do not see how clarity and understanding could ever hurt.

Surely I have come across as being offensive in my original post (up there), and despite my obvious inability to communicate effectively, it was not my intention. I will graciously accept any advice on how I might have presented my argument less abrasively.

First, the term "transpiled" is a trendy word, and I subscribe to it, but it is in fact just another form of "compiled". Even the few differences that exist are largely subjective. You take a source language that cannot be executed on its own, compile it into a target language that can be, and then you execute it.

No, transpilation is the use of a source-to-source compiler, in which both the input and the output of the compilation process is source code. In constrast, the input of a traditional compiler is source code and the output is executable bytecode or machine language, depending on the platform. A transpiler is a specific kind of compiler; that is, a transpiler is a compiler, but a compiler is not a transpiler.

The output of both the CoffeeScript and TypeScript transpilers is human-readable JavaScript, not bytecode. The JavaScript must be (JIT) compiled again to execute it. In contrast, you could consider a derivative language like Groovy, whose compiler inputs Groovy source code and outputs JVM bytecode. Although Groovy shares some semantic similarities to Java, it is a compiled language.

Clarity in JavaScript suffers a bit because both JavaScript the ecosystem and JavaScript the language are called the same thing. However, it's very common for systems built using derivative languages be described as JavaScript. I will direct you to GitHub's own internal JavaScript styleguide, which describes... you guessed it, CoffeeScript.

I tend to be skeptical of anyone who self-describes as an expert in anything, but I would also suggest that if you don't recognize the similarities between JavaScript derivatives and JavaScript, you may fall a bit short of the "expert" moniker. I would recommend you also get some exposure to the alternative JavaScript languages, including CoffeeScript, as the work in ES6 was largely inspired by them.

Since you asked for feedback, I'll make the following suggestions:

  1. Don't post a GitHub issue for the sole purpose of ranting about semantics. Issues are for specific questions or bug reports. What you posted has very little bearing on the project and is a waste of my time. If you want to take this stand, write a blog post. Hell, if you do, feel free to send me the link, I'd be happy to read it and comment.
  2. If you're going to post an issue, don't open by calling people stupid. It adds nothing to the conversation and makes you look foolish.
  3. Don't self-describe as an expert in anything. The merits of your argument will define your stature in the eyes of those listening, regardless of the medals you award yourself.

In closing, I'll say: language wars can be appealing, because they're an easy way to "declare sides"... but they are (quite nearly) a complete waste of time. If you want to have a conversation as to the specific merits of JavaScript over CoffeeScript, or whatever, then there are other forums for that. Otherwise, just go build something, and use whatever language you want. In the time you spent writing these issues, you likely could have developed a good understanding of CoffeeScript.

From the README:

This is something I built to scratch my own itch, and have released it in the hopes that others will find it useful as well.

If the fact that Forge is written in CoffeeScript means you don't want to use it, then that's fine. It makes very little difference to me.

Clearly a command of the English language is not one of your gifts. I can't actually tell if you read what I wrote, or just guessed at it and started writing a rebuttal. I do actually put effort into choosing my words carefully to narrow my arguments with at least some level of precision and clearly I either chose the wrong words or you just don't know what they mean. It's pretty wild.

Like when I said:

First, the term "transpiled" is a trendy word, and I subscribe to it, but it is in fact just another form of "compiled"

then you said:

No, transpilation is the use of a source-to-source compiler

I'm not trying to do the wordplay thing here, the words do not matter, but its really hard to make any point when you make zero effort to even consider what I'm saying.

The point isn't about compilers and what they're compiled into... the point is that they are both compiled.

  • CoffeeScript is compiled into JavaScript, thus, it is not JavaScript.
  • .. nor do the differences between the two have any resemblance to dialects, they are no less different than English and Spanish
  • A JavaScript interpreter will fail with errors if you try to run CoffeeScript through it.
  • You'll likely reject any pull requests containing JavaScript and not CoffeeScript
  • .. thus, if I use your library, I either cannot modify it at all, I must learn CoffeeScript, or I'd never be able to merge back into your library

The statements I made are logical, accurate, and in my view, correct.. and you refuse to even acknowledge them. Instead of addressing my points you just select random sentences and start ranting. In fact, you seem to just select single words!

and arguably an expert (to the extent that someone might call themselves that)..

I literally have two disclaimers surrounding my usage of expert. First, I said its "arguable"..

adj. open to disagreement; not obviously correct

.. and then I even wrote a note there for you as a way to reduce my usage of expert to within the scope that one person can understand and/or claim his or her own skill level.

You just grabbed the word "expert" and ran with it..

I tend to be skeptical of anyone who self-describes as an expert in anything .. you may fall a bit short of the "expert" moniker ... Don't self-describe as an expert in anything .. regardless of the medals you award yourself.

So, how does someone respond to that? Everything you said is ignorant, presumptuous, out of context and completely ignores the care I placed in my choice of words. It reminds me of those guys who hang out in bars looking for a fight..

"did you just push me?",
"oh, I'm sorry sir, I.." ..
"I ain't ch'ur SIR buddy.. thems fightin' words!".

(Considering that you couldn't wrap your head around my coffee and hot cocoa reference, my guess is that you don't understand that analogy either, right?)


The merits of your argument will define your stature in the eyes of those listening

Just.. oh my god what a stupid thing to say.

  • My argument has nothing to do with JavaScript proficiency, so no... my argument is not likely to contribute to my stature as a JS developer
  • That logic only holds up when the two people interact with one another outside of the narrow context of this issue thread.
  • My skill level was being used as a means of illustrating a point in which my skill level is relevant. No matter how I would choose to word it, you could come back exactly as you did.
  • Whether or not I am an expert, whether or not I am a complete drooling retard is irrelevant... the point is, any JavaScript expert would not automatically be able to write CoffeeScript.. to almost any degree
  • My original posting didn't include any usage of expert, which was the one I was clearly referring to since it was what first triggered your defensive response.

but I would also suggest that if you don't recognize the similarities between JavaScript derivatives and JavaScript..

Wait, so... is it a derivative of JavaScript, or is it JavaScript? I thought we were comparing two JavaScript dialects..

sum = (a,b) -> a + b
sum = function(a,b) {
   return a+b;
}

Of course! The similarities are so obvious now!

CSS transpilers such as LESS, SaSS, and Stylus never once refer to themselves as CSS. Even JavaScript "derivatives" like TypeScript are at least somewhat better about making the distinction.


If you're going to post an issue, don't open by calling people stupid.

Never called you stupid. You take offense just because the option to do so was available and its convenient to your argument... but you knew that.

Don't post a GitHub issue for the sole purpose of ranting about semantics.

I argued that true and tangible harm comes from the ambiguity, my point had little to do with semantics.

Issues are for specific questions or bug reports.

Curious that they would choose such a broad word like "issues" to mean something so specific.

What you posted has very little bearing on the project and is a waste of my time.

.. in your opinion.

If you want to have a conversation as to the specific merits of JavaScript over CoffeeScript..

I don't.. and, once again, I explicitly stated that, only to be ignored:

I have no problem with CoffeeScript

Clarity in JavaScript suffers a bit because both JavaScript the ecosystem and JavaScript the language are called the same thing. However, it's very common for systems built using derivative languages be described as JavaScript. I will direct you to GitHub's own internal JavaScript styleguide, which describes... you guessed it, CoffeeScript.

This is the only thing relevant to my point that you've actually said and, in fact, it is my point precisely. "Clarity in JavaScript suffers.." -- exactly, bingo... point made.

Now, why does it matter how common it is? Is right and wrong dictated solely by the majority?

Lots of white people used to think that black people are inferior, same with women, and also that the Sun orbited the Earth. Even people at the highest level of governments thought these things. What does that have to do with whether or not its right or wrong? Nothing.

Anyway, this turned into a fight because you wanted it to. My main point is correct and you even agree with it. You just place more value in being infallible than you do in discussing truths.

So, carry on... whatever...

When I shared my response to you with others, some people encouraged me not to feed the trolls. Clearly, I should have listened to them. This conversation does not belong on the issues of this project, and I'm not interested in continuing it. Please go somewhere else and waste someone else's time.