10 Habits of Highly Effective Programmers—Part II

This is a continuation of 10 Habits of Highly Effective Programmers which I wrote a few weeks ago. Here are 10 more habits. They are not set in stone but that’s what I saw work really well if you want to become a great developer and enjoy your work and career (be great first to get a great job).

Continue reading “10 Habits of Highly Effective Programmers—Part II”

React Native Quickly: Start Learning Native iOS Development with JavaScript NOW!

This book is a guide on getting started with React Native for mobile iOS development. You can find source code and the manuscript in https://github.com/azat-co/react-native-quickly. You can read this book online here, or at reactnativequickly.com, or if you prefer videos, you can watch project videos at Node.University: http://node.university/courses/react-native-quickly.

In this book, I’ll introduce you to React Native for native mobile iOS and Android development… and do it quickly. We’ll cover topics such as

  • Why React Native is Awesome
  • Setting up React Native Development for iOS
  • Hello World and the React Native CLI
  • Styles and Flexbox
  • Main React Native UI components
  • Importing Modules into an Xcode Project
  • Project: Timer
  • Project: Weather App

This book is about getting started with React quickly and not about React Native, which is technically a separate library (or some might even call it a framework). But I figured after eight chapters of working with React for web development, it would be fun to apply our knowledge to mobile development by leveraging this awesome library. You’ll be amazed how many React Native skills you already know from React.

Continue reading “React Native Quickly: Start Learning Native iOS Development with JavaScript NOW!”

Learn HTTP/2 Server Push by Building Express Middleware

In the previous post, we learned how to perform HTTP/2 server push in a Node server. We also covered the benefits of server push there so to avoid duplication we won’t list them here. We used spdy for server push and H2. But most of the times Node developers don’t work with core HTTP server, they use a framework like Express. So let’s see how we can implement server push in Express.

Continue reading “Learn HTTP/2 Server Push by Building Express Middleware”

Optimize Your App with HTTP/2 Server Push Using Node and Express

HTTP/2 is the new standard of the web. It has many great features which will make the web faster and simplify the development. For example, no need to concatenate files thanks to multiplexing, or a server push which can send files before a browser knows it need them.

This post won’t cover all advantages of HTTP/2. You can read about them online. No need to go into all the details and duplicate text here. Instead, we’ll focus on server push and implement it in Node.js using Express and the spdy library.

Continue reading “Optimize Your App with HTTP/2 Server Push Using Node and Express”

10 Habits of Highly Effective Programmers

This year, I chatted with some of the greatest minds in software engineering. It typically happens at conference speaker and sponsor dinners where none of the regular attendees are allowed. Some of the people you follow on Twitter, got to relax and share opinions and war stories (IE6 anyone?).

These casual talks, and my personal observations over the years, led me to believe there are certain that there certain secret traits of highly effective and successful programmers. Now, do you want to be kick-ass programmer, ship tons of great products people love, and don’t kill yourself in the process from various stresses? If not, then skip this article and try to figure out the stuff on your own.

Continue reading “10 Habits of Highly Effective Programmers”

3 Conferences in 4 Days: NodeSummit, ForwardJS and npmCamp 2016

Last week was very fruitful on conferences. Luckily, there were all in the Bay Area so I didn’t have to travel. I spoke at NodeSummit and ForwardJS, and attended npmCamp. At all of them, I met old friends and made new ones. All of them were great but in different way.

NodeSummit 2016


NodeSummit started on Tuesday with Executive Roundtable which consisted of tech leads from major companies most of you’re familiar with like Netflix, Disney, Dictionary.com, New York Times, me representing Capital One and others totally 12 or so. It’s the first time Joyent put together this round table. It was interesting to hear how other people use Node.js, their pains and wins. Sorry, but I can’t tell you anything more because we all swore to secrecy and weren’t allowed to record anything.

Continue reading “3 Conferences in 4 Days: NodeSummit, ForwardJS and npmCamp 2016”

Software Engineering Future: How Your Job is Becoming a Commodity and Might Even Disappear

My musings on why it might be the time to start looking for a new profession if you are a software engineer?

You know how in the early 20th century pilots were like heroes? It was extremely dangerous to fly planes which were highly unreliable. Most of the time, only true adventures would learn how to fly a plane and become a pilot.

