Live data from Hacker News

Yahoo Mail moving to React

slideshare.net

291–300 of 301 posts

Re: Yahoo Mail moving to React

#291

Earlier quoted context omitted.

If you write very modular code with good test coverage, the odds of you needing to fire up a debugger are greatly reduced. Regardless of the language you choose. Given JS has first-class functions, and many libraries to follow functional patterns. You can write very stable code, with almost no chance of side effects within a given function/context.

The problem is, that not everyone works on greenfield applications all the time. I never inherited modular, well tested javascript projects. I did, on the other hand, have to take over cobbled together jQuery, Backbone and Coffeescript applications.

I think the real problem is that this has nothing to do with the article on hand.

Yahoo is writing a greenfield application, and they are avoiding exactly those problems by using React. So, literally your pain point is exactly what they are writing about avoiding, and yet you still comment on this article with the same anti-JS nonsense.

Re: Yahoo Mail moving to React

#292
post #251

Earlier quoted context omitted.

Flow isn't mature enough yet, but even TypeScript eliminates pretty much the entire Wat talk. Also, it compiles to CommonJS, which means it works well with both node and browserify. Yes, we need a blessed, "batteries included" stack for JS made of components that play nicely together. Here is a nice list to get started with (IMO, ymmv) 1. TypeScript or Flow 2. React 3. Promises: bluebird, when or p-promise 4. Observa…

Going to make a few points of contention... 1. Not a problem, though I don't use either, I tend to use very small modules (not necessarily via npm, but require'd in my own project, or outside modules) 2. React, and even the Yahoo flux tools are pretty nice. React by itself is less useful. 3. I'd go with es6-promise here, which complies with the spec. I wrote i-promise as a module to give an ES6 compatible promise lib…

I also agree with just about everything here, and thanks for the tip on es6-promise. I'll have to check it out.

I actually have this entire stack running without observables currently, and my goal is to build a variety of applications using it to really sort out the best techniques with it, and then open source it as a platform.

As for #7. I use webpack and love it. It does work wonderfully server side as well, you just have a build step with webpack that strips out anything you don't want for the server, and then have your server run that built file. Not perfect, but works well. It also avoids any need for gulp.

Re: Yahoo Mail moving to React

#293

Earlier quoted context omitted.

See, this confuses me. From working with Node and understanding its core architectural concept, the single event loop, I find Node's worst use case to be front end development. Server side rendering takes time, even 10 ms. On an single event loop, that is terrible. You can only server 100 request/second due to the 10 ms limit. While it is nice that you can move a request into the backing queue while waiting for the d…

Well, Node has clustering, and there is probably some nifty load-balancer that works with Nginx and Node. http://nodejs.org/api/cluster.html

Nginx is a very primitive load balancer. Use haproxy.

Re: Yahoo Mail moving to React

#294
post #257

Earlier quoted context omitted.

So it's not an objective comparison because the V8 implementation performs well? :-)

No, it's not an objective comparison because that's not the kind of code that we deal with in 90% of the cases, except when doing games, but then again plain Javascript is shitty for doing games, unless you develop in a strict subset that isn't meant for humans.

Even if it were "not the kind of code that you deal with in 90% of the cases" that would not mean it "was not an objective comparison".

It might mean it wasn't a relevant comparison for you; but if those 10% of cases were performance critical it would be very relevant.

Re: Yahoo Mail moving to React

#295

Earlier quoted context omitted.

