Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,761 members, 7,817,104 topics. Date: Saturday, 04 May 2024 at 05:45 AM

Javascript With NodeJS - Programming (2) - Nairaland

Nairaland Forum / Science/Technology / Programming / Javascript With NodeJS (16804 Views)

Lets Start A Real Web-deveopment Course Here Html+css+javascript+php+mysql / Which is more awesome to use for 'server-side programming', NodeJS or PHP? / Javascript In One PIX: Understand Javascript With Just A LOOK (2) (3) (4)

(1) (2) (3) (4) (5) (6) (7) (Reply) (Go Down)

Re: Javascript With NodeJS by micodon(m): 8:29am On Apr 12, 2015
Febup:
^^^
npm package manager was introduced in 2011.

I'll like to share this with you:

And then, I ran the apache benchmarking tool on both of them with 2000 requests (200 concurrent). When I saw the time stats of the result, I was astounded:

#PHP:
Concurrency Level: 200
Time taken for tests: 574.796 seconds
Complete requests: 2000

#node.js:
Concurrency Level: 200
Time taken for tests: 41.887 seconds
Complete requests: 2000

The truth is out. node.js was faster than PHP by more 14 times! These results are astonishing. It simply means that node.js IS going to be THE de-facto standard for writing performance driven apps in the upcoming future, there is no doubt about it!

http://blog.prahladyeri.com/2014/06/php-vs-node-js-real-statistics.html

Node isnt exactly the same with php.

Now google for benchmarks comparing hhvm + php and node. you'd be stunned. hhvm + PHP outperforms node.

Bro, stop googling just to prove urself right. you are trying to convince people who have used both technologies extensively. the more u post stuff here, the more ur naivety shows
Re: Javascript With NodeJS by Nobody: 12:52am On Apr 13, 2015
^^^
No it not naive to post comments from Google as these are the comments from many developers who have worked with many different languages more than yourself, that will make JavaScript and NodeJS to become the preferred language for wed applications.

1 Like

Re: Javascript With NodeJS by abubaka101: 11:33am On Apr 13, 2015
Febup:
^^^
No it not naive to post comments from Google as these are the comments from many developers who have worked with many different languages more than yourself, that will make JavaScript and NodeJS to become the preferred language for wed applications.
It's good to quote sources to convince ppl you knw wat YOU are talking about. But when you quote too much and don't giv thoughts to wat odas are saying then you're just being naive. Don't be!
Re: Javascript With NodeJS by Nobody: 7:58pm On Apr 13, 2015
Febup:
^^^
No it not naive to post comments from Google as these are the comments from many developers who have worked with many different languages more than yourself, that will make JavaScript and NodeJS to become the preferred language for wed applications.

Most of the quotes you commented didn't answer the question especially like the Callback hell, you have to understand the issue before knowing what to copy. anyway that's that. yeah Nodejs would be used but as preferred Web Solution i don't think so but it will widely adopted nothing beats PHP in terms of adapting. But for some reason I would go with Python than Nodejs since Micodon has already informed me about how Twisted is on par with Node.

1 Like

Re: Javascript With NodeJS by Nobody: 11:06am On Apr 14, 2015
^^^

Node.js is gaining adoption as a server-side platform and is used by:
1. Microsoft
2. Yahoo
3. Walmart
4. Groupon
5. SAP
6. LinkedIn
7. Rakuten
8. PayPal
9. Voxer
10. GoDaddy
Source: http://en.wikipedia.org/wiki/Node.js

If the companies above are now using Node.js as a server-side platform then it is very naive for anyone to say that Node.js and javaScript will not become the preferred solution for web development.

The beauty of Node.js is that it is a server so you do not need IIS or Apache to run JavaScript applications built with Node.js.
Source: https://nodejs.org/

AN EXAMPLE: WEBSERVER
This simple web server written in Node responds with "Hello World" for every request.

var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
To run the server, put the code into a file example.js and execute it with the node program from the command line:

