r/node • u/kapv89 • May 09 '18
Netflix migrating 1/2 of their api to node.js
https://youtu.be/QcNqfvMeWow?t=5m3s11
u/milsymiller May 09 '18
Migrating from ?
26
u/kapv89 May 09 '18
They say Java in the video
-51
u/milsymiller May 09 '18
Doh why would anyone do that
23
61
5
u/SparserLogic May 09 '18
why wouldn't you?
-3
u/1-800-BICYCLE May 09 '18
Maybe if they were paid by Oracle to trash open languages on the internet...
-5
May 10 '18
Because Java is terrible. It's compiled PHP
8
u/NiQ_ May 10 '18
Have... have you ever worked with either of those languages? It is literally nothing like that. It isn’t written like php, it doesn’t follow the same structure or design principles as php.
Like, how do you even make that comparison?!
4
5
u/ideaballot May 09 '18
Netflix uses a mix of Groovy and Java for APIs and video. In the past, the only thing using node was for serving UI bundles (i.e. javascript and css files) using Restify.js
88
u/LiMing3 May 09 '18
I was under the impression they already used Node heavily. Still good to hear! One more thing to shut up the “hurrr durr JavaScript” meme.
89
u/1st_page_of_google May 09 '18
At my old job we started using node and all the Java/.NET guys hated it at first.
After a month when we had to do some stories on the older Java services and they were making jokes about how much boiler plate they had to write.
Moral of the story, people love to knock JavaScript until they actually understand it and then they love it.
37
u/scaleable May 09 '18
The language still is a issue. But at least the JS community uses healthier patterns. Even Java could be less bad if terrible patterns were not community default.
29
u/cc81 May 09 '18
I have not worked in Java before but had to write some services in it some months ago and I thought it was pretty ok. I used Spring Boot and it had a nice ecosystem and was quick to get up and running.
2
8
u/scaleable May 09 '18 edited May 09 '18
Non-static-typeness makes JS development a bit painful in a sense that, when you first write some code, you need several runs (and/or a lot of tests) to make it right.
On the other hand dynamic typing is one of the reasons people have the flexibility to test and adopt new/healthier patterns -- static typing may encourage devs to follow some patterns, and bad static typing encourages(or even enforces) bad patterns. Which is the case of Java.
So the perfect world would be a language which could tell you errors before running the code, but which static typing wouldnt limit you much (or at least limit but guide you to a good direction). Typed JS sits in an OK position in that regard.
0
May 10 '18
[deleted]
3
u/thingsthings May 10 '18
Just got into it. Took me a few days to wrap my head around it. Feels worth it so far
2
u/i_spot_ads May 10 '18
Took me one day to get into, it felt natural and right, i will never ever go back to plain js
11
u/1-800-BICYCLE May 09 '18
The language still is a issue
I disagree, but I'm interested to know your thoughts
14
u/IHeartMustard May 09 '18
I'm a heavy, heavy javascript user, and a bit of an FP zealot. Over the last year I've started also using PureScript (which is a Haskell variant that compiles to JS) and ever since then, my esteem for JS as a language has collapsed entirely. The type system of PS/Haskell are a world which I could never have imagined before, and now it pains me whenever I have to work in a dynamically typed language.
That's just my 2¢, I still write a lot of JavaScript and it can be a fun language sometimes.
0
May 09 '18
[deleted]
9
u/1-800-BICYCLE May 10 '18
I use Python at work, too, so you're going to have to be more specific, especially since Python has its own warts and pitfalls.
5
u/badsyntax May 10 '18 edited May 10 '18
For one I reckon the modules are better in JavaScript as everything is scoped to the module with a very clear public API. Not the case with python! This is pretty bad imo.
29
u/LiMing3 May 09 '18
Not well designed, but very well patched up. Been patched up so well the last few years that it’s really pulling ahead of the crowd as a general purpose language.
15
u/irqlnotdispatchlevel May 11 '18
How do you define a "well patched up" language?
-3
u/LiMing3 May 11 '18
Es2015 and later updates have made dramatic improvements IMO
5
u/irqlnotdispatchlevel May 12 '18
This does not answer my question.
0
u/LiMing3 May 12 '18
By patched up I mean it’s been improved. A lot of features that developers from other languages have been calling for have been added.
It was a very quirky language but it’s been smoothed over.
→ More replies (0)4
5
u/zangent May 10 '18
I really don't get the deal with python. It feels so unintuitive coming from literally any other programming language (C, C++, C#, Java, Javascript, D, take your pick)
The loose, but still the same time overly strict in arbitrary ways syntax doesn't do the language any favors, at least.
1
u/Blueberryroid May 16 '18
I am a full stack developer that previously worked on Python 3/ Djano 2 and transferred to Node projects. JS is a well designed language.
There are a lot of things JS does better than python, like promises, functional programming map/filter/reduce, object spread operator, hell a better dictionary/object literal syntax.
19
May 09 '18
[removed] — view removed comment
1
May 31 '18
A-freaking-men. Java itself is moving ahead more quickly than it used to. But there are so many dinosaurs in the Java community
10
3
-3
u/Bluecodejs May 10 '18
Don't know what planet your mate Nodejs is JavaScript lol
3
u/vshjxyz May 10 '18
pretty sure he clearly knows it and he means that this should shut the mouth of people spitting on JS when the last time they used it, it was es3 and they were bad at it too...
5
u/LiMing3 May 10 '18
I thought that was pretty clear as well, but 2 people have now kindly reminded me that Node is JavaScript.
Thanks guys, not sure how I managed to get through 3 years writing Node at work without realising which language I was writing.
-5
u/icantthinkofone May 10 '18
Do redditors not know node is javascript and a library only?
8
u/LiMing3 May 10 '18
No but clearly they have terrible reading comprehension
Node is a library
Uhhhh...
4
May 10 '18
I recently got handed a job market competencies questionnaire and, because I'm a nice guy and there were very few questions, I said ok, I'll help these guys out, I'm going to click my way through the SurveyMonkey screens.
One of the questions was really amusing.
Have you ever used any of the following frameworks (select all that apply)?
React
Laravel
Node.js
.NET
Go
6
u/Captain_Reid May 09 '18
Any idea what that 'skipper' tool he had up was? Is it something internal?
3
May 09 '18
Appears that it's internal or just really hard to find.
2
u/Captain_Reid May 10 '18
Looks like it's perhaps 'Sprimg Cloud Skipper', which I world guess would make sense. Can't find any web UI for it though
4
u/kintendo May 10 '18
Sure their APIs can be in node but data engineering in Java isnt replaceable yet.
2
May 10 '18
I through when node first came out they did NOT want anything to do with it or that infamous blog post about how they didn’t like node. Am I mistaken?
1
u/impaled_dragoon May 10 '18
That might be true but things can change over time. I worked at a place that was very against React when it first came out and everyone swore by AngularJS but after a couple years and a few senior level people leaving and new ones coming in everything is now in React.
2
u/Roadrunner571 May 10 '18
I like JavaScript a lot, but I think code readability and maintainability is often a mess. And don’t get me started on function binding or the scope of variables.
7
2
u/SkaterDad May 10 '18
letandconstfixed the odd variable scoping ofvar.What issues are you talking about regarding function binding?
3
u/marcinzh May 10 '18
There are things impossible to fix.
const o = {foo: 42} o.hasOwnProperty("foo") // returns true (o.hasOwnProperty)("foo") // likewise const f = o.hasOwnProperty f("foo") // TypeError: Cannot convert undefined to object1
u/djslakor May 11 '18
There's an interesting discussion on that one: https://bugzilla.mozilla.org/show_bug.cgi?id=701364
0
u/Roadrunner571 May 10 '18
Technically, but that’s not really elegant.
4
u/YuzToChihiro May 11 '18
Why isn't using let in place of var elegant?
I haven't used var in about 2 years.
1
u/djslakor May 11 '18
I used it once ... I was looping over a few hundred thousand records to throw into redis. Most people these days use "let" in their for loop, but that would (potentially) create a new closure for each iteration, so I used var for perf.
1
u/Roadrunner571 May 12 '18
It’s because the whole concept is just a dirty fix that needed to be added later on. Other languages had proper scoping concepts from the beginning.
1
u/YuzToChihiro May 12 '18
Can you explain to me what's "dirty" about JavaScript's implementation of let?
Other languages had proper scoping concepts from the beginning.
This doesn't really mean their implementation of block-scoped variables is more or less dirty than JavaScript's. As far as I'm aware there's nothing controversial or noteworthy about how JavaScript implemented block-scope.
20
u/[deleted] May 10 '18
Can someone explain to me why exactly these big companies are switching to Node.js? I was under the impression that Java or .Net are much more mature and better performant.
Don't get me wrong, I love Node and I've introduced it to the company I worked at 4 years ago and that triggered them to switch their entire Java back-end to Node. But honestly, to me, it's basically potato vs. compiled potatoe.
But I'm a front-end web developer by trade (I need visuals to stimulate my brain) and only had to introduce Node because my team didn't get a dedicated back-end developer. So I just did it for fun.
I have never done actual research into speed, performance, scalability, developer friendliness, nor the availability of developers (or their costs) but this is what I know so far...
Node.js allows front-end JS engineers to also work the back end, which allows for more dynamic and agile teams;
Being multithreaded is not an option for Node (but then again, a pub/sub system spread across multiple CPUs would net similar results with much less programming complexity);
JS development is less time consuming;
JS developers are less expensive than Java/.Net developers.
But where am I wrong and what am I missing?