I'm not sure why you consider the JavaScript ecosystem unstable ? JS has: - awesome dependency management systems like NPM and Bower - awesome task runners like Grunt and Gulp - NPM has thousands of plugins, more than Java's Maven and Ruby Gems [1] - Github badge support for builds, test coverage, dependency versions and NPM - Close second best StackOverflow support behind Java (without taking into account Node.js) […

I will not take the # of NPM vs Java Maven as is. Keep in mind that Java SE (API) is way more complete than NodeJS basic APIs. Also keep in mind that in Java, most people have 1-2 choices at most and those choices tend to be way more mature and stable so we tend to feel comfortable with those (at most) choices. You can slice and dice my analysis anyway you want. You can say lack of choices is bad and millions of Java…

> Yes, there are Ant and Gradle

...and Leinengen and SBT and perhaps a build tool for every other JVM language...

> but let's be honest, Maven is king whether you like it or not

Maven would do well to offer an alternative CSS/Gradle-like syntax (if doesn't already) because XML is still hard to read.

Re: Yahoo Mail moving to React

#296

Earlier quoted context omitted.

Disagree. It seems half the industry is moving to node in NYC. All the major publishers (NYC tech's bread and butter) are using it or switching to it.

That's great and all but there are a million and one wordpress blogs or PHP CMS systems that exist outside of bleeding edge startups in NYC and SF. Also try talking about node on proggit, you'll get mocked and told how dumb and shitty it is.

My point though, is I'm not referring to "bleeding edge startups." I'm talking about almost every major publisher here Conde Nast, Hearst, Wenner Media, Gawker, the list goes on and on. These are massive old and new media publishers that are embracing node, not startups in the valley.

Node is at a tipping point right now, and talking about how "dumb and shitty" it is won't change that. The technology has shortcomings no doubt, but there's just too many advantages to it from the business strategy side for the shortcomings to matter.

Re: Yahoo Mail moving to React

#297
post #177

Earlier quoted context omitted.

Those are in Java now. Always have been, really, with a lot of boilerplate.

No, they aren't. The only thing "first-class" in Java is classes. They added lambda expressions in Java 8 but they still must be defined inside of a class method. It is still illegal to define a function outside of a class in Java. And Java methods are still not lexical closures; there are some tricks you can do to sort-of emulate this but closures are not a language feature.

> The only thing "first-class" in Java is classes.

And lo and behold, they have decided that an anonymous class with only one method is equivalent to an anonymous function object, and given us syntactic sugar to invoke it without the class declaration boilerplate.

You're essentially doing the same as complaining that conditionals aren't a Smalltalk language feature.

Re: Yahoo Mail moving to React

#298
post #177

Earlier quoted context omitted.

No, they aren't. The only thing "first-class" in Java is classes. They added lambda expressions in Java 8 but they still must be defined inside of a class method. It is still illegal to define a function outside of a class in Java. And Java methods are still not lexical closures; there are some tricks you can do to sort-of emulate this but closures are not a language feature.

> The only thing "first-class" in Java is classes. And lo and behold, they have decided that an anonymous class with only one method is equivalent to an anonymous function object, and given us syntactic sugar to invoke it without the class declaration boilerplate. You're essentially doing the same as complaining that conditionals aren't a Smalltalk language feature.

An anonymous inner class with only one method. The "inner" is important. It still has to exist inside of an explicitly declared class. Also, a variable holding a reference to a lambda function cannot be called as a function (no function pointers).

Contrast with JavaScript, where functions are first-class, can be declared at top level, can be passed as arguments to and returned by other functions, can be called by dereferencing a variable, can be nested, can be partially applied, etc.

The minimal syntactic sugar for anonymous inner classes added in Java 8 doesn't even begin to approach the power of the function support in languages like JavaScript. Language-level support for this stuff matters.

Re: Yahoo Mail moving to React

#299
post #298

Earlier quoted context omitted.

> The only thing "first-class" in Java is classes. And lo and behold, they have decided that an anonymous class with only one method is equivalent to an anonymous function object, and given us syntactic sugar to invoke it without the class declaration boilerplate. You're essentially doing the same as complaining that conditionals aren't a Smalltalk language feature.

An anonymous inner class with only one method. The "inner" is important. It still has to exist inside of an explicitly declared class. Also, a variable holding a reference to a lambda function cannot be called as a function (no function pointers). Contrast with JavaScript, where functions are first-class, can be declared at top level, can be passed as arguments to and returned by other functions, can be called by der…

They have exactly the same "power," they're just spelled differently. "func()" doesn't let you do anything that you can't do with "callable.call()". It's trivial to do everything that isn't syntactic sugar (for example, partial application, passing as arguments for abstraction) that you mention in Java, if a bit tedious (and often pointless, since the standard APIs generally weren't designed with that in mind.) _A Little Java, A Few Patterns_ came out in 1998; give it a read.

Re: Yahoo Mail moving to React

#300
post #298

Earlier quoted context omitted.

An anonymous inner class with only one method. The "inner" is important. It still has to exist inside of an explicitly declared class. Also, a variable holding a reference to a lambda function cannot be called as a function (no function pointers). Contrast with JavaScript, where functions are first-class, can be declared at top level, can be passed as arguments to and returned by other functions, can be called by der…

They have exactly the same "power," they're just spelled differently. "func()" doesn't let you do anything that you can't do with "callable.call()". It's trivial to do everything that isn't syntactic sugar (for example, partial application, passing as arguments for abstraction) that you mention in Java, if a bit tedious (and often pointless, since the standard APIs generally weren't designed with that in mind.) _A Li…

The fact you put the word "power" in scare quotes indicates to me that you don't understand what it means in this context. Here, have a pg essay: http://www.paulgraham.com/power.html
Post reply on HN