% node example.js
Server running at http://127.0.0.1:1337/
Here is an example of a simple TCP server which listens on port 1337 and echoes whatever you send it:

var net = require('net');

var server = net.createServer(function (socket) {
socket.write('Echo server\r\n');
socket.pipe(socket);
});

server.listen(1337, '127.0.0.1');
Re: Javascript With NodeJS by micodon(m): 11:45am On Apr 14, 2015
Febup:
^^^

Node.js is gaining adoption as a server-side platform and is used by:
1. Microsoft
2. Yahoo
3. Walmart
4. Groupon
5. SAP
6. LinkedIn
7. Rakuten
8. PayPal
9. Voxer
10. GoDaddy
Source: http://en.wikipedia.org/wiki/Node.js

If the companies above are now using Node.js as server-side platform then it is very naive for anyone to say that Node.js and javaScript will not become the preferred solution for web development.

The beauty of Node.js is that it is a server so you do not need IIS or Apache.
Source: https://nodejs.org/

AN EXAMPLE: WEBSERVER
This simple web server written in Node responds with "Hello World" for every request.

var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
To run the server, put the code into a file example.js and execute it with the node program from the command line:

% node example.js
Server running at http://127.0.0.1:1337/
Here is an example of a simple TCP server which listens on port 1337 and echoes whatever you send it:

var net = require('net');

var server = net.createServer(function (socket) {
socket.write('Echo server\r\n');
socket.pipe(socket);
});

server.listen(1337, '127.0.0.1');




You see? Still googling and showing naivety.

Microsoft provides Nodejs Hosting via there windows Azure cloud hosting. Do they use it for there apps? Hell no!! Their web apps are all Asp.Net. Their Desktop apps, C#.Net.

Yahoo uses NodeJs to power their real time collaborative API's (as i said earlier, node is the right tool for heavy lifting in real time). Majority of their code base are still PHP, Python and .Net.

Walmart, uses nodejs for real time communications.

GoDaddy provides Nodejs hosting.


Linkedin uses nodejs for their mobile app server. All other stuff written in Java and c++.


Need i go on? One company or more can use node to power their real time communication system and thats that. they only use node in a small fraction of their codebase. what does that tell you?

Nodejs is not a server. it is a software. the httpserver is a node module that comes prepackaged in node.

I seriously doubt that you know anything about web development or programming in general

Bro, keep googling and showing your inexperience. Im enjoying it.
Re: Javascript With NodeJS by Nobody: 11:55am On Apr 14, 2015
^^^

If you say Node.js is not a server then what is your understanding of a client server application?
Re: Javascript With NodeJS by micodon(m): 12:30pm On Apr 14, 2015
Febup:
^^^

If you say Node.js is not a server then what is your understanding of a client server application?

Another naive question.

A client-server app AS THE NAME GRACIOUSLY IMPLIES is an application that distributes tasks between the client and the server.

Eg. I navigate to nairaland.com, My browser (the client), performs a task by calling for the server hosting nairaland on whichever port specified (80 in this example). the server performs its task by fetching the resource and sending to the client.


Im not amazed. you calling nodejs a server.

Dude, i'm totally enjoying this.
Re: Javascript With NodeJS by Nobody: 1:34pm On Apr 14, 2015
^^^
A server can be a server machine ie hardware, server operating system ie software, web server etc that accepts a request from a client and sends a response. So to be precise Node.js is a web server as shown in the example above.

For your information Node.js is a server and it does what you have just descried above and you can make Node.js to listen on port 80 for client's request.

I appears you have just been memorising technical stuff in programming without the knowing what it all about.

1 Like

Re: Javascript With NodeJS by kudaisi(m): 1:44pm On Apr 14, 2015
Febup:
^^^

If you say Node.js is not a server then what is your understanding of a client server application?
The fact that you can create a server with a framework doesn't make it a server. IF I DEVELOP A WEB SERVER WITH C++, DOES THAT MAKE IT A SERVER ? I think you are taking this argument far too personal and maybe @micodon might have been harsh on you at a point (which a lot of people will agree is constructive criticism cause he seemed to know what he was saying) but it was out of frustration you imposed from your ignorance on the point you clsimed to be making and you defensive attitude to criticism.