Then, fast forward 50 years and during 1950s, we started to have first commercial flights. It was still prestigious to become a pilot. If you remember, Catch Me If You Can, the villain played by Leo DiCaprio used pilot’s uniform to instill more trust in other people so he can cash fake checks.

In the 21th century, most airlines don’t make much money and they operate on a slim margin. The pilot’s job has become a commodity: there are a lot of schools and you need to study many years to become a pilot, but you get paid not that much more money than a bus driver. Autopilot is doing most of the flying except for landing and take offs. Airlines constantly merge and layoff their staff. Most of the times the attire is not as sharp as we see on pilots in movies, old newspapers and posters.

I believe almost every profession or trade undergoes a few cycles not dissimilar to the famous adoption curve. There are five steps, but I’ll simplify it to just three:

  • In the beginning, there’s very little reward but a high entry barrier
  • In the middle, you get most benefits from the wider demand for a certain skill and it’s less risky and less troublesome to get started in it
  • In the final phase, you get even smaller barrier to entry the profession: there are a lot of known paths, schools, books, best practices. Then also the tools and equipment becomes better than in the first two phases. However, the demand and the benefits to an individual from that profession diminish compare to what it was in the middle phase.

After the third phase, the profession become a commodity. It’s not necessarily a disaster for people in this trade, but it’s certainly not a rarity. Then, the profession can event disappear completely! I’m sure you can come up with some examples that disprove my little theory, but before you do so, let’s take a look at programming.

Continue reading “Software Engineering Future: How Your Job is Becoming a Commodity and Might Even Disappear”

Easy HTTP/2 Server with Node.js and Express.js

The modern Internet with its TCP/IP protocol started around 1975 which is astonishing 41 years ago. For the most part of its existence, we used HTTP and it’s successor HTTP/1.1 (version 1.1) to communicate between clients and servers. It served the web well but the way developers build websites has dramatically changed. There are myriads of external resources, images, CSS files, JavaScript assets. The number of resources is only increasing.

HTTP2 is the first major upgrade to the good old HTTP protocol in over 15 years (first HTTP is circa 1991)! It is optimized for modern websites. The performance is better without complicated hacks like domain sharding (having multiple domains) or file concatenation (having one large file instead of many small ones).

Continue reading “Easy HTTP/2 Server with Node.js and Express.js”

One Year with Capital One: Lessons Learned

Today is exactly one year and ten days since I started my work as a Technology Fellow at fintech startup Capital One. Yes, I wrote before while you shouldn’t work in a startup, and I still believe in it, because Capital One is not a startup in a traditional sense. On the contrary, it’s in the top 10 US banks list as of 2016. Let me explain myself.
Continue reading “One Year with Capital One: Lessons Learned”

Dirty Little Secret About QWERTY Layout and How I Switched to Colemak to Reduce Trauma and Gain Productivity

Typing is everywhere right now. We type for work in emails and on IM clients, we type for personal relationships on Facebook (when was the last time you spoke with a friend on a phone?), and we type to have fun in Whatsapp or iMessages. Then of course, we code in editors and IDEs, and type commands in shells.

Imagine that you woke up tomorrow and weren’t able to use your keyboard. Maybe you would have broken both of your wrists skiing… Terrible, right? Even if you don’t write books or blog posts like I do, typing on a keyboard is how most of us live. And touch screen typing and voice dictation take only small roles. Let me tell you why you might be in danger of losing your ability to type and maybe even close to losing your job, career and relationships.

Continue reading “Dirty Little Secret About QWERTY Layout and How I Switched to Colemak to Reduce Trauma and Gain Productivity”

JSON is Not Cool Anymore: Implementing Protocol Buffers in Node.js

There’s a better alternative to the ubiquitous JSON as the communication protocol of the web. It’s Protocol Buffers (protobuf). In a nutshell, protobuf offers a more dense format (faster processing) and provides data schemas (enforcement of structure and better compatibility with old code).

Protocol Buffers were introduced by Google. You can read, more about them at the official Protocol Buffers Developer Guide. For something shorter, read 5 Reasons to Use Protocol Buffers Instead of JSON For Your Next Service which will give you a quick overview of the protobuf benefits over JSON.

The purpose of this article is not to highlight why protobufs are better or sell you on the concept. There are many article online that’ll do it for you. The purpose of this article is to show you how you can get started with this format in the Node.js environment.

Continue reading “JSON is Not Cool Anymore: Implementing Protocol Buffers in Node.js”

