Le redditlols imprinting wisdom on each other. I love how they bash PHP even though their comments obviously shows they know jack shit about the language. Every time I read these kind of shit I always close my eyes, imagine their collective faces and proceed to beat the living crap out of their asses.
Name:
Anonymous2012-09-17 0:11
>>2 Every time I read these kind of shit I always close my eyes, imagine their collective faces and proceed to dismember their collective asses with the super-human quickness of my sword-strokes.
``Making assignment and declaration two different "things" is a huge mistake. [...] As an existence proof, Ruby gets along just fine without it.'' -- jashkenas
``[...] I needed block local variables, so I made the
current local variable scoping rule, which is "when a new local
variable appears first in a block, it is valid only in the block".
And *I was wrong*. This rule is the single biggest design flaw in Ruby. You have to care about local variable name conflict, and you will have totally different result (without error) if they conflict.
So, we are talking about a part of many-year-long effort of fixing this flaw.'' -- matz
she speaks fluent Geek, Biz-speak, Cloud, SAPanese, VAR, BI/BA, Storage, Security, Agile, Networking, SEO and marketing. she spends her days translating these highly specialized languages into plain English.
It's almost as if JavaScript devs have Stockholm Syndrome, and it isn't enough to love their prison, they have to hate anyone who tries to leave the village. Almost? More like certain.
Name:
Anonymous2012-09-17 19:09
or because it's the only mainstream/useful language with truly first class lambdas. with shorter function expressions, and generators/lazy lists it would be perfect.
Name:
Anonymous2012-09-17 19:13
or because it's the only mainstream/useful language with truly first class lambdas.
>>26
Ok, let's play the game. Name a characteristic of first class functions that lua's form lacks and I will try to produce code that does it.
Name:
Anonymous2012-09-18 4:23
>>26
I've used Lua and it had first class functions from what I could tell. It has a lot in common with JavaScript and you can even do prototype based programming using its metables.
In programming language design, a first-class citizen (also object, entity, or value), in the context of a particular programming language, is an entity that can be constructed at run-time, passed as a parameter, returned from a subroutine, or assigned into a variable
do it
Name:
Anonymous2012-09-18 19:23
First-class functions are boring.
What everyone really needs is a language with first-class macros.
Name:
Anonymous2012-09-18 19:35
360 noscoping
Name:
Anonymous2012-09-18 22:39
>>34
U WOT M8
f = function(g)
return function(x)
return f(g(x))
end
end
Did I miss something?
Replacing JavaScript, CoffeeScript introduces a lot more problems than solves.
1. CoffeeScript has broken lexical scoping, which is unforgiving and leads to untraceable bugs, far worser than in JavaScript, because without variable shadowing, inner code could end up changing any outer variable by mistake, breaking referential transparency. In effect at any time you must remember names of all outer and inner variable. CoffeeScript arguably has the worst and most confusing scoping rules of all scripting languages, surpassing even Perl.
2. CoffeeScript is not a language, but a preprocessor for JavaScript. CoffeeScript doesn't introduce dramatic new ways to organize programs like continuations, promises, or monads. You don't "Think in CoffeeScript," you "Think in JavaScript", pre-processed JavaScript. CoffeeScript has a different syntax, but only in the most superficial way: if JavaScript was English, CoffeeScript wouldn't be another language like French, it would be technical jargon like the conversation one programmer might have with another. So you write @method() instead of this.method() - that's an obfuscated shorthand notation, not a language. CoffeeScript makes debugging harder: you still have to look into generated JavaScript, when something goes wrong, and auto-generated code is not something you want to see everyday.
3. Syntactic nightmare: FIOC or Forced Indentation of Code (aka offside rule) worsens already present JavaScript's automatic semicolon insertion, while the rest of the syntax becomes less orthogonal: for example, there are four versions of `if` - "if C then T else E", "T if C", "if C <newline> T <newline> else E", and "switch when C then T else E". CoffeeScript has set theoretic comprehension notation; it looks passable on the demo page, but in practice you will end up with something like this: "wash plate, brush, sink for key, plate of dishes when plate.dirty if meal.status is 'done'" - that is readable, but incomprehensible code.
4. JavaScript had just true and false, but CoffeeScript has true, yes, on, false, no, off. CoffeeScript also adds @ as an alias for this, and a special operator `in`. Traditional for badly designed languages, arithmetics on strings generates even more confusion: A + B # does this code works with numbers or strings?