However, i suggest you humble a little and learn from from the wealth of experience other people have to share that's the whole point of this forum. Additionally, you seem to be talking from facts that you read and don't fully understand while @micodon seems to be talking from experience. Dang!!! if i were you I'll ask him to further break it down for me so that i may understand rather than picking up a sword to fight against him.

I must say, I have enjoyed following this thread sha...It has been a fun filled comedy/drama.
Re: Javascript With NodeJS by kudaisi(m): 1:49pm On Apr 14, 2015
In my own opinion JavaScript can never be the king of all other programming language. And I take it you a web developer that just learnt about node.js and still hyped up about it. It is not fit for every programming paradigm (quote me anywhere) and you'll discover that as you earn more experience working with node.js. If you really thing it'll soon be the king of all programming languages go and create and operating system with Node.js.

1 Like

Re: Javascript With NodeJS by Nobody: 1:50pm On Apr 14, 2015
kudaisi:

The fact that you can create a server with a framework doesn't make it a server. IF I DEVELOP A WEB SERVER WITH C++, DOES THAT MAKE IT A SERVER ? I think you are taking this argument far too personal and maybe @micodon might have been harsh on you at a point (which a lot of people will agree is constructive criticism cause he seemed to know what he was saying) but it was out of frustration you imposed from your ignorance on the point you clsimed to be making and you defensive attitude to criticism.

However, i suggest you humble a little and learn from from the wealth of experience other people have to share that's the whole point of this forum. Additionally, you seem to be talking from facts that you read and don't fully understand while @micodon seems to be talking from experience. Dang!!! if i were you I'll ask him to further break it down for me so that i may understand rather than picking up a sword to fight against him.

I must say, I have enjoyed following this thread sha...It has been a fun filled comedy/drama.

kudaisi another username for micodon, rather than to learn something new you'll rather stick to the little you have committed to memory, the world of IT technology has left you behind.
Re: Javascript With NodeJS by Nobody: 2:03pm On Apr 14, 2015
kudaisi:
In my own opinion JavaScript can never be the king of all other programming language. And I take it you a web developer that just learnt about node.js and still hyped up about it. It is not fit for every programming paradigm (quote me anywhere) and you'll discover that as you earn more experience working with node.js. If you really thing it'll soon be the king of all programming languages go and create and operating system with Node.js.

No single programming language can perform all programming paradigms, the best they can do is to perform all the main ones. Yes JavaScript and Node.js still requires C and C++, but for web applications it will become the preferred choice soon.

1 Like

Re: Javascript With NodeJS by micodon(m): 2:10pm On Apr 14, 2015
Febup:
^^^
A server can be a server machine ie hardware, server operating system ie software, web server etc that accepts a request from a client and sends a response. So to be precise Node.js is a web server as shown in the example above.

For you information Node.js is a server and it does what you have just descried above and you can make Node.js to listen on port 80 for client's request.

I appears you have just been memorising technical stuff in programming without the knowing what it all about.

Your brain too empty. Once upon a time, i created a http server using php for someone's school project. Does that make PHP a server?. I created an RTMP server using python for a video conferencing app i built. Does that make python a server? you can use virtually any programming language to create a server.

You need to be flogged for disgracing real programmers.
Re: Javascript With NodeJS by micodon(m): 2:12pm On Apr 14, 2015
Febup:


kudaisi another username for micodon.
Your IQ is as low as the line height of status texts on facebook
Re: Javascript With NodeJS by Nobody: 2:18pm On Apr 14, 2015
micodon:

Once upon a time, i created a http server using php for someone's school project. Does that make PHP a server?. I created an RTMP server using python for a video conferencing app i built. Does that make python a server? you can use virtually any programming language to create a server.

