Programming › Re: Javascript With NodeJS by micodon(m): 2:57pm On Apr 23, 2015 |
pcguru1: Also careful when you read articles from programmers not all are always correct ot fit for use. Alot of people would argue angular is the best but I can give claims why anyone should use it for a full website. The industry these days is driven by hype. Angular hype,nodejs hype. Later bro Leave this dude, bro. He doesnt know....and he does not want to know |
Programming › Re: Javascript With NodeJS by micodon(m): 2:55pm On Apr 23, 2015 |
pcguru1: I dont see anything here to stop callback hell they are just passing functions around. A good example would have been each method returning a deffered or a promise that way it can be resol ed and chained easily .the example in the link is not good enough. Check this out q.promise it explains better. When you know how to programme, you'll understand. keep showcasing urself, dude. |
|
Web Market › Re: Who Can Design A Classifieds Websitesimilar To OLX? by micodon(m): 12:01am On Apr 17, 2015 |
goodnewz4u: Hello people, Please I also need someone who can develope ad/social website like www.mobofree.com Thanks, as I awaits your kind response ! Contact me....09099010453....ugwueze.michael@gmail.com |
Programming › Re: Javascript With NodeJS by micodon(m): 11:10pm On Apr 14, 2015 |
nah, dude...keep showcasing your ignorance. wannabe |
Programming › 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 |
Programming › 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 |
Programming › 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 |
Programming › 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"  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 |
Programming › Re: Javascript With NodeJS by micodon(m): 2:42pm On Apr 14, 2015 |
|
Programming › 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 |
Programming › 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 |
Programming › 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. |
Programming › 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. |
Programming › 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. |
Programming › 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 |
Programming › Re: Javascript With NodeJS by micodon(m): 10:25pm On Apr 11, 2015 |
Febup: Do you mean NodeJs does not support callbacks? If so then what about this example below:
var myCallback = function(data) { console.log('got data: '+data); };
var usingItNow = function(callback) { callback('get it?'); }; Now open node or browser console and paste the above definitions.
Finally use it with this next line:
usingItNow(myCallback);
http://stackoverflow.com/questions/19739755/nodejs-callbacks-simple-example I see that you know little about nodejs. I never said nodejs doesnt support callbacks. Have you heard of 'callback hell' in nodejs? google it, and you ll know wat i mean. and how can u go about hyping stuff u know little about? |
Programming › Re: Javascript With NodeJS by micodon(m): 6:15pm On Apr 11, 2015 |
Febup: A lot has changed since its was first released six years ago.
Nodejs now supports asynchronous processing. It has a package manager called npm like NuGet Package Manager in .Net this allows you to download over 50 thousand free tools from the npm web server here is their website: https://www.npmjs.com/ Bros i know nodejs well. i develop applications in it too. February this year i completed a very large app in nodejs. it has always supported async processing. it has always used npm. in fact its almost impossible to work with node without using npm. |
Programming › Re: Javascript With NodeJS by micodon(m): 5:58pm On Apr 11, 2015 |
pcguru1: You do have a point especially at a time when the Node community is even divided amongst itself io.js and the Nodejs, didn't know PHP7 was supporting async. people would still use NodeJs because of the JavaScript option. as for Callback Hell I always advocate for Promises its way easier. Callback hell...people dont wanna learn. promises, i learned the hard way. PHP 7 will supports async programming, non blocking i/o. it will come with a JIT engine. another killer it will have a multi threaded web server (so concurrency issues will be dealt with). Why then will i port to node if im already using php? even now, there re libraries that ll give node a run for its money when it comes to async i/o.....you can take a look at react PHP and RatchetPHP |
Programming › Re: Javascript With NodeJS by micodon(m): 5:21pm On Apr 11, 2015 |
Febup: @micodon and pcguru1
The reason I started this thread was after I came across the Node.Js to MySQL connector code below. So for web application development I'm sure JavaScript with Node.JS will become the preferred language for web developers soon.
npm install mysql var mysql = require('mysql');
var mysql = require('mysql'); var pool = mysql.createPool({ host : “hostName”, user : “username”, password: “password” });
var connection = mysql.createConnection({ host : “hostName”, user : “username”, password: “password” }); http://www.thegeekstuff.com/2014/01/mysql-nodejs-intro/ Nodejs is 6years old. its gone nowhere. it has its own problems. try callbacks in node. With Tornado, python matches nodejs, and is more elegant. with hhvm or phpng, php beats nodejs in requests per second. php 7 will come with async functionality. Erlang is the king of concurrency NOW THE ISSUE IS: ALL THESE ARE ALREADY SO POPULAR. SO, IF NODE DOESNT DO ANYTHING NEW, WHY WILL IT BECOME THE PREFERRED LANGUAGE FOR THE WEB? The only people that will switch to node are those whose apps specifically require node type structure or just enthusiasts. For example i built an app that uses PHP as the core but used nodejs for realtime updates. Facebook uses Php for its core but uses Erlang for its chat. Morale is, People wont switch. Especially when PHP7 is released |
Programming › Re: Javascript With NodeJS by micodon(m): 3:55pm On Apr 11, 2015 |
Febup: @micodon
Check my post it says JSP still needs JVM. I did not say JVM was a sever, all I wrote was that Java needs JVM to run on the server.
Third generation Languages for web development needs a software or framework to run on a server. JVM, JSP, .Net Framework etc are made up of software. So Node.JS is no defferent.
There is really no need for this argument, but the main point here is that with Node.JS with JavaScript can run on a server and for that reason it will become the preferred language for web application development. when will it become? |
Programming › Re: Javascript With NodeJS by micodon(m): 3:27pm On Apr 11, 2015 |
pcguru1: Yep Micodon is right you need to a Container like Tomcat,GlassFish , IBM Websphere or so am not sure, JVM just intepretes and has no nothing to do with Server or servlets.
.NET Framework hmmmm frankly i'm not sure how it explain this i know it allows different MS techs to run together you still need IIS for the Server side.
but regardless i think he meant you can't escape not using JVM then again not sure how one can run Java without a JVM so the talk of JVM shouldn't be brought up. you know your onions, bro. |
Programming › Re: Javascript With NodeJS by micodon(m): 3:15pm On Apr 11, 2015 |
On a second thought let me make it easy for you.
you have a JSP script, JVM and Tomcat.
i visit localhost where the jsp script is located. Tomcat (the server), accepts the request, knows what resource i want to access, and fetches it.
now, its intelligent enough to know that The computer on its own doesnt know jack (it understands machine language) about the jsp script. so the computer on its own cant render to me, what the programmer says it should render to me.
Tomcat then sends the content of the script and all dependencies to the JVM. JVM gets it, parses and interpretes it into a language the computer can understand. sends to the computer, the computer reads, understands and performs whatever action the prgrammer programmed the script to do.
The result is sent back to Tomcat, Tomcat forwards it to the port where the request was made. and you have a rendered webpage
As you can see, what Tomcat (or any other server) does, is to receive request for resources and send back responses.
its the reason why PHP, ruby, python and others run server side. To be able to use their respective interpreters to make the computer understand whatever the programmer has programmed.
Javascript is able to run on the client, because the browsers have their respective interpreters in built. Chrome uses google's v8 engine.
Bros JVM and .Net framework are not servers |
Programming › Re: Javascript With NodeJS by micodon(m): 2:55pm On Apr 11, 2015 |
Febup: ^^^ JSP still needs JVM. JSP allows Java code and certain pre-defined actions to be interleaved with static web markup content, with the resulting page being compiled and executed on the server to deliver a document. The compiled pages, as well as any dependent Java libraries, use Java bytecode rather than a native software format. Like any other Java program, they must be executed within a Java virtual machine (JVM) that integrates with the server's host operating system to provide an abstract platform-neutral environment. Source:http://en.wikipedia.org/wiki/JavaServer_Pages
.Net Framework too has software that allows C# to run on the server.
All languages needs another software to allow them the rum on the server unless maybe you code directly in binary
I still feel JavaScript with Node.JS will be the preferred language of the web in future, as it allows you to use Javascript from front-end to back -end Dude, you are totally wrong. 1. Java and JSP are not the same. 2. JSP does not have JVM built in. JSP is like PHP as ur wikipedia page tells you. 3. whether JSP requires JVM or not does not make JVM a server. JVM can be viewed like ur php interpreter. HECK!!! Do you even know what a server is? Is the PHP lang parser and interpreter a server? is the ruby engine a server? is the V8 engine a server? bro, do more research. 4. .Net framework has no software that makes C# run on the server. Its a framework for God's sake. To run a c# code on a server, you need to embed it into a asp or asp.net app and run it via the Microsoft IIS server. Go and learn what a server is and how it does what it does |
Programming › Re: Javascript With NodeJS by micodon(m): 2:14pm On Apr 11, 2015 |
Febup: ^^^ Every other language have a software that allows them to run on the server side and JavaScript is no different now with Node.JS - For Java you Need a JVM - For C# you need .Net - etc
The ease of using JavaScript from front-end to back-end is what will make it a preferred programming language for the web in the next few years. WRONG!!! WRONG!! WRONG!!. JVM (JAVA VIRTUAL MACHINE) is not a server. it emulates a virtual machine that interpretes Java bytecode to your system's processor. To run Java on the server, you need to use jsp on servers like tomcat. .NET is not a server. it's a very advanced framework in the same way codeigniter and laravel are frameworks for PHP, RoR for ruby and Web2py for python. To run c# on the server, you need to use asp or asp.net on the iis server. now to the main point, ease of use doesnt ensure reliability. will nodejs still be maintained after 20 years? how large and active is its community? does it do what other pre existing and popular software stacks cant do? you need to ask these questions before you declare that node will be the defacto standard for the dynamic web. it has been here for close to 6 years but its explosive growth has stopped while others that are there are still continuing. Facebook compiles PHP into c. why? why dont they move straight to c? why did they have to produce hhvm (which is faster than node). You see, real programmers dont prefer ease to reliability, backwards compatibility, active community and all the rest. im not saying node isnt good. its magnificent at what it does. but will it ever be the most widely used server stack in the world? No. the real deal may well be golang. say i told you so |
Programming › Re: Javascript With NodeJS by micodon(m): 12:55pm On Apr 11, 2015 |
Febup: ^^^ Yea C and C++ are the Mother of all third-generation programming languages. But of the others for web application development I feel JavaScript Node.JS might become the preferred language, owing to the ease of displaying your data directing with HTML or DIV Tags from your back-end data source, using JavaScript. If Javascript wasnt a programming language prior to the birth of NodeJS, you cant call it a programming language now. NodeJS is a software that makes JavaScript run on the server-side. JavaScript in itself did not change. Node just changed the way JavaScript is run. Say Node is like apache and php combined. About becoming the preferred language of the web,i highly doubt that. PHP was created in 1994. 6 yrs later a greater percentage of the dynamic web was built with PHP. Python 2.0 was released in 2000. 6 years later large number of apps on the web are python powered. NodeJs was released in 2009. 6 yrs later, only a relatively few node powered apps have been deployed to the real world. When PHP 7 is released with its async and non blocking I/O, it will be a knockout blow to node. FYI, i do php, python, RoR, Node etc |
Webmasters › Re: Create A Site Like Nairaland.com, , Facebook.com |earn Money by micodon(m): 8:06am On Apr 11, 2015 |
thewebcraft: (Do You Know That You Can Make Millions Of Naira Through Website/Blog?.,.....360jam.wapka.mobi ) Moderators.. All this childish post by fake web designer's has to stop. e dey pain me bad bad. someone will just learn how to use wordpress alone and start making noise |
Webmasters › Re: Codeigniter HMVC by micodon(m): 10:33am On Apr 08, 2015 |
adewasco2k: its all about the framework that could deliver a particular job well.
sure i still use codeigniter, i am currently working on a project using same. Leave the guy. i bet ill switch back to CI when V3 becomes complete |
Webmasters › Re: Codeigniter HMVC by micodon(m): 6:34am On Apr 08, 2015 |
maekhel: Am thinking FuelPHP ive worked with Fuel before, its not as elegant as laravel |
Webmasters › Re: Codeigniter HMVC by micodon(m): 8:32pm On Apr 07, 2015 |
maekhel: Wch framework will u recommend aside codeigniter i switched from codeigniter to laravel. you should try same |
Webmasters › Re: Codeigniter HMVC by micodon(m): 6:40pm On Apr 07, 2015 |
maekhel: Thanks, will check it out. you wlcm bro |
Webmasters › Re: Codeigniter HMVC by micodon(m): 2:41pm On Apr 07, 2015 |
|