Couple months ago, I was promoted to a ScrumMaster role at DocuSign. In light of it, I decided to brush up on my agile development skills and theory by reading. My choice fell on the highly acclaimed Succeeding with Agile: Software Development Using Scrum by the guru of Agile Development and Scrum — Mike Cohn.
Here is a short overview of the first half of the book, or gist as programmers call it:
A ScrumMaster has more responsibility and authority over processes, but a limited authority over people; the role is akin to a fitness trainer (a yoga teacher analogy fits me better): enforcing the agile process.
Every sprint team needs to deliver shippable (and tested) code: features, bugs, etc.; if the task is too large — split it.
Developers should work with product managers/owners directly on requirements.
Different developers should work on all parts of the application / code base.
Agile is not for the developers who likes to work in privacy putting their headphone and not talking to people (Bummer). :-)
Team functions better with a mix of generalists and specialists; avoid all-specialists teams at all cost.
When possible use feature teams rather than component teams.
Keep teams small. Four to nine people is an optimal size due to the social loafing (having more people reduces average productivity) — this was one of the reason our DocuSign team was split into three smaller teams!
A non-coding architect and project manager are obsolete roles on a Scum team.
Don’t let team members multitask. Each additional task reduces productivity; however, after three and more tasks the reduction becomes smaller and smaller. Direct quote: “Individuals assigned to work on multiple projects inevitably get less done”
To be continued…
What I really liked about the book so far is that it’s not just boring theory. Each point is supported by data, references to sources and personal three-decade-long (anecdotal) experience of the author (Mike Cohn). If you liked the bullet point above, get Kindle Succeeding with Agile on Amazon.
The HackHall project was written using Backbone.js and Underscore for the front-end app, and Express.js, MongoDB via Mongoose for the back-end REST API server.
Dear reader, you are holding a book which will open you to understanding and fluent usage of the Express.js framework – standard de facto in web application programming on Node.js. And I would especially recommend this book because it was written by a practicing engineer, one who has a comprehensive knowledge about the full stack of web application development and Express.js in particular…
Dear reader, you are holding a book which will open you to understanding and fluent usage of the Express.js framework – standard de facto in web application programming on Node.js. And I would especially recommend this book because it was written by a practicing engineer, one who has a comprehensive knowledge about the full stack of web application development and Express.js in particular.
After weeks of writing and editing, Azat and his team are happy to announce the release of Express.js Guide: The Most Popular Node.js Framework Manual! The book is very approachable and suitable for beginners. If someone wants to save time searching the web and learn the best practices from the trenches, Express.js Guide is the book that has everything: Express.js API reference, quick start guides, 20+ meticulously explained examples and tutorials on over 270 pages with more than 60 illustrations.
Express.js is a de facto standard of Node.js development and the most popular NPM library as of today! However, as with any framework, sometimes the learning curve is steep. At HackReactor, I often asked the same questions about code organization, authentication, database connections and deployment.
Todo apps are considered to be quintessential in showcasing frameworks akin to famous Todomvc.com for front-end JavaScript frameworks. In this example, we’ll use Jade, forms, LESS, AJAX/XHR and CSRF.
Todo apps are considered to be quintessential in showcasing frameworks akin to famous Todomvc.com for front-end JavaScript frameworks. In this example, we’ll use Jade, forms, LESS, AJAX/XHR and CSRF.
In our Todo app, we’ll intentionally not use Backbone.js or Angular to demonstrate how to build traditional websites with the use of forms and redirects. In addition to that, we’ll explain how to plug-in CSRF and LESS.
TL;DR: Know and use Markdown because it’s fast and convenient.
Meet Markdown
“What is a Markdown?” my editor asked me the other day. She is an experienced content and copy editor and has worked for magazines and book publishers. However, she is not familiar with the powerful and convenient Markdown because it’s still a rather unknown approach to publishing except for an elite circle of early adopters and technology professionals. Even the so called re-invented web publishing experience Medium doesn’t support Markdown, but many other services and apps including my favorites (ByWord and LeanPub) build their whole flow around Markdown! In fact, I’m such a huge fan of Markdown that I’m writing my daily journals in it as well as this blog post.
For those who aren’t familiar with the context of this quote here is a meme. The meaning is simple: why spend in the magnitude of $150,000 on professional knowledge that is available virtually for free thanks to the Internet?
Choosing a Full Time Programming Course as a Career Change
For those who aren’t familiar with the context of this quote here is a meme. The meaning is simple: why spend in the magnitude of $150,000 on professional knowledge that is available virtually for free thanks to the Internet?
LeanPub Tool — Node.js script for sanitizing and compiling a book’s manuscript. LeanPub uses multi-file book format and a special markdown markup (that confuses Marked app). I found that to convert to MS Word (for editing and other needs) this workflow is the best: 1. run leanpub-tool.js with node.js (node leanpub-tool.js) 2. open file in Marked app and convert to HTML 3. open HTML in MS Word and enjoy.
LeanPub is an awesome publishing platform, but often we need to communicate with other team members involved in the book production, e.g., content and copy editors. In such times, I’ve learned that Guy Kawasaki was right — when we suggested in his book APE: Author, Publisher, Entrepreneur — that author must use MS Word!
The problem is that LeanPub uses multi-file book format and a special markdown markup (that confuses Marked app). I was wrapping up a new revision of the Rapid Prototyping with JS book and previous experience of handing a txt file to an editor was poor. Luckily, Node.js came to help! Through some trail and error attempts, I found this workflow to be the best for converting LeanPub manuscript to a one MS Word file (for editing and other needs):
Run leanpub-tool.js with Node.js (node leanpub-tool.js)
var fs = require('fs');
//change these to YOUR filenames
//probably we can read it from Book.txt but I was too lazy to implement it :-) and somebody might want to compile only sertain parts of the book
var book =[
"frontmatter.txt",
"mainmatter.txt",
"part1.txt",
"chapter1.txt",
"part2.txt",
"chapter2.txt",
"backmatter.txt",
"acknowledgment.txt"
];
var sanitizeText = [
'{frontmatter}',
'{backmatter}',
'{mainmatter}',
"I>## Note",
"T>## Tip",
"W>## Warning",
'{lang="javascript"}',
'{:lang="javascript"}',
'{lang="css"}',
'{:lang="css"}',
'{lang="json"}',
'{lang="ruby"}',
'{lang="php"}',
'{lang="text"}',
'{lang="bash"}',
'{lang="html"}',
"I>",
"T>",
"W>"
]
var str = '';
//read files
book.forEach(function(chapter){
str += fs.readFileSync(chapter,'utf8');
})
//sanitize LeanPub specific Markdown tags
sanitizeText.forEach(function(text){
// console.log(text)
//this loops through while there is not matches
while (new RegExp (text).test(str)) {
str = str.replace(text,'','gm')
};
})
//write output to a file
fs.writeFileSync('leanpub-tool.txt',str);
This is a release candidate for 1.0 version which is going to be available to public in print. Page count has increase from 151 to 211 pages (PDF), which include the following updates:
More digestible (smaller) code examples with better comments
Express.js middleware section with an example
Express.js + MongoDB REST API server section with an example
Derby section with an example
Grammar and typo fixes
Illustrations
Summaries in the beginning of each chapter
Code examples formatting fixes
This is a release candidate for 1.0 version which is going to be available to public in print. Page count has increase from 151 to 211 pages (PDF), which include the following updates:
More digestible (smaller) code examples with better comments
Express.js middleware section with an example
Express.js + MongoDB REST API server section with an example
If you need in-depth knowledge or references, they are usually one click or one Google search away.
Practical aspect included building multiple versions of the Message Board app:
jQuery + Parse.com JS REST API
Backbone and Parse.com JS SDK
Backbone and Node.js
Backbone and Node.js + MongoDB
The Message Board application has all the foundation of a typical web/mobile application: fetching data, displaying it, submitting new data. Other examples include:
Why Backbone.js? Because a lot of people expressed desire to use it but being a framework Backbone has a learning curve. Not a steep one like Rails but still it takes time to master and learn Backbone. The new chapter “Intro to Backbone.js” will show readers how to:
Create Backbone architecture from scratch
Construct proper architecture with Routes
Use Collections
Apply Templates in Subviews
Split code into multiple JS files
Organize code into modules with AMD and Require.js
Here is a list of the update for Rapid Prototyping with JS v0.4:
Brand new chapter: Intro to Backbone.js
Re-structured table of contents (chapters and parts)
Extended list of resources for further reading
Fixed code formatting and highlighting
Fixed grammar, style and typos mistakes
Brand new book cover optimized for ebook format
Reduced size of ebook (faster download)
Inspirational quotes in each chapter
Updated “Basics” chapter
New headline “Agile JavaScript Development”
Extended list of ways to reach us (Twitter, Facebook, Storify, etc.)
LeanPub Updates
LeanPub changed their purchasing. Now it’s even better for readers. Anybody can “return” the book they didn’t like within 45 days and get a full refund. Word return is in double quotes because all content is Digital Right Management (DRM) free. Does it mean that somebody can buy and download a book, get their money back, but keep the copy? Yes, but they will get bad karma for that! And not like a bad karma on Hacker News but a real bad karma. Everybody else deservers authors and publishers trust and respect.
Backbone.js
Why Backbone.js? Because a lot of people expressed desire to use it but being a framework Backbone has a learning curve. Not a steep one like Rails but still it takes time to master and learn Backbone. The new chapter “Intro to Backbone.js” will show readers how to:
Create Backbone architecture from scratch
Construct proper architecture with Routes
Use Collections
Apply Templates in Subviews
Split code into multiple JS files
Organize code into modules with AMD and Require.js
Free sample chapter of Rapid Prototyping with JS which is a hands-on book which introduces you to rapid software prototyping using the latest cutting-edge web and mobile technologies including NodeJS, MongoDB, BackboneJS, Twitter Bootstrap, LESS, jQuery, Parse.com, Heroku and others.
Here is a free sample, first chapter — Introduction, of Rapid Prototyping with JS. You can also get a free PDF from LeanPub and explore code examples at github.com/azat-co/rpjs. To buy a full version in PDF, Mobi/Kindle and ePub/iPad formats go to leanpub.com/rapid-prototyping-with-js.
Introduction
Rapid Prototyping with JS is a hands-on book which introduces you to rapid software prototyping using the latest cutting-edge web and mobile technologies including Node.js, MongoDB, Twitter Bootstrap, LESS, jQuery, Parse.com, Heroku and others.
Who This Book is For
The book is designed for advanced-beginner and intermediate level web and mobile developers: somebody who has just started programming and somebody who is an expert in other languages like Ruby on Rails, PHP, and Java and wants to learn JavaScript and Node.js.
Rapid Prototyping with JS, as you can tell from the name, is about taking your idea to a functional prototype in the form of a web or a mobile application as fast as possible. This thinking adheres to the Lean Startup methodology; therefore, this book would be more valuable to startup founders, but big companies’ employees might also find it useful, especially if they plan to add new skills to their resume.
Prerequisite
Mac OS X or UNIX/Linux systems are highly recommended for this book’s examples and for web development in general, although it’s still possible to hack your way on a Windows-based system.
Some cloud services require users’ credit/debit card information even for free accounts.
What to Expect
Expect a lot of coding and not much of a theory. All the theory we cover is directly related to some of the practical aspects and essential for better understanding of technologies and specific approaches in dealing with them, e.g., JSONP and cross-domain calls.
In addition to coding examples, the book covers virtually all setup and deployment step-by-step.
You’ll learn on the example of Message Board web/mobile applications starting with front-end components. There are a few versions of these applications, but by the end we’ll put front-end and back-end together and deploy to production environment. The Message Board application contains all the necessary components typical for a basic web app, and will give you enough confidence to continue developing on your own, apply for a job/promotion or build a startup!
This is a digital version of the book, so most of the links are hidden just like on any other web page, e.g., jQuery instead of http://jquery.com. The content of the book has local hyperlinks which allow you to jump to any section.
All the source code for examples used in this book is available in the book as well as in a public GitHub repository github.com/azat-co/rpjs. You can also download files as a ZIP archive or use Git to pull them. More on how to install and use Git will be covered later in the book. The source code files, folder structure and deployment files are supposed to work locally and/or remotely on PaaS solutions, i.e., Windows Azure and Heroku, with minor or no modifications.
Notation
This is what source code blocks look like:
var object = {};
object.name = "Bob";
Terminal commands have a similar look but start with dollar sign, $:
$ git push origin heroku
$ cd /etc/
$ ls
Inline filenames, path/folder names, quotes and special words/names are italicized while command names, e.g., mongod, and emphasized words, e.g., Note, are bold.
Web Basics
Overview
The bigger picture of web and mobile application development consists of the following steps:
User types a URL or follows a link in her browser (aka client);
Browser makes HTTP request to the server;
Server processes the request, and if there’re any parameters in a query string and/or body of the request takes them into account;
Server updates/gets/transforms data in the database;
Server responds with HTTP response containing data in HTML, JSON or other formats;
Browser receives HTTP response;
Browser renders HTTP response to the user in HTML or any other format, e.g., JPEG, XML, JSON.
Mobile applications act in the same manner as regular websites, only instead of a browser there might be a native app. Other minor differences include: data transfer limitation due to carrier bandwidth, smaller screens, and the more efficient use of the local storage.
There are a few approaches to mobile development, each with its own advantages and disadvantages:
Native iOS, Android, Blackberry apps build with Objective-C and Java;
Native apps build with JavaScript in Appcelerator and then complied into native Objective-C or Java;
Mobile websites tailored for smaller screens with responsive design, CSS frameworks like Twitter Bootstrap or Foundation, regular CSS or different templates;
HTML5 apps which consists of HTML, CSS and JavaScript, and are usually build with frameworks like Sencha Touch, Trigger.io, JO, and then wrapped into native app with PhoneGap.
Hyper Text Markup Language
Hyper Text Markup Language, or HTML, is not a programming language in itself. It is a set of markup tags which describes the content and presents it in a structured and formatted way. HTML tags consist of a tag name inside of the angle brackets (<>). In most cases tags surround the content with the end tag having forward slash before the tag name.
In this example each line is an HTML element:
<h2>Overview of HTML</h2>
<div>HTML is a ...</div>
<link rel="stylesheet" type="text/css" href="style.css" />
The HTML document itself is an element of html tag and all other elements are children of that html tag:
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<h2>Overview of HTML</h2>
<p>HTML is a ...</p>
</body>
</html>
There are different flavors and versions of HTML, e.g., DHTML, XHTML 1.0, XHTML 1.1, XHTML 2, HTML 4, HTML 5. This article does a good job of explaining the differences — Misunderstanding Markup: XHTML 2/HTML 5 Comic Strip.
Cascading Style Sheets, or CSS, is a way to format and present content. An HTML document can have several stylesheets with the tag link as in previous examples or style tag:
<style>
body {
padding-top: 60px; /* 60px to make some space */
}
</style>
Each HTML element can have id and class attribute:
<div id="main" class="large">Lorem ipsum dolor sit amet, Duis sit amet neque eu.</div>
In CSS we access elements by their id, class, tag name and in some edge cases by parent-child relationship or element attribute value:
p {
color:#999999;
}
div#main {
padding-bottom:2em;
padding-top:3em;
}
.large {
font-size:14pt;
}
body > div {
display:none;
}
input[name="email"] {
width:150px;
}
More information for further reading is available at Wikipedia and w3schools.
CSS3 is an upgrade to CSS which includes new ways of doing things such as rounded corners, borders and gradients, which were possible in regular CSS only with the help of PNG/GIF images and by using other tricks.
JavaScript was started in 1995 at Netscape as LiveScript. It has the same relationship with Java as a hamster and a ham :)
It is used for both client and server side development as well as in desktop applications.
There is a script tag to use JavaScript in the HTML document:
DOM objects, e.g., var table = document.createElement('table');
Full JavaScript and DOM objects and classes reference with examples are available at w3school.
Typical syntax for function declaration:
function Sum(a,b) {
var sum = a+b;
return sum;
}
console.log(Sum(1,2));
Functions in JavaScript are first-class citizens due to functional programming nature of the language. Therefore functions can be used as other variables/objects; for example, functions can be passed to other functions as arguments:
var f = function (str1){
return function(str2){
return str1+' '+str2;
};
};
var a = f('hello');
var b = f('goodbye');
console.log((a('Catty'));
console.log((b('Doggy'));
JavaScript has a loose/weak typing, as opposed to strong typing in languages like C and Java, which makes JavaScript a better programming language for prototyping.
More information about browser-run JavaScript is available at Wikipedia and w3schools.
Agile Methodologies
Agile software development methodology evolved due to the fact that traditional methods, like Waterfall, weren’t good enough in situations of high unpredictability, i.e., when the solution is unknown. Agile methodology includes Scrum/Sprint, Test-Driven Development, Continuous Deployment, Paired Programming and other practical techniques many of which were borrowed from Extreme Programming.
Scrum
In regard to the management, Agile methodology uses Scrum approach. More about Scrum can be read at:
Scrum methodology is a sequence of short cycles, and each cycle is called sprint. One sprint usually lasts from one to two weeks. Sprint starts and ends with sprint planning meeting where new tasks can be assigned to team members. New tasks cannot be added to the sprint in progress; they can be added only at the sprint meetings.
An essential part of the Scrum methodology is the daily scrum meeting, hence the name. Each scrum is a 5–15 minutes long meeting which is often conducted in the hallways. On scrum meetings each team member answers three questions:
What have you done since yesterday?
What are you going to do today?
Do you need anything from other team members?
Flexibility makes Agile an improvement over Waterfall methodology, especially in situations of high uncertainty, i.e., startups.
Advantage of Scrum methodology: effective where it is hard to plan ahead of the time, and also in situations where a feedback loop is used as a main decision-making authority.
Test-Driven Development
Test-Driven Development, or TDD, consists of following steps:
Write failing automated test cases for new feature/task or enhancement by using assertions that are either true or false.
Write code to successfully pass the test cases.
Refactor code if needed, and add functionality while keeping the test cases passed.
Repeat until the task is complete.
Advantages of Test-Driven Development:
fewer bugs/defects,
more efficient codebase,
provides programmers with confidence that code works and doesn’t break old functionality.
Continuous Deployment
Continuous Deployment, or CD, is the set of techniques to rapidly deliver new features, bug fixes, and enhancements to the customers. CD includes automated testing and automated deployment. By utilizing Continuous Deployment the manual overheard is decreased, and the feedback loop time is minimized. Basically, the faster developer can get the feedback from the customers, the sooner the product can pivot, which leads to more advantages over the competition. Many startups deploy multiple times in a single day in comparison to the 6–12 month release cycle which is still typical for corporations and big companies.
One of the most popular solutions for CD is Continuous Integration server Jenkins.
Advantages of Continuous Deployment approach: decreases feedback loop time and manual labor overhead.
Pair Programming
Pair Programming is a technique when two developers work together on one machine. One of the developers is a driver and the other is observer. The driver writes the code and the observer watches it, assists, and makes suggestions. Then they switch the roles. The driver has a more tactical role of focusing on the current task. In contrast, the observer has a more strategic role overseeing “the bigger picture,” and the ways to improve the codebase and to make it more efficient.
Advantages of Paired Programming:
Pair attributes to shorter and more efficient codebase, and introduces fewer bugs and defects.
As an added bonus, knowledge is passed along programmers as they work together. However, situations of conflicts between developers are possible.
Node.js
Node.js is an event-driven asynchronous I/O server-side technology for building scalable and efficient web servers. Node.js consists of Google’s V8 JavaScript engine.
The purpose and use of Node.js is similar to Twisted for Python and EventMachine for Ruby. The JavaScript implementation of Node was the third one after attempts at using the Ruby and C++ programming languages.
Node.js is not in itself a framework like Ruby on Rails; it’s more comparable to the pair PHP+Apache. Here are some of Node.js frameworks: Express, Meteor, Tower.js, Railsway JS, Geddy, Derby.
Advantages of using NodeJS:
Developers have high chances of familiarity with JavaScript due to its status as a de facto standard of the application development for web and mobile.
One language for front-end and back-end development speeds up coding process. A developer’s brain doesn’t have to switch between different syntaxes. The learning of methods and classes goes faster.
With NodeJS, you could prototype quickly and go to market to do your customer development and customer acquisition early. This is an important competitive advantage over the other companies, which use less agile technologies, e.g., PHP and MySQL.
NodeJS is build to support real-time applications by utilizing web-sockets.
MongoDB, from huMONGOus, is a high-performance no-relationship database for huge data. NoSQL concept came out when traditional Relational Database Management Systems, or RDBMS, were unable to meet the challenges of huge amounts of data.
Advantages of using MongoDB:
Scalable due to distributed nature: multiple servers and data centers could have redundant data.
High-performance: MongoDB is very effective for storing and retrieving data, not the relationship between elements.
Key-value store is ideal for prototyping because it doesn’t require one to know the schema and there is no need for a fixed data model.
Cloud Computing
Could computing consists of:
Infrastructure as s Service (IaaS), e.g., Rackspace, Amazon Web Services;
Platform as a Service (PaaS), e.g., Heroku, Windows Azure;
Software as a Service (SaaS), e.g., Google Apps, Salesforce.com.
Cloud application platforms provide:
scalability, e.g., spawn new instances in a matter of minutes;
easy deployment, e.g., to push to Heroku you can just use $ git push;
pay-as-you-go plan: add or remove memory and disk space based on demands;
usually there is no need to install and configure databases, app servers, packages, etc.;
security and support.
PaaS are ideal for prototyping, building minimal viable products (MVP) and for early stage startups in general.
Each HTTP Request and Response consists of the following components:
Header: information about encoding, length of the body, origin, content type, etc.;
Body: content, usually parameters or data which is passed to the server or sent back to a client;
In addition, HTTP Request contains:
Method: There are several methods; the most common are GET, POST, PUT, DELETE.
URL: host, port, path;
Query string, i.e., everything after a question mark in the URL.
RESTful API
RESTful (REpresentational State Transfer) API became popular due to the demand in distributed systems where each transaction needs to include enough information about the state of the client. In a sense this standard is stateless because no information about the clients’ state is stored on the server, thus making it possible for each request to be served by a different system.
Distinct characteristics of RESTful API:
Has better scalability support due to the fact that different components can be independently deployed to different servers;
Replaced Simple Object Access Protocol (SOAP) because of the simpler verb and noun structure;
Utilizes HTTP methods: GET, POST, DELETE, PUT, OPTIONS etc.
Here is an example of simple Create, Read, Update and Delete (CRUD) REST API for Message Collection:
Method
URL
Meaning
GET
/messages.json
Return list of messages in JSON format
PUT
/messages.json
Update/replace all messages and return status/error in JSON
POST
/messages.json
Create new message and return its id in JSON format
GET
/messages/{id}.json
Return message with id {id} in JSON format
PUT
/messages/{id}.json
Update/replace message with id {id}, if {id} message doesn’t exists create it
DELETE
/messages/{id}.json
Delete message with id {id}, return status/error in JSON format
REST is not a protocol; it is an architecture in the sense that it’s more flexible than SOAP, which is a protocol. Therefore, REST API URLs could look like /messages/list.html or /messages/list.xml in case we want to support these formats.
PUT and DELETE are idempotent methods, which means that if the server receives two or more similar requests, the end result will be the same.
GET is nullipotent and POST is not idempotent and might affect state and cause side-effects.
Get a free copy of Rapid Prototyping with JS and provide us your competent feedback to help prepare for the new revision and publishing on Amazon.com. First 50 people to submit an application and qualify will receive a coupon for free download of Rapid Prototyping with JS.
Call for Reviewers and a Free Copy
Get a free copy of Rapid Prototyping with JS and provide us your competent feedback to help prepare for the new revision and publishing on Amazon.com. First 50 people to submit an application and qualify will receive a coupon for free download of Rapid Prototyping with JS.
Send your feedback to (instructions will be provided later).
About Rapid Prototyping with JS
Rapid Prototyping with JS is a hands-on book which introduces you to rapid software prototyping using the latest cutting-edge web and mobile technologies including NodeJS, MongoDB, BackboneJS, Twitter Bootstrap, LESS, jQuery, Parse.com, Heroku and others.
50% Off During Holidays
By the way, you can get Rapid Prototyping with JS ebook in PDF, Kindle/Mobi, iPad/ePub formats and future updates for 50% off during holidays at https://leanpub.com/rapid-prototyping-with-js/.