Reactive Web Stack: 3RES – React, Redux, RethinkDB, Express, Socket.io

This post has been written by Scott Hasbrouck. You can find him on Twitter or his website.

It’s been nothing but wonderful to see JavaScript truly catch fire the past few years in web technology, ultimately becoming the most used language in 2016, according to StackOverflow data. My history with JavaScript began about 15 years ago, not all that long after it was first released as part of Netscape Navigator 2, in 1996. My most used learning resource was DynamicDrive, and their tutorials and code snippets of “Dynamic HTML” or DHTML – a term coined by Internet Explorer 4. Really, DHTML was a set of browser features implemented with JavaScript, CSS, and HTML that could get you nifty elements like rollover buttons and stock tickers.

Fasting forward to today, we now live in a world where JavaScript has grown to take over web technology. Not just in the browser, but it is now the most popular backend language according to that same StackOverflow report! Naturally, there are always those who dislike the language citing things like the ease of creating a global variable, or null being an object and undefined being its own datatype. But I’ve found that every language I pick up has quirks that are easily avoidable once you learn to properly use it. And we do want to become experts in our craft and truly learn to master our tools, do we not?

Continue reading “Reactive Web Stack: 3RES – React, Redux, RethinkDB, Express, Socket.io”

You Don’t Know Node: Quick Intro to Core Features

This essay was inspired by the Kyle Simpson’s series of books, You Don’t Know JavaScript. They are a good start with JavaScript fundamentals. Node is mostly JavaScript except for a few differences which I’ll highlight in this essay. The code is in the You Don’t Know Node GitHub repository under the code folder.

Why care about Node? Node is JavaScript and JavaScript is almost everywhere! What if the world can be a better place if more developers master Node? Better apps equals better life!

This is a kitchen sink of subjectively the most interesting core features. The key takeaways of this essay are:

  1. Event loop: Brush-up on the core concept which enables non-blocking I/O
  2. Global and process: How to access more info
  3. Event emitters: Crash course in the event-based pattern
  4. Streams and buffers: Effective way to work with data
  5. Clusters: Fork processes like a pro
  6. Handling async errors: AsyncWrap, Domain and uncaughtException
  7. C++ addons: Contributing to the core and writing your own C++ addons

Event Loop

We can start with event loop which is at the core of Node.

Node.js Non-Blocking I/O
Node.js Non-Blocking I/O

It allows processing of other tasks while IO calls are in the process. Think Nginx vs. Apache. It allows Node to be very fast and efficient because blocking I/O is expensive!

Take look at this basic example of a delayed println function in Java:

System.out.println("Step: 1");
System.out.println("Step: 2");
Thread.sleep(1000);
System.out.println("Step: 3");

It’s comparable (but not really) to this Node code:

console.log('Step: 1')
setTimeout(function () {
  console.log('Step: 3')
}, 1000)
console.log('Step: 2')

Continue reading “You Don’t Know Node: Quick Intro to Core Features”

Node Patterns: From Callbacks to Observer

UPDATE: Now also available as a video (taken at NodePDX 2016) on YouTube.

This essay started as a presentation at the ConFoo Canada conference. Enjoy the slides ? at https://github.com/azat-co/node-patterns:

git clone https://github.com/azat-co/node-patterns
Node Patterns: From Callbacks to Observer
Node Patterns: From Callbacks to Observer

Before we can get started with Node patterns, let’s touch on some of the main advantages and features of using Node. They’ll help us later to understand why we need to deal with certain problems.

Node Advantages and Features

Here are some of the main reasons people use Node:

  • JavaScript: Node runs on JavaScript so you can re-use your browser code, libraries and files.
  • Asynchronous + Event Driven: Node executes tasks concurrently with the use of asynchronous code and patterns, thanks to event loop.
  • Non-Blocking I/O: Node is extremely fast due to its non-blocking input/output architecture and Google Chrome V8 engine.

That’s all neat but async code is hard. Human brains just didn’t evolve to process things in an asynchronous manner where event loop schedules different pieces of logic in the future. Their order often is not the same order in which they were implemented.

Continue reading “Node Patterns: From Callbacks to Observer”

Meeting React.js: An Excerpt from ‘React Quickly’

This is an excerpt from React Quickly (Manning, 2016). You can download the entire first chapter for free at Manning. The book is scheduled for release in the first quarter of 2016, but MEAP is available right now. Use code “mardandz” to get 39% off.