You are just arguing over what you don't know. Create your own run-time environment like Node.js first before coming here to criticise what you know little about.
Re: Javascript With NodeJS by Nobody: 2:20pm On Apr 14, 2015
@ micodon
You are a nobody in the world of programming, it is only here on nairaland you are a local champion grin
Re: Javascript With NodeJS by micodon(m): 2:28pm On Apr 14, 2015
Febup:
^^^
You are just arguing over what you don't know. Create your own run-time environment like Node.js first before coming here to criticise what you know little about.

Your empty brain is unique. Nothing can go through. ill help you. i love doing so.

Nodejs is a run time environment. You can run javascript apps in this runtime environment.

these apps can come as modules. Some modules come by default with the nodejs installation. these modules are written in pure javascript (take note that node is written in c++). one such module is the http module. With this module, you can spin up a server.

HOW IN RASMUS LERDOF'S NAME DOES THAT MAKE THE RUNTIME ENVIRONMENT A WEB SERVER? Someone needs to be put in a remand home.

i bet you have no app in production. Empty head
Re: Javascript With NodeJS by Nobody: 2:30pm On Apr 14, 2015
@ micodon

You should stop critising what you know nothing about.
Re: Javascript With NodeJS by micodon(m): 2:42pm On Apr 14, 2015
List of servers in the world....I CHALLENGE YOU TO FIND NODEJS ON THE LIST

http://en.m.wikipedia.org/wiki/Comparison_of_web_servers
http://www.webdevelopersnotes.com/hosting/list_of_web_servers.php3

How can a human be so daft?
Re: Javascript With NodeJS by Nobody: 2:44pm On Apr 14, 2015
A server is a running instance of an application (software) capable of accepting requests from the client and giving responses accordingly. Servers can run on any computer including dedicated computers, which individually are also often referred to as "the server".
http://en.wikipedia.org/wiki/Server_%28computing%29
Server (computing) - Wikipedia, the free encyclopedia

AN EXAMPLE: WEBSERVER
This simple web server written in Node responds with "Hello World" for every request.

var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
To run the server, put the code into a file example.js and execute it with the node program from the command line:

% node example.js
Server running at http://127.0.0.1:1337/
Here is an example of a simple TCP server which listens on port 1337 and echoes whatever you send it:

var net = require('net');

var server = net.createServer(function (socket) {
socket.write('Echo server\r\n');
socket.pipe(socket);
});

server.listen(1337, '127.0.0.1');

Source: https://nodejs.org/
Re: Javascript With NodeJS by micodon(m): 2:56pm On Apr 14, 2015
Febup:
A server is a running instance of an application (software) capable of accepting requests from the client and giving responses accordingly. Servers can run on any computer including dedicated computers, which individually are also often referred to as "the server".
http://en.wikipedia.org/wiki/Server_%28computing%29
Server (computing) - Wikipedia, the free encyclopedia


AN EXAMPLE: WEBSERVER
This simple web server written in Node responds with "Hello World" for every request.

var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
To run the server, put the code into a file example.js and execute it with the node program from the command line:

% node example.js
Server running at http://127.0.0.1:1337/
Here is an example of a simple TCP server which listens on port 1337 and echoes whatever you send it:

var net = require('net');

var server = net.createServer(function (socket) {
socket.write('Echo server\r\n');
socket.pipe(socket);
});

server.listen(1337, '127.0.0.1');

Source: https://nodejs.org/

