Live data from Hacker News

About PayPal's Node vs Java “fight”

developer-blog.cloudbees.com

181–190 of 216 posts

Re: About PayPal's Node vs Java “fight”

#181

Earlier quoted context omitted.

Except that between the two, only the JVM is truly cross platform, Mono notwithstanding.

Really? How can I use JVM on iOS? Is there a good toolchain for Java -> native iOS?

Besides RoboVM [1], there are also other solutions, like Codename One [2] that's based on XMLVM [3], or Avian [4] which is a new and very promising lightweight VM that can also compile code to native. And there's also J2ObcC [5] a compiler that's being developed and used by Google to share code between Android and iOS.

You know, Java can be many things, but you can't beat its ecosystem ;-)

[1] http://www.robovm.org/

[2] http://www.codenameone.com/

[3] http://xmlvm.org/overview/

[4] http://oss.readytalk.com/avian/

[5] http://code.google.com/p/j2objc/

Re: About PayPal's Node vs Java “fight”

#182
post #5

Well-reasoned. I've always found framework overhead and especially tech debt to be the largest contributors to performance issues. Especially when said frameworks have lots of ways to do things and they're not all the best way to do it. Modern JVM development starts to look a lot like Sinatra -- you don't get a lot baked in, but you probably didn't need it anyways.

The biggest contributor to performance issues these days, from what I've seen, is synchronous code. The JVM can be blindingly fast at running your code, but when it hits a point where you make a database call or web services call that's implemented synchronously, it sits there, waiting, doing nothing. No amount of VM optimizations can increase of the speed of idling code. This is why Node apps often out-perform Java…

> Node is pervasively asynchronous

Personally I view that as a drawback. It's all fine, until you end up with CPU-bound tasks or until you end up talking with backend servers that don't support many concurrent requests.

The JVM support for multi-threading is absolutely stellar. You've got true 1:1 kernel-level threading, with no GILs and you've got access to the best primitives available for dealing with multi-threading issues, atomic references, re-entrant read-write locks, fork-join thread-pools, non-blocking data-structures, asynchronous I/O guaranteed to work well cross-platform, all of them backed by a guaranteed memory model that also works well cross-platform, plus garbage-collectors that are the most advanced garbage collectors in mainstream usage. G1/CMS are amazing for servers and if you've got cash to spend, Azure's pauseless GC is probably as close to real-time as you can get with a GC.

And on top of these you can build whatever concurrency handling architecture you want. Including Erlang-style Actors (e.g. Quasar, Akka), STM (Clojure, Scala-STM), persistent data-structures (Clojure, Scala), asynchronous streams (Play2's Iteratees, RxJava Observables, Scalaz Machines, Scalaz Streams).

Even when speaking of Node.js's strengths, like asynchronous I/O, I still think Java is better because of the foundations (e.g. NIO, Netty, Mina). The only reason people don't work much with asynchronous workflows is because the language is so freaking painful for that. But that will change with Java 8 and people are doing wonders in Scala/Clojure.

I've personally built an entire web-service, designed to handle thousands of requests per second per frontend instance, with responses generated in under 30ms, with a completely asynchronous workflow, on top of Scala/Akka/Play2. Node.js people don't know what they are missing.

Re: About PayPal's Node vs Java “fight”

#183

Earlier quoted context omitted.

"You've basically described C#" Unfortunately the CLR doesn't run on any useful platforms.

Like Linux or Mac? http://www.mono-project.com/

Sure, you can run command line c# apps just fine but the web hosting solutions for c# web apps are terrible compared to IIS + Windows.

And this is coming from a linux veteran who wrote a C# web app and hosted it in production on Linux for a few months and then had to re-write it in .NET MVC hosted on IIS. I hate Windows servers. Every time I have to RDP into them to change some configs instead of just vi'ing files in /etc I want to shoot myself.

Re: About PayPal's Node vs Java “fight”

#184

Earlier quoted context omitted.

You've basically described C#: Getters, setters fixed? Check. Functional features? Check. Most crappy OO features fixed? Check. Trendy package system inspired by npm/apt-get/gems? Check. Healthy community with libraries replacing frameworks? Check. I'd recommend checking it out if you haven't already.

Has the Mono story gotten better? How feasible is it to develop without thousands of dollars of Microsoft software these days?

For command line apps they're fine. For web apps you still need to host them on Windows + IIS since the Linux+Mono c# web hosting is awful.

Re: About PayPal's Node vs Java “fight”

#185

Earlier quoted context omitted.

C# is Java with perhaps 200% syntax improvement. The things I use most often with e.g. Ruby - monadic collection operations like map, select, etc. - is there in the form of Linq, with select, where, etc. A concise, type-inferred lambda expression goes a long, long way. The .net ecosystem isn't as evolved as Java, for sure. But I don't think maven is a good implementation of a dependency management system either, nor…

I still don't see any C# developers that are 200% more productive than Java developers due to limited infrastructure around the C# ecosystems. Say anything about Maven but the recent discussion about embedding Bundler to Gem is just one step closer to be like Maven (now if they merged Rake+Gem+Bundler then Maven is). Even if Maven is not "good enough", .NET is thousand miles behind Java when it comes to dependency ma…

Huh? C#'s had Nuget quite a while ago now.

Why are Java developers always like 5 years behind on C# improvements?

And build systems are something g you set up one afternoon, why are you so fixated on a tiny part of the programming process?

Re: About PayPal's Node vs Java “fight”

#186
post #154
post #146

Earlier quoted context omitted.

Any language today that still requires to mark end of line with a semi colon, has in my opinion outdated syntax. Most people put one statement per line, so why is it required and not optional?

What about the counter case of one statement needing more than one line?

1) Line length is arbitrary, and there is no finite limit 2) You can have an escape sequence for a new line