Each chapter has a project which is supplemented by a video screencast hosted on YouTube.

React Quickly Screencasts
React Quickly Screencasts

Project: Menu with React.js

The project for this article will be minimal. The idea is to have a dynamically generated menu which will consist of <a> tags.

We’ll use custom React components Menu and Link. They way we create them is similar to the way we create the HelloWorld component in the previous example. The project will show you how to render nested elements programmatically. In the previous examples, we just coded the children manually. We’ll use the map() function for it.

Continue reading “Meeting React.js: An Excerpt from ‘React Quickly’”

React Quickly Screencasts

Each chapter of my new book React Quickly (Manning, 2016) has a project which is supplemented by a video screencast. Watch the videos here or on YouTube. The code is on GitHub.

React Quickly
React Quickly

Also, you can download the entire first chapter for FREE at Manning. The book is scheduled for release in the first quarter of 2016, but early access (e-copy) is available right now. Use code “mardandz” to get 39% off at Manning.

React Quickly Chapter 1 Project: Menu with React:

Continue reading “React Quickly Screencasts”

Full Stack JavaScript

My new book Full Stack JavaScript (my 4th traditionally-published book) comes with a series of screencast videos for better immersion in a wonderful and mesmerizing world of Node.js, Backbone and MongoDB. It’s a one thing to read through the text and another to follow up with dynamic videos which walk you through the book’s projects.

Full Stack JavaScript
Full Stack JavaScript

The videos and the source code are open source, meaning they are publicly available. Therefore, you don’t have to buy a book—you can just watch the 14 videos on YouTube (playlist) and go through the code on GitHub (repository).

Continue reading “Full Stack JavaScript”

React for Fun and Profit

React is a fun little library for User Interfaces. You can use it for web, or mobile development. It’s fun because it’s very developer-friendly. You write your code in the same place without having to switch between HTML and JavaScript files.

I’ve heard many times people complaining about React’s favorite syntax JSX. I found it great, after I spent a few hours learning and coding with it. Contrary to what people unfamiliar with React think, JSX is not HTML in JavaScript. JSX is just an XML-like syntax which produces JavaScript. There’s not HTML involved at this step. When you develop with React, you write JavaScript objects. Later React automagically transforms those object into rendered HTML.

Also, React is very fast due to its virtual DOM and smart diffing algorithm. And React’s component approach to architecture allows for great development scalability. Just ask Facebook, Twitter, Slack and other companies with large web apps.

Furthermore, you can use React with React Native to create native iOS and Android apps. These apps can share the same code. It’s not the same as the so called hybrid or HTML5 apps. The latter are websites trapped into a headless browser in a mobile app. The former is a real native app which uses JavaScript interface for it’s UIs and logic.

Hey, you can even use live reloading when developing apps with React Native. Pure joy! The feature native mobile developers can only dream of! “React is fun, but show me the money”— you can yell. Fair enough.

Continue reading “React for Fun and Profit”

Node Interactive 2015

Last week, I presented my talk at the inaugural Node Interactive ’15, in Portland, Oregon. It’s probably the largest Node.js conference in the world! My talk was on Node.js at Capital One. You might wonder: bank and Node.js? What they have in common? The best kept secret, which is not a secret at all is that Capital One, is moving into being a technology company with a focus on finance… not just a bank. It’s worth watching my talk if you’re are interested in hear about challenges of bringing innovation to a large company in a heavily regulated field.

Continue reading “Node Interactive 2015”

ExpressWorks Walkthrough: Node.js Web Framework [VIDEOS]

Have you ever wanted to learn basics of Node.js and the most popular Node.js web framework Express.js? If you are experienced web developer or software engineer who wants to learn Node.js and build some servers along the way, then this self-study workshop is for you.

What is ExpressWorks? It’s an automated tool which allows to learn Express.js from the author of one of the best books on Express.js—Pro Express.js— with this workshop that will teach you basics of Express.js and building Node.js web apps (a.k.a. servers).

You will walk through adventures via command-line interface. Each adventure has a problem, hints, and the solutions.

Some of the resources before you get started:

The entire playlist: on YouTube or just watch individual solutions below. Try solving problems without looking at the solutions!

Setup:

Continue reading “ExpressWorks Walkthrough: Node.js Web Framework [VIDEOS]”