What does var http = require("http"wink tell you. Thats a javascript app. a node module. it is a server written in javascript. Take a look at the installation folder of node. look at node_modules folder. you will see the http module.

You are so embarrasing yourself. 9 years ago when i started programming, i was eager to accept instructions..ready to learn. you cant learn without that mentality
Re: Javascript With NodeJS by Nobody: 3:07pm On Apr 14, 2015
@ micodon

No need for you to be abusive if you have a different opinion to someone else. Node.js is used for creating a web server so there is no need for you to go on arguing about this, just accept it or leave it.
Re: Javascript With NodeJS by micodon(m): 3:18pm On Apr 14, 2015
Febup:
@ micodon

No need for you to be abusive if you have a different opinion to someone else. Node.js is used for creating a web server so there is no need for you to go on arguing about this, just accept it or leave it.

Python can be used to create a webserver
C++ can be used to create a web server
C can be used to create a web server
Go can be used to create a webserver

Therefore, based on your statements, These programming languages are webservers.

Water can be used in a system to generate electricity. therefore, water is electricity. Good thinking, dude
Re: Javascript With NodeJS by micodon(m): 3:31pm On Apr 14, 2015
..and Nodejs is not used for creating web servers. Node is a runtime environment that runs javascript apps. the http module is a javascript app that is run in the node environment.

Keep showing ur ignorance, oga. Let the world know
Re: Javascript With NodeJS by Nobody: 4:08pm On Apr 14, 2015
Yes correct you use Node.js to create a web server, to listen for requests from JavaScript client application. JavaScript is a language and Node.js is a run-time environment.
The languages you mentioned are not a run-time environment so you need to get your facts right.
Re: Javascript With NodeJS by micodon(m): 4:18pm On Apr 14, 2015
Febup:
Yes correct you use Node.js to create a web server, to listen for requests from JavaScript client application. JavaScript is a language and Node.js is a run-time environment.
The languages you mentioned are not a run-time environment so you need to get your facts right.

the http module...wat language was it written in? your mumu too much
Re: Javascript With NodeJS by Nobody: 4:23pm On Apr 14, 2015
@ micodon
You just like to argue, go and learn what a server is first before coming back to make comments.
Re: Javascript With NodeJS by Nobody: 5:54pm On Apr 14, 2015
There's no need for the insults we can argue without calling names.

1 Like

Re: Javascript With NodeJS by Nobody: 6:04pm On Apr 14, 2015
Febup:
^^^

If you say Node.js is not a server then what is your understanding of a client server application?

I think you meant to say that Nodejs is a server-sided script just like PHP,Python,ASP.NET they run at the server, Nodejs is not a server but it's built to create a server-like environment, remember it's C++ so Node has tons of access to the low level API used for networking and other things.

I think you should check out Node C++ Libraries used to build node it would give alot of insights. infact Node ,Python and Go are similar you can create a Server-like environment with them but it's not a server remember it's all CGI you can use any server language to create a CGI the browser communicating with that would obviously peg it as a server doesn't mean it is. (though don't take my word, research to ensure am right)
Re: Javascript With NodeJS by Nobody: 6:08pm On Apr 14, 2015
kudaisi:
In my own opinion JavaScript can never be the king of all other programming language. And I take it you a web developer that just learnt about node.js and still hyped up about it. It is not fit for every programming paradigm (quote me anywhere) and you'll discover that as you earn more experience working with node.js. If you really thing it'll soon be the king of all programming languages go and create and operating system with Node.js.

It can't TypeScript has a greater chance infact in terms of financial application JavaScript is almost a no go, unless you don't mind losing cash to rounding off. I work in a switching company and Nodejs is mostly used to monitor logs and give real time information since its small and has lower memeory footprint. My CTO would put a bullet in my back if i ever mention Node for an enterprise app.
Re: Javascript With NodeJS by Nobody: 6:13pm On Apr 14, 2015
Febup:
^^^
A server can be a server machine ie hardware, server operating system ie software, web server etc that accepts a request from a client and sends a response. So to be precise Node.js is a web server as shown in the example above.

For your information Node.js is a server and it does what you have just descried above and you can make Node.js to listen on port 80 for client's request.

I appears you have just been memorising technical stuff in programming without the knowing what it all about.

PHP also can listen Port 80 the standalone application to bypass Apache its meant to bootstrap PHP application but PHP is not a server so you see that it would be wrong to call PHP a server.

(1) (2) (3) (4) (5) (6) (7) (Reply)

Which Is The Best Place To Learn Programming In Nigeria? / Front-End Developer Or Back-End Developer: Which Job Title Has A Higher Salary? / I Want My Son To Be A Programmer, How Do I Go About It

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 74
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.