With that said, I disagree that having to mark the end of a statement with a semi-colon is obsolete syntax. Statements and lines should not have to be 1-to-1, even if most code is written as such.

Re: About PayPal's Node vs Java “fight”

#187

Earlier quoted context omitted.

You've basically described C#: Getters, setters fixed? Check. Functional features? Check. Most crappy OO features fixed? Check. Trendy package system inspired by npm/apt-get/gems? Check. Healthy community with libraries replacing frameworks? Check. I'd recommend checking it out if you haven't already.

Your package system is inspired by Maven, minus a good build system and other functionalities. Try building a large C# projects with running unit-tests, integration-tests, packaging, code-coverage, code style baked into it, and a bunch of other plugins for your build systems without pulling your hair. Your DateTime library ain't there yet sir so you're pretty much at the same situation with Java (although both ecosys…

What? We do all those things and have hardly a problem. What ci / build server do you use?

Re: About PayPal's Node vs Java “fight”

#188

Earlier quoted context omitted.

The "libraries over frameworks" notion is something I keep noticing in communities that seem to be more engineering-minded than rock-star-ninja-dev-minded. Where do you think this comes from? I think it's a mix of maturity on the part of the community members along with how often the language is used to do things that are harder than CRUD.

In my case, I'm speaking of a reaction to Spring and Struts. I personally use Grails on my recent projects, which is as close to batteries-included as it gets, but I occasionally have problems with square peg round hole problems, and fighting against a framework is more painful than a library. The problem with the framework is that we run into a steep hill when we must diverge off the path. A good framework gives a g…

Do you know of any shops that use Uncle Bob's approach (besides 8th Light, of course)? I don't; I wish I did. I agree that isn't something you'd use every time, but I feel there isn't a whole lot of data out there when people have used it. All I see online are devs whining about the extra work.

I don't know what it is about the web, but it's as if we decided all of software architecture didn't mean anything and threw it out. My theory: it's harder to feel coupling in a dynamic language, thus it's just an academic concern!

Re: About PayPal's Node vs Java “fight”

#189

Earlier quoted context omitted.

C# is Java with perhaps 200% syntax improvement. The things I use most often with e.g. Ruby - monadic collection operations like map, select, etc. - is there in the form of Linq, with select, where, etc. A concise, type-inferred lambda expression goes a long, long way. The .net ecosystem isn't as evolved as Java, for sure. But I don't think maven is a good implementation of a dependency management system either, nor…

>monadic collection operations like map, select, etc There is nothing 'monadic' about select. SelectMany yes, but not Select. That's equivalent to map in other languages.

Sure there is! Monads generate liftM, so if you live in a place so bereft of explicit semantics as to call major parts of your standard library "monadic" without specifying which monadic context to which you refer... Then you may as well drag functor and Applicative along with you.

The weakening of the concept is inevitable now that everyone has been taught to not be afraid of it even if they have no clue why it exists.

Re: About PayPal's Node vs Java “fight”

#190
post #15

Earlier quoted context omitted.

> Language choice is no where near as important as your DB-access patterns (and more generally DB performance, caching, etc). i'm pretty sure the paypal node app does not directly access the db , the node app talks to a private api.

That doesn't really change the point, it just wraps it with a layer of abstraction.

Well, it adds another opportunity for a chatty API to add latency.
Post reply on HN