(877) 224-7768 <>
sales@profoundlogic.com <mailto:sales@profoundlogic.com>

iModernize - The Profound Logic Software Blog

IBM i Pulse: August 25th, 2017

Posted by Tim Losee on Aug 25, 2017 9:03:00 AM

pulselogo2.png

Glad to have you back for this week's IBM i Pulse! Each week we will be taking a deeper look at this week's IBM i news. This week we are looking at all things Node.js!  But First... 

Here is a really interesting article on the history of IBM... it is always fun to look at how things started!

Source: https://arstechnica.co.uk/gadgets/2017/06/ibm-pc-history-part-1/

10 JavaScript Concepts Every Node.js Programmer Must Master

by Rahul Mhatre

Node.js has quickly become the standard for creating web applications as well as SaaS products and it's popularity continues to grow in the developer community. But Node.js owes much of it's success and popularity to JavaScript as the language is Node.js' primary "engine." JavaScript is a language that can support several different styles of programming including; procedural, functional, and object-oriented programming. This gives developers flexibility and allows them to take advantage of the multiple programming styles. 

But with this flexibility comes difficulty. There is a higher rate of object and scope mutation with Node.js and JavaScript also lacks tail call optimization. These along with other potential issues means that developers need to understand and master certain concepts about JavaScript to truly get the most out of Node.js. Here are 10 concepts that you should master to help you fully utilize JavaScript and Node.js. Read the full article to get the details on each concept!

  1. Immediately Invoked Function Expressions - an IIFE is a function that is executed as soon as you create it.
  2. Closures - an inner function that has access to an outer function's scope, even if the outer function returned control.
  3. Prototypes - this is used to attach properties and methods.
  4. Private Properties Using Closures - define private properties using underscore prefixes. 
  5. The Module Pattern - allows developers to create public and private access levels. 
  6. Hoisting - moving variables and function declarations to the top of their scope before code execution. 
  7. Currying - making functions more flexible. 
  8. Apply, Call, and Bind Methods - knowing the difference is crucial to knowing JavaScript.
  9. Memoization - an optimization technique that will speed up function execution.
  10. Method Overloading - allowing multiple methods to have the same name, but different arguments. 

Source: https://www.infoworld.com/article/3196070/node-js/10-javascript-concepts-nodejs-programmers-must-master.html

What You Should Know to Really Understand the Node.js Event Loop

by Daniel Khan

Everything that happens in Node is based on an event, which makes it an event-based platform. The event loop is a mechanism created by a library (libuv) that takes a transaction through a series of callbacks. This is all done independently from any developers. This event loop can be a very misunderstood concept of the Node platform to many developers and in this article Daniel aims to help you better understand the Event Loop. He goes into many details, but we will briefly focus on the misconceptions of the Node.js Event Loop. 

 Misconception 1: The Event Loop Runs in a Separate Thread in the User Code

 Many people think that the main thread is where the JavaScript code of the user runs and there is another one that runs the event loop. Only one thread executes JavaScript code... this thread is where the event loop runs. Callback executions are done by the event loop (all userland codes that run Node.js applications have a callback). 

Misconception 2: Everything That is Asynchronous is Handled by a Thread Pool

 Libuv will be default create thread pool with 4 threads to help offload asynchronous work. It is not like working with a filesystem where the operations doing outbound HTTP requests to databaseses are ALWAYS loaded off to a thread pool. Whenever it can, libuv will avoid the usage of thread pools by using asynchronous interfaces.

Misconception 3: The Event Loop is Something Like a Stack or Queue

Nope! The event loop will not continuously traverse a FIFO of asynchronous tasks and execute that callback when the task is completed. The reality is there are queue-like structures, the event loop does not run through and process a stack. It is actually a set of phases that have specific tasks that are processed in a round-robin type manner. 

 For more on Node.js Event Loops, check out the full article below. 

 Source: https://medium.com/the-node-js-collection/what-you-should-know-to-really-understand-the-node-js-event-loop-and-its-metrics-c4907b19da4c

 
 
Register Today!

Checklist: Node.js Production Best Practices

by Yoni Goldberg

Curious as to how to best use Node.js? New to the framework and are unsure and need some guidance? This is a collection of tips to help those of you who are running Node.js already. These tips have been gathered by some of the top influencers in the Node world, make sure to read the full article to read the "GIST Popups" each tip has. Here are 10 of Yoni's best practices:

  1. Monitoring - Find any issues before your customers do!
  2. Use Smart Logging - this will increase transparency if you start planning how you will set up your logs from the start.
  3. Delegate to a Reverse Proxy - Node has difficulty doing intensive CPU tasks... delegate these if you can.
  4. Guard Process Uptime - If you run dozens of instances without the right cluster management, you risk running into devop hell!
  5. Error Management Best Practices - Create and understand how your business handles errors and stick to that system across the entire company.
  6. Utilize All CPU Cores - You must replicate the Node process on all CPU's because Node at its core runs over a single CPU.
  7. Create a Maintenance Endpoint - this will prevent you from performing many "diagnostic deploys" and shipping code to production only to extract information for diagnostics.
  8. Discover Downtime and Errors - Use of an APM product can help you discover these time consuming issues. 
  9. Make Code Production Ready - If you have in your mind from day one what your code needs to look like to be production ready, you will have a clear path to get there.
  10. Security - Node has unique security challenges, make sure to take every precaution you can to keep your code secure.

Source: http://goldbergyoni.com/checklist-best-practice-of-node-js-in-production/


November 15th-17th Profound Logic will be hosting our 2nd annual PLUS Seminar for their customers. Get the most value from your Profound Logic investment and assure your modernization success. Register here today!

One of our focuses for 2017 is the continued adoption of Node.js in IBM i shops. Click here to read our white paper on Why Node.js Is The Solution Your Company Needs.

Also, Profound.js 2.0 has been released! See how Profound.js 2.0 can help modernize your IBM i today!

And there, you're all caught up! Sounds like we have an interesting 2017!

Topics: Events & Education, Application modernization, IBM i applications, Node.js, Profound.js, IBM i, RPG, AS400 modernization, IBM i Modernization, Agile modernization, iSeries, Legacy Modernization

Subscribe to Blog Updates

...and get our Node.js Enterprise IBM i Modernization White Paper

Node.js cover page option 2-1.png

Recent Posts