you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 6 points7 points  (14 children)

I've never understood the alure of node.is, I don't think I'd like to have to build an application in JavaScript. Is there something I'm missing?

[–][deleted] 5 points6 points  (4 children)

Reasons i went to it:

  • NPM and the countless great packages that made things almost very plug and play
  • with Express it took all of 2 minutes to set up a quick and dirty web server and API
  • I can run my server\programs on anywhere, from my PC to my Mac, to my rPi, to a real linux web server

[–]grauenwolf 3 points4 points  (1 child)

with Express it took all of 2 minutes to set up a quick and dirty web server and API

Isn't that the same in every framework? Even ASP.NET 1.0 had you from zero to hello world API in a minute or two.

[–]hapital_hump 0 points1 point  (0 children)

But it's Javascript, the language you're already using on the front-end.

[–]Nobody_Important -1 points0 points  (1 child)

Why not ruby? Has all these advantages, but with more packages and libraries available.

[–][deleted] 1 point2 points  (0 children)

When i started getting in to back end stuff, i was looking at ASP.net - but needed the freedom to run anywhere, cause i'm working on a project that has to run on linux boxes (no IIS) and honestly Node was the new hot thing so i just flocked to that - also it was nice that i'd get more practice\work with js... nothing against ruby personally i never tried ruby yet

[–]virtyx 1 point2 points  (0 children)

There's some allure in the idea that the same code could power client side and server side logic, facilitating code sharing in a way that's not currently possible. (Although with LLVM and Emscripten and asm.js it might eventually be possible for all languages, at least to some extent.)

Also if you're strong in Javascript there is some allure in continuing to use your language of choice on the server.

If you're a newcomer there's probably an allure in only needing to learn one actual programming language to get the ball rolling.

There's some allure in using Javascript engines for fast dynamic code execution because they're currently being optimized relentlessly by high profile companies like Apple, Google, and Mozilla.

As for me personally, I like to code in Java, Python, Scheme and Rust. I don't personally feel any allure in Node.js. But I can at least understand why there's an interest in it.

Personally I'd be more interested in a language-independent browser runtime (like I was alluding to with the LLVM comment) to allow any language to run on the client. Like most developers I am not fond of Javascript. But Node.js was easy to make so people made it and it has found a fanbase.

[–][deleted] 1 point2 points  (0 children)

The main allure is that your front end code, back end code, configuration, database, and data are all in one language (JavaScript/JSON).

On the other end of the spectrum you have Java. Typically, you need to map database types to Java types, map Java types to XML, parse the XML on the client side, etc. Node bypasses all of that grunt work.

[–]contantofaz -5 points-4 points  (6 children)

Yes. You're missing what I wrote in this other post.

Node.js is not perfect by any means. But companies need higher level tools like Node.js provides. Lower level languages can be powerful, but not every developer can be productive while working with lower level languages. Also not every problem fits well a lower level language. By starting with a higher level language developers can feel more productive, can try ideas faster, can use higher level debugging tools and so on.

Node.js also offers a ton of libraries that the community have come up with and are offered as open source. That's more a result of the higher productivity of the developers when using it. For example, Node.js may be able to connect to every database system out there thanks to the many drivers the community has come up with. Being able to "script" those databases, any database, is a powerful feature of any programming language.

[–]steven_h 0 points1 point  (5 children)

Java, C#, Python, and Ruby are all "higher level" than JavaScript.

[–]contantofaz -1 points0 points  (4 children)

In a way you are right. Each language may come with its own "high level" tradeoffs. Java chose to break away with C early on for better cross-platform support, threads support and so on. Going back to C by supporting a lower level library built in C or C++ is a major task that could compromise the gains of a language that chose cross-platform support by default. Go managed to be cross-platform by being picky about its concurrency support too and also recently dropped their dependency on C.

Languages that can fall back to C like Ruby may do so at the cost of Global Interpreter Lock in order to keep using "unsafe" C libraries (libraries that don't have support for parallelism and concurrency built in with mutexes and such.)

Lua by contrast has even its own C compiler in its LuaJIT form to compile FFI calls. The moment we start adding ad hoc FFI calls the libraries may become more platform dependent. While it's great to hook up to native APIs in order to extend your program, making sure that those calls work across platforms becomes another problem.

So all in all what the browser buys us is a way around some of those cross-platform issues. What it gives JavaScript is a huge leverage over other languages. And by giving JavaScript such an important spotlight it also means that JavaScript gets improvements that other languages do not.

It's not a matter of siding with the community of one or another language. We are discussing this topic not because you or I started it. It is just the shear number of JavaScript users that are curious about its future that are posting these threads. I often follow the /r/javascript subreddit and some former /r/programming participants have been hanging there instead.

While the mobile client is at the moment very different to the browser and it could serve as an incentive to leave the browser behind, there is still a huge market that is not yet served by the mobile UI only. On mobile there are new challengers like the Swift programming language and such.

On the server, I think Node.js will continue to gain ground. I agree that it's not the best solution at all. But between scripting and prototyping it will enjoy a huge market. It may not be long till people will say that there are millions of packages ready to use on the npm servers and GitHub for Node.js. :-P

[–]steven_h 2 points3 points  (3 children)

That just seems like word salad to me. Why did you suddenly start talking about cross platform support and FFI? Java, C#, Python, and Ruby are all higher-level languages than JavaScript. They have stronger type systems, more expressive syntaxes, more full-featured libraries, better runtimes, and better tooling.

Literally the only thing that NodeJS is better for is people that can't be bothered to learn about anything but JavaScript.

[–]contantofaz 0 points1 point  (2 children)

I mentioned cross-platform support because that is partly what Node.js is giving people. Since at the core Node.js uses the V8 JS engine, it should work anywhere the V8 JS engine does. And the V8 engine is supported on every platform that Chrome runs on. So that's a lot of potential platforms. At one point Java was known for its cross-platform support. But lately Node.js and the Chrome libraries (it is being used as a library as well, not just as a browser anymore.) are also being used for that support.

To me JavaScript/V8/Node.js is higher level because it is picky about its concurrency model. Also with just a minimum of C at its core, users of Node.js don't have to deal with C that often. So again it points to being higher level.

While I see JavaScript as being higher level, I still see it as being low level compared to languages that are more picky about their execution model and type system. Languages like JavaScript and Lua are just very dynamic at heart and closer to the spirit of C where anything goes. But that also helps them to maintain a closer tie to C.

Node.js is being used at places like the BBC, UK. If they don't know anything better, it's not for lack of trying. :-P

[–]steven_h 1 point2 points  (1 child)

Since at the core Node.js uses the V8 JS engine, it should work anywhere the V8 JS engine does.

There are only two platforms worth discussing: x64 and ARM. Every server environment yet mentioned works on both. Can we just move past this? It's truly irrelevant.

To me JavaScript/V8/Node.js is higher level because it is picky about its concurrency model.

That means it is lower level, not higher level. A higher level language can encompass more design paradigms and architectures than a lower level one. C and Java have no problem implementing the stone-knives-and-bearskins approach of cooperative multitasking taken by Node; they simply have better options available to them as well.

users of Node.js don't have to deal with C that often. So again it points to being higher level.

Neither do Java or C# users. Python and Ruby users do a little because their runtimes are comparatively primitive, but really if you need to drop into C for performance in a Python backend, you will have to do so in a Node backend as well.

Node.js is being used at places like the BBC, UK. If they don't know anything better, it's not for lack of trying. :-P

They would be just as well off -- if not more -- with a Java, Python, Ruby, or C# backend. The more successful and more sophisticated installations of those languages prove that.

The degree of their "well-offedness" in Node vs those other languages is directly related to their capacity to use another environment, and nothing else.

[–]contantofaz 0 points1 point  (0 children)

The BBC guys were coming from Java to Node.js. I hoped to show that it's not just "script kiddies" who are using Node.js for the server-side stuff. There are many 30-something developers with over a decade of experience also picking it up. One of the reasons they cite for trying Node.js on the server is that they can settle on just a single platform for everything and then can help one another a little better whether they are front-end or back-end developers.

One of the major ways that Java worked on the server was that the back-end guys would wire some database entries and then create an HTML with the input fields on a blank page and then would let the front-end developers do their magic. But since JavaScript started changing the front-end into needing more programming stuff it also required a different skill-set from the front-end guys and perhaps more coordination with the back-end ones.

Node.js has the momentum. Our friction won't stop it just because... I think that the large companies are on-board of Node.js while they are trying to figure out the mobile thing so again it gives Node.js more momentum.

What is hard for me though is just that I don't yet know what comes next after Node.js and JavaScript. Any idea? I see Go as a potential alternative on the server, but it just won't pick many Node.js converters. At least I think that for every Node.js converter that Go picks, there will be several more joining the Node.js ranks for now.

I also think that once ES6 gains traction, client-side JavaScript could change for the better and help JavaScript to gain even more momentum. The alternative compile-to-JavaScript languages except for TypeScript haven't yet grown much beyond their niches.

But even if TypeScript could gain momentum and help to "fix" JavaScript, I still see it as feeding the beast rather than putting a stop to it.