10 books every web developer should read to increase their software IQ

When wannabe developers ask what books they should read, I usually respond “First off, just read.” A large part of the software development process is reading other people’s’ code. That said, the best thing you can do to improve as a developer is to read anything that will sharpen your speed and comprehension skills.  The more effective you become at reading, the more efficient you will become in your day-to-day work building software.  The following however, are books that if you have not yet read them, will have the most significant impact on your software IQ.

Moonwalking with Einstein by Joshua Foer and Mike Chamberlain – Google is great, but for all the convenience it offers, it really has deteriorated true learning. Why memorize what you can look up, right? And, if you don’t have a solid understanding of how to improve your memory, you really have no other option. Most developers are not taught memorization techniques and never even make an attempt to get better. As a result, mobile devices have become a crutch, and it shows. Today’s developers struggle to produce more than a few lines of code without referencing Google and then StackOverflow. Looking up language nuances or a specification when you are coding is a time sink. Guessing the signature of a function a few times and then looking it up is an even bigger time sink. But there is another way. This book teaches specific tactics to get the most out of focus, chunking, and repetition so that when you have to recall shortcut keystrokes, status codes, or the arguments to a function, you can do so easily. The author reveals tips about how humans with the best trained memories compete in memorization competitions and how he learned techniques over a very short period of time.

You Don’t Know JS by Kyle Simpson – This is a series of books that collectively should be treated as the bible for JavaScript. Every JS developer should read it and maintain a copy in the closest night stand drawer. The author has even provided the full copy of each book online if you would like to read it for free on GitHub. It’s a tough read, and slow going for most. The volumes are each little booklets that usually require a couple of passes to absorb it all, but each of the 7 volumes will deepen your knowledge of some of the trickier parts of JavaScript.

Clean Code by Robert C. Martin – The author of this book is referred to with reverence in the software community as “Uncle Bob” and is well known for his numerous conference talks about writing well organized and maintainable code. After reading this book developers will likely spend more time thinking about why we write code in a particular way and what that our styles and habits say about the seriousness of our approach to the craft. Uncle Bob’s principles will allow you to identify code smells (the difference between good code and bad), and better yet, a process you can use to clean up and refactor your code to make it more readable and maintainable.

Software Craftsmanship: The New Imperative by Pete McBreen – The principles in this book align well with Clean Code. It differs in that it talks more about the art, than the science of software. Reading it will help developers figure out how to deliver value to customers via software. It addresses collaboration with stakeholders, project management, and more of the soft skills that are needed to really be a master at the craft. There is even a chapter on managing software craftsmen that will help developers better understand the relationship between those that code and those that lead.

7 Languages in 7 Weeks: A Pragmatic Guide to Learning Programming Languages by Bruce Tate – The ability to learn fast and pick up new languages gives developers a real edge in today’s market. This book will help developers become decent at reading the code of these new languages, and understand the role they play, even if you’re not planning to become a polyglot (one who has mastered many languages). The point to learning a bit of 7 languages in 7 weeks is to gain a generalist’s knowledge. This allows a developer to better compare and contrast languages, and should strengthen the mastery of those used more regularly. If you’re curious about the 7 languages that are covered in the book, it examines Clojure, Haskell, Io, Prolog, Scala, Erlang, and Ruby. Using this 7 week approach you will learn, or be reminded of, programing paradigms that have evolved over time. Many have strengths that make the languages best suited to solve particular types of challenges. Others demonstrate the fad-like nature of how engineers work for a few decades, and then collectively decide the old way is boring, and the new way is “the only way” to code well. JavaScript programming, for example, can be done in a functional, object oriented, or procedural style. This book will inspire you to take a look at languages that are more focused on one or two of those methods and take a deeper dive into how each language implements common design patterns.

7 Databases in 7 Weeks: A Guide to Modern Databases and the NoSQL Movement by Eric Redmond and Jim Wilson – By gaining exposure to 7 different databases, developers can broaden their ability to pick the right database solution for each new problem they encounter, versus feeling stuck with using the one or two solutions that are most familiar to them. This book will give developers the confidence to conquer building applications using any database. Even those databases that first appear to be unique will suddenly seem very similar to those used quite commonly by today’s developer community.

JavaScript the Good Parts by Douglas Crockford – JavaScript is moving really fast these days. So fast, that some people skip learning the basics and focus on mastering frameworks and libraries before they have a deep understanding of “vanilla” or pure JavaScript. In this book you will go back to basics and learn many of JavaScript’s nuances and what pitfalls to avoid. Since there are so many libraries and frameworks, software developers need to be able to evaluate libraries and frameworks quickly. This book serves as a guide for best practices. Even if you decide not to follow them, understanding Douglas’ decision making process and rational will help you get better at evaluating other people’s code. It will help you refine your ability to not just say what you don’t like, but articulate why. Understanding why some areas of JavaScript should be avoided will also help you craft better software, and think more about design patterns that will stand the test of time.

Think and Grow Rich by Napoleon Hill – Success in software development parallels success in life. The principles that you can learn and see practical application of in this book will make you more productive and mentally successful. Personal and professional achievement requires a productive thought process and success oriented mentality. This book was published almost a century ago, but its stories are just as applicable to the life of a success-minded individual today.

How to Win Friends and Influence People by Dale Carnegie – From an outsider’s perspective writing code is thought to be one of the most important skills of a software engineer. However, being able to listen and communicate effectively is far more important. Simply having a great idea or design for how to build something is wonderful, but being able to effectively communicate that idea, get buy-in and the “green light” to build is another. This book will provide anyone – even developers – with the tools to negotiate and be empathetic to stakeholders. Use this book to get better at setting and managing expectations. After reading and practicing the techniques you will be well-equipped to understand others and motivate them to embrace your solutions, so you can spend more time building things you love.

HTML & CSS: Design and Build Web Sites by Jon Duckett – This is the book you will set on your office coffee table, and every time you pick it up you will learn something new. It is not a book you will read cover to cover, but it is one that you will return to frequently and digest it in small chunks. It is beautifully illustrated and the examples of code make HTML come alive. As much as we like to think we know the fundamentals, this book is packed with implementations of HTML and CSS specifications that developers can come back to over-and-over and still learn each time. Use it like a dictionary to look something up (when Google is not handy), or when you just want to refine your knowledge of designing websites.  On your coffee table it will make you look like the hipster coder we all aspire to be.

10 books every web developer should read to increase their software IQ

When wannabe developers ask what books they should read, I usually respond “First off, just read.” A large part of the software development process is reading other people’s’ code. That said, the best thing you can do to improve as a developer is to read anything that will sharpen your speed and comprehension skills.  The more effective you become at reading, the more efficient you will become in your day-to-day work building software.  The following however, are books that if you have not yet read them, will have the most significant impact on your software IQ.

Moonwalking with Einstein by Joshua Foer and Mike Chamberlain – Google is great, but for all the convenience it offers, it really has deteriorated true learning. Why memorize what you can look up, right? And, if you don’t have a solid understanding of how to improve your memory, you really have no other option. Most developers are not taught memorization techniques and never even make an attempt to get better. As a result, mobile devices have become a crutch, and it shows. Today’s developers struggle to produce more than a few lines of code without referencing Google and then StackOverflow. Looking up language nuances or a specification when you are coding is a time sink. Guessing the signature of a function a few times and then looking it up is an even bigger time sink. But there is another way. This book teaches specific tactics to get the most out of focus, chunking, and repetition so that when you have to recall shortcut keystrokes, status codes, or the arguments to a function, you can do so easily. The author reveals tips about how humans with the best trained memories compete in memorization competitions and how he learned techniques over a very short period of time.

You Don’t Know JS by Kyle Simpson – This is a series of books that collectively should be treated as the bible for JavaScript. Every JS developer should read it and maintain a copy in the closest night stand drawer. The author has even provided the full copy of each book online if you would like to read it for free on GitHub. It’s a tough read, and slow going for most. The volumes are each little booklets that usually require a couple of passes to absorb it all, but each of the 7 volumes will deepen your knowledge of some of the trickier parts of JavaScript.

Clean Code by Robert C. Martin – The author of this book is referred to with reverence in the software community as “Uncle Bob” and is well known for his numerous conference talks about writing well organized and maintainable code. After reading this book developers will likely spend more time thinking about why we write code in a particular way and what that our styles and habits say about the seriousness of our approach to the craft. Uncle Bob’s principles will allow you to identify code smells (the difference between good code and bad), and better yet, a process you can use to clean up and refactor your code to make it more readable and maintainable.

Software Craftsmanship: The New Imperative by Pete McBreen – The principles in this book align well with Clean Code. It differs in that it talks more about the art, than the science of software. Reading it will help developers figure out how to deliver value to customers via software. It addresses collaboration with stakeholders, project management, and more of the soft skills that are needed to really be a master at the craft. There is even a chapter on managing software craftsmen that will help developers better understand the relationship between those that code and those that lead.

7 Languages in 7 Weeks: A Pragmatic Guide to Learning Programming Languages by Bruce Tate – The ability to learn fast and pick up new languages gives developers a real edge in today’s market. This book will help developers become decent at reading the code of these new languages, and understand the role they play, even if you’re not planning to become a polyglot (one who has mastered many languages). The point to learning a bit of 7 languages in 7 weeks is to gain a generalist’s knowledge. This allows a developer to better compare and contrast languages, and should strengthen the mastery of those used more regularly. If you’re curious about the 7 languages that are covered in the book, it examines Clojure, Haskell, Io, Prolog, Scala, Erlang, and Ruby. Using this 7 week approach you will learn, or be reminded of, programing paradigms that have evolved over time. Many have strengths that make the languages best suited to solve particular types of challenges. Others demonstrate the fad-like nature of how engineers work for a few decades, and then collectively decide the old way is boring, and the new way is “the only way” to code well. JavaScript programming, for example, can be done in a functional, object oriented, or procedural style. This book will inspire you to take a look at languages that are more focused on one or two of those methods and take a deeper dive into how each language implements common design patterns.

7 Databases in 7 Weeks: A Guide to Modern Databases and the NoSQL Movement by Eric Redmond and Jim Wilson – By gaining exposure to 7 different databases, developers can broaden their ability to pick the right database solution for each new problem they encounter, versus feeling stuck with using the one or two solutions that are most familiar to them. This book will give developers the confidence to conquer building applications using any database. Even those databases that first appear to be unique will suddenly seem very similar to those used quite commonly by today’s developer community.

JavaScript the Good Parts by Douglas Crockford – JavaScript is moving really fast these days. So fast, that some people skip learning the basics and focus on mastering frameworks and libraries before they have a deep understanding of “vanilla” or pure JavaScript. In this book you will go back to basics and learn many of JavaScript’s nuances and what pitfalls to avoid. Since there are so many libraries and frameworks, software developers need to be able to evaluate libraries and frameworks quickly. This book serves as a guide for best practices. Even if you decide not to follow them, understanding Douglas’ decision making process and rational will help you get better at evaluating other people’s code. It will help you refine your ability to not just say what you don’t like, but articulate why. Understanding why some areas of JavaScript should be avoided will also help you craft better software, and think more about design patterns that will stand the test of time.

Think and Grow Rich by Napoleon Hill – Success in software development parallels success in life. The principles that you can learn and see practical application of in this book will make you more productive and mentally successful. Personal and professional achievement requires a productive thought process and success oriented mentality. This book was published almost a century ago, but its stories are just as applicable to the life of a success-minded individual today.

How to Win Friends and Influence People by Dale Carnegie – From an outsider’s perspective writing code is thought to be one of the most important skills of a software engineer. However, being able to listen and communicate effectively is far more important. Simply having a great idea or design for how to build something is wonderful, but being able to effectively communicate that idea, get buy-in and the “green light” to build is another. This book will provide anyone – even developers – with the tools to negotiate and be empathetic to stakeholders. Use this book to get better at setting and managing expectations. After reading and practicing the techniques you will be well-equipped to understand others and motivate them to embrace your solutions, so you can spend more time building things you love.

HTML & CSS: Design and Build Web Sites by Jon Duckett – This is the book you will set on your office coffee table, and every time you pick it up you will learn something new. It is not a book you will read cover to cover, but it is one that you will return to frequently and digest it in small chunks. It is beautifully illustrated and the examples of code make HTML come alive. As much as we like to think we know the fundamentals, this book is packed with implementations of HTML and CSS specifications that developers can come back to over-and-over and still learn each time. Use it like a dictionary to look something up (when Google is not handy), or when you just want to refine your knowledge of designing websites.  On your coffee table it will make you look like the hipster coder we all aspire to be.

How to Know if You Should Enroll in Coding Bootcamp

From Fullstack Academy and Bloc to Firehose Project, there are a number of top-tier online options for learning and growing coding skills. More and more programs seem to be popping up every day as employers continue to emphasize coding ability as an in-demand skill and must-have talent for new hires. Coding bootcamps are designed to help novice or veteran coders level up their knowledge through regimented or self-paced programs that offer mentorship and check ins until course completion.

Why sign up for a coding bootcamp? They are a significant investment of time and money, so you want to be sure that you’re getting an appropriate ROI on your efforts. If you’re unsure, consider where you are in your professional journey. Here are three moments in your career where a coding bootcamp can make all the difference.

You’re Starting Out

Recent college graduates pursuing jobs in development may be met with an optimistic hiring outlook, but that doesn’t necessarily mean they have the skills to excel once they start their new roles. Recent grads may have studied computer science or coding-specific concentrations in college, but that background doesn’t automatically translate to the specific programming languages they’ll be using day-in and day-out at their company. Internship experience may help students better specialize, but coding bootcamps can take that knowledge one step further.

A young developer offered his or her first job in development might consider signing up for a coding bootcamp to firm up and hone their knowledge of the programming language or development area they’ll be spending time in. Coding bootcamps can help reinforce and grow skills that will be directly applied at work. Telling a supervisor about enrolling in an online coding bootcamp as a new hire can show a commitment to catching up to other coders and make a good first impression of applied work ethic.

You’re Transitioning

It’s never too late to make a pivot in your development career. If you’ve built your career in web development but want to move to mobile, for example, you might consider an online coding bootcamp. These programs can help you learn skills like iOS and Android at your own pace, while keeping your day job. They can help you decide if you really want to switch focuses by giving you a taste of what working in your prospective new area of development would look like. Coding bootcamps are a great option if you’re looking to make a transition in your career because they can help you discover if a move is right for you before applying to new positions.

If you are looking to transition roles to an area in which you have little experience, coding bootcamps can offer some evidence that you’re qualified and committed to learning more about that area to any potential hiring manager.

You’re Going Solo

Coding bootcamp certifications can help level up your resume at any stage of your career. If you’re moving to freelancing, coding bootcamps can round out and expand your knowledge to help you take on new projects with ease. Having a coding certification on your resume can show any potential clients that you’re capable of doing work in that area and would feel comfortable taking on their projects with that focus.

Coding bootcamps are a great resource for building coding skills on your own time. Participating in the online or in-person programs when you’re starting out, transitioning, or striking out on your own can give you added skills to succeed in any new position.

If you’re looking for new opportunities in development right now, look no further than Stack Overflow Jobs for thousands of roles for developers at every stage of their careers.

Source: stackoverflow.blog

Why Machine Learning Isn’t As Hard To Learn As You Think

Why is Machine Learning difficult to understand? originally appeared on Quorathe place to gain and share knowledge, empowering people to learn from others and better understand the world.

Answer by John L. Miller, Industry ML experience with video, sensor data, images. PhD. Microsoft, Google, on Quora:

I’m usually the first person to say something is hard, but I’m not going to here. Learning how to use machine learning isn’t any harder than learning any other set of libraries for a programmer.

The key is to focus on using it, not designing the algorithm. Look at it this way: if you need to sort data, you don’t invent a sort algorithm, you pick an appropriate algorithm and use it right.

It’s the same thing with machine learning. You don’t need to learn how the guts of the machine learning algorithm works. You need to learn what the main choices are (e.g. neural nets, random decision forests…), how to feed them data, and how to use the data produced.

There is a bit of an art to it: deciding when you can and can’t use machine learning, and figuring out the right data to feed into it. For example, if you want to know whether a movie shows someone running, you might want to send both individual frames, and sets of frame deltas a certain number of seconds apart.

If you’re a programmer and it’s incredibly hard to learn ML, you’re probably trying to learn the wrong things about it.

This question originally appeared on Quora – the place to gain and share knowledge, empowering people to learn from others and better understand the world.

In this article, you will learn how you can simplify your callback or Promise based Node.js application with async functions (async/await).

Asynchronous language constructs have been around in other languages for a while, like async/await in C#, coroutines in Kotlin and goroutines in Go. With the release of Node.js 8, the long awaited async functions have landed in Node.js as well.

By the end of this tutorial, you should be able to answer the following question too:

What are async functions in Node?

Async function declarations return an AsyncFunction object. These are similar to Generator-s in the sense that their execution can be halted. The only difference is that they always return a Promiseinstead of a { value: any, done: Boolean } object. In fact, they are so similar that you could gain similar functionality using the co package.

In an async function, you can await for any Promise or catch its rejection cause.

So if you had some logic implemented with promises:

function handler (req, res) {  
  return request('https://user-handler-service')
    .catch((err) => {
      logger.error('Http error', err)
      error.logged = true
      throw err
    })
    .then((response) => Mongo.findOne({ user: response.body.user }))
    .catch((err) => {
      !error.logged && logger.error('Mongo error', err)
      error.logged = true
      throw err
    })
    .then((document) => executeLogic(req, res, document))
    .catch((err) => {
      !error.logged && console.error(err)
      res.status(500).send()
    })
}

You can make it look like synchronous code using async/await:

async function handler (req, res) {  
  let response
  try {
    response = await request('https://user-handler-service')  
  } catch (err) {
    logger.error('Http error', err)
    return res.status(500).send()
  }

  let document
  try {
    document = await Mongo.findOne({ user: response.body.user })
  } catch (err) {
    logger.error('Mongo error', err)
    return res.status(500).send()
  }

  executeLogic(document, req, res)
}

In older versions of V8, unhandled promise rejections were silently dropped. Now at least you get a warning from Node, so you don’t necessarily need to bother with creating a listener. However, it is recommended to crash your app in this case as when you don’t handle an error, your app is in an unknown state:

process.on('unhandledRejection', (err) => {  
  console.error(err)
  process.exit(1)
})

Patterns with async functions

There are quite a couple of use cases when the ability to handle asynchronous operations as if they were synchronous comes very handy, as solving them with Promises or callbacks requires the use of complex patterns or external libraries.

These are cases when you need to loop through asynchronously gained data or use if-else conditionals.

Retry with exponential backoff

Implementing retry logic was pretty clumsy with Promises:

function requestWithRetry (url, retryCount) {  
  if (retryCount) {
    return new Promise((resolve, reject) => {
      const timeout = Math.pow(2, retryCount)

      setTimeout(() => {
        console.log('Waiting', timeout, 'ms')
        _requestWithRetry(url, retryCount)
          .then(resolve)
          .catch(reject)
      }, timeout)
    })
  } else {
    return _requestWithRetry(url, 0)
  }
}

function _requestWithRetry (url, retryCount) {  
  return request(url, retryCount)
    .catch((err) => {
      if (err.statusCode && err.statusCode >= 500) {
        console.log('Retrying', err.message, retryCount)
        return requestWithRetry(url, ++retryCount)
      }
      throw err
    })
}

requestWithRetry('http://localhost:3000')  
  .then((res) => {
    console.log(res)
  })
  .catch(err => {
    console.error(err)
  })

It gave me a headache just to look at it. We can rewrite it with async/await and make it a lot more simple.

function wait (timeout) {  
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve()
    }, timeout)
  })
}

async function requestWithRetry (url) {  
  const MAX_RETRIES = 10
  for (let i = 0; i <= MAX_RETRIES; i++) {
    try {
      return await request(url)
    } catch (err) {
      const timeout = Math.pow(2, i)
      console.log('Waiting', timeout, 'ms')
      await wait(timeout)
      console.log('Retrying', err.message, i)
    }
  }
}

A lot more pleasing to the eye isn’t it?

Intermediate values

Not as hideous as the previous example, but if you have a case where 3 asynchronous functions depend on each other the following way, then you have to choose from several ugly solutions.

functionA returns a Promise, then functionB needs that value and functionC needs the resolved value of both functionA‘s and functionB‘s Promise.

Solution 1: The .then Christmas tree
function executeAsyncTask () {  
  return functionA()
    .then((valueA) => {
      return functionB(valueA)
        .then((valueB) => {          
          return functionC(valueA, valueB)
        })
    })
}

With this solution, we get valueA from the surrounding closure of the 3rd then and valueB as the value the previous Promise resolves to. We cannot flatten out the Christmas tree as we would lose the closure and valueA would be unavailable for functionC.

Solution 2: Moving to a higher scope
function executeAsyncTask () {  
  let valueA
  return functionA()
    .then((v) => {
      valueA = v
      return functionB(valueA)
    })
    .then((valueB) => {
      return functionC(valueA, valueB)
    })
}

In the Christmas tree, we used a higher scope to make valueAavailable as well. This case works similarly, but now we created the variable valueA outside the scope of the .then-s, so we can assign the value of the first resolved Promise to it.

This one definitely works, flattens the .then chain and is semantically correct. However, it also opens up ways for new bugs in case the variable name valueA is used elsewhere in the function. We also need to use two names — valueA and v — for the same value.

Solution 3: The unnecessary array
function executeAsyncTask () {  
  return functionA()
    .then(valueA => {
      return Promise.all([valueA, functionB(valueA)])
    })
    .then(([valueA, valueB]) => {
      return functionC(valueA, valueB)
    })
}

There is no other reason for valueA to be passed on in an array together with the Promise functionB then to be able to flatten the tree. They might be of completely different types, so there is a high probability of them not belonging to an array at all.

Solution 4: Write a helper function
const converge = (...promises) => (...args) => {  
  let [head, ...tail] = promises
  if (tail.length) {
    return head(...args)
      .then((value) => converge(...tail)(...args.concat([value])))
  } else {
    return head(...args)
  }
}

functionA(2)  
  .then((valueA) => converge(functionB, functionC)(valueA))

You can, of course, write a helper function to hide away the context juggling, but it is quite difficult to read, and may not be straightforward to understand for those who are not well versed in functional magic.

By using async/await our problems are magically gone:
async function executeAsyncTask () {  
  const valueA = await functionA()
  const valueB = await functionB(valueA)
  return function3(valueA, valueB)
}

Multiple parallel requests with async/await

This is similar to the previous one. In case you want to execute several asynchronous tasks at once and then use their values at different places, you can do it easily with async/await:

async function executeParallelAsyncTasks () {  
  const [ valueA, valueB, valueC ] = await Promise.all([ functionA(), functionB(), functionC() ])
  doSomethingWith(valueA)
  doSomethingElseWith(valueB)
  doAnotherThingWith(valueC)
}

As we’ve seen in the previous example, we would either need to move these values into a higher scope or create a non-semantic array to pass these value on.

Array iteration methods

You can use map, filter and reduce with async functions, although they behave pretty unintuitively. Try guessing what the following scripts will print to the console:

  1. map
function asyncThing (value) {  
  return new Promise((resolve, reject) => {
    setTimeout(() => resolve(value), 100)
  })
}

async function main () {  
  return [1,2,3,4].map(async (value) => {
    const v = await asyncThing(value)
    return v * 2
  })
}

main()  
  .then(v => console.log(v))
  .catch(err => console.error(err))
  1. filter
function asyncThing (value) {  
  return new Promise((resolve, reject) => {
    setTimeout(() => resolve(value), 100)
  })
}

async function main () {  
  return [1,2,3,4].filter(async (value) => {
    const v = await asyncThing(value)
    return v % 2 === 0
  })
}

main()  
  .then(v => console.log(v))
  .catch(err => console.error(err))
  1. reduce
function asyncThing (value) {  
  return new Promise((resolve, reject) => {
    setTimeout(() => resolve(value), 100)
  })
}

async function main () {  
  return [1,2,3,4].reduce(async (acc, value) => {
    return await acc + await asyncThing(value)
  }, Promise.resolve(0))
}

main()  
  .then(v => console.log(v))
  .catch(err => console.error(err))

Solutions:

  1. [ Promise { <pending> }, Promise { <pending> }, Promise { <pending> }, Promise { <pending> } ]
  2. [ 1, 2, 3, 4 ]
  3. 10

If you log the returned values of the iteratee with map you will see the array we expect: [ 2, 4, 6, 8 ]. The only problem is that each value is wrapped in a Promise by the AsyncFunction.

So if you want to get your values, you’ll need to unwrap them by passing the returned array to a Promise.all:

main()  
  .then(v => Promise.all(v))
  .then(v => console.log(v))
  .catch(err => console.error(err))

Originally, you would first wait for all your promises to resolve and then map over the values:

function main () {  
  return Promise.all([1,2,3,4].map((value) => asyncThing(value)))
}

main()  
  .then(values => values.map((value) => value * 2))
  .then(v => console.log(v))
  .catch(err => console.error(err))

This seems a bit more simple isn’t it?

The async/await version can still be useful if you have some long running synchronous logic in your iteratee and another long-running async task.

This way you can start calculating as soon as you have the first value – you don’t have to wait for all the Promises to be resolved to run your computations. Even though the results will still be wrapped in Promises, those are resolved a lot faster then if you did it the sequential way.

What about filter? Something is clearly wrong…

Well, you guessed it: even though the returned values are [ false, true, false, true ], they will be wrapped in promises, which are truthy, so you’ll get back all the values from the original array. Unfortunately, all you can do to fix this is to resolve all the values and then filter them.

Reducing is pretty straightforward. Bear in mind though that you need to wrap the initial value into Promise.resolve, as the returned accumulator will be wrapped as well and has to be await-ed.

.. As it is pretty clearly intended to be used for imperative code styles.

To make your .then chains more “pure” looking, you can use Ramda’s pipeP and composeP functions.

Rewriting callback-based Node.js applications

Async functions return a Promise by default, so you can rewrite any callback based function to use Promises, then await their resolution. You can use the util.promisify function in Node.js to turn callback-based functions to return a Promise-based ones.

Rewriting Promise-based applications

Simple .then chains can be upgraded in a pretty straightforward way, so you can move to using async/await right away.

function asyncTask () {  
  return functionA()
    .then((valueA) => functionB(valueA))
    .then((valueB) => functionC(valueB))
    .then((valueC) => functionD(valueC))
    .catch((err) => logger.error(err))
}

will turn into

async function asyncTask () {  
  try {
    const valueA = await functionA()
    const valueB = await functionB(valueA)
    const valueC = await functionC(valueB)
    return await functionD(valueC)
  } catch (err) {
    logger.error(err)
  }
}

Rewriting Node.js apps with async/await

  • If you liked the good old concepts of if-else conditionals and for/while loops,
  • if you believe that a try-catch block is the way errors are meant to be handled,

you will have a great time rewriting your services using async/await.

As we have seen, it can make several patterns a lot more easier to code and read, so it is definitely more suitable in several cases than Promise.then() chains. However, if you are caught up in the functional programming craze of the past years, you might wanna pass on this language feature.

So what do you guys think? Is async/await is the next best thing since the invention of sliced bread, or is it just as controversial as the addition of class was in es2015?

Are you already using async/await it in production, or you plan on never touching it? Let’s discuss it in the comments below.

A guide to low-code development solutions

Dell Boomi: Dell Boomi is an IT service management company that lets teams build integrations anytime, anywhere with no coding required using Dell Boomi’s industry leading iPaaS platform. There’s no hardware or software to manage, so teams can easily build, deploy and manage their integrations with ease. The Boomi platform also includes API management, EDI management, master data management, workflows, and it connects more than 200 applications and 1,000 endpoints for businesses.

Kintone: kintone is a company behind the database application platform that employees can use without writing a single line of code. Teams can run processes, test them, iterate on them, and find the best configuration with kintone’s no-code/low-code business process management. The platform features branched workflows, no-code process management, and notifications and trigger based reminders. Teams can also navigate databases quickly and easily, diving into their data with easy-to-use and easy-to-configure views and filters.

OutSystems: OutSystems is a low-code platform that lets you visually develop your application, integrate with existing systems and add your own code when needed. The OutSystems platform is top-rated because of its speed, integration with everything, great UX by default, and its low-code abilities without constraints. OutSystems was rated a leader in two low-code development waves, and it was rated a mobile application development platforms leader from Gartner.

Xojo: Xojo, a development tool, lets teams use the same tool and language to build native apps for multiple platforms. Experienced developers can tap into Xojo’s platform for additional resources, but it’s easy to learn and powerful enough to develop anything, making it the ideal development tool for all experience levels. Xojo currently has over 330,000 users worldwide and Xojo apps can be found anywhere, from Fortune 500 to commercial software, small businesses, and everything in between.

Alpha Software: Alpha Software’s Alpha Anywhere platform is a complete business application development and deployment environment that enables users to quickly become proficient in creating mobile business forms and applications that run across all devices. Alpha Anywhere has the unique capability to rapidly create offline capable, mobile-optimized forms and business apps that can easily access and integrate with existing databases and web services, and can exploit built-in role-based security.

Appian: Appian’s platform combines the speed of low-code development with the power of process management, and more. It allows teams to quickly build unified views of business information from across existing systems, and lets them create optimized processes that manage and interact with their data. Users can also deploy their enterprise-grade app everywhere — with one click. Abandon the need for code with drag-and-drop, declarative, visual development for all aspects of app dev – UX design, process design, rules design, and more.

Capriza: Capriza lets teams transform workflows from existing applications into simple, intuitive experiences that are accessible anytime, anywhere. The core components of its platform include a library of critical micro apps, a personalized mobile workspace, a no-code designer, seamless runtime, live monitoring and analytics, and enterprise-grade security and scalability.

i-exceed: Appzillon, i-exceed’s flagship product, is a feature loaded, agile, secure, and flexible mobile application development platform (MADP). Considering the fragmentation of technology users today, the platform can be used to deliver channel and device agnostic applications for smartphones, feature phones, tablets, desktops, and laptops. Appzillon also has good support for offline apps, user engagement, and content and collaboration capabilities.

K2: K2 offers an established platform that excels across mobile, workflow, and data. K2’s core strength is support for building complex apps that incorporate mobile, workflow, and data. The company provides a data-modeling environment that allows developers to create virtual data views that bring multiple systems of record together into a single view. This allows developers to create an abstract view of the data. Additionally, K2 provides strong workflow capabilities for modeling and automating processes and assigning tasks to workers.

Kony: The Kony Visualizer is the most open and comprehensive app design and development suite, powered by the Kony Nitro Engine. Kony Visualizer is a powerful enterprise-grade platform for designing, developing and deploying rapid, low-code, native mobile and web apps using open and standard-based tools with JavaScript. Teams can create low-code, fully native and hybrid mobile and web applications, and Kony Visualizer can lower overall app development time by up to 50 percent.

Magic Software: Magic xpa Application Platform  lets you leverage the same business logic to develop once and deploy across platforms. You can create a portfolio of high performance business apps with a single skill set and minimal resources. By allowing you to develop, maintain and update apps quickly and cost-effectively, Magic supports your digital transformation and enterprise mobility strategies, making it easy for you to give your business a competitive edge.

Mendix: Mendix provides a comprehensive, integrated set of tools and platform services for the entire app lifecycle, from ideation and development through deployment and operation. Empower a continuum of people to build apps without code, from business experts to professional developers. Teams can visually model full-stack applications, including data models, UIs, and logic. With Mendix’s platform you can combine reusable building blocks to deliver apps 10 times faster than traditional approaches.

Oracle: Oracle Visual Builder Cloud Service accelerates development and hosting of engaging web and mobile applications with an intuitive browser-based visual development on the same enterprise-grade cloud platform powering Oracle SaaS Applications. Create business objects, add process automation, integrate external systems and, when needed, leverage standard Javascript to create amazing apps faster.

Salesforce: Salesforce is one of the biggest vendors of general-purpose low-code application platforms. Force.com, the Community Cloud, and the Lightning platform anchor this low-code customer base, although Salesforce also has platforms (Heroku), tools (Force.com IDE), and partnerships (with continuous-delivery tool vendors) that address coders. Salesforce’s mobile low-code platform has a feature set that helps customers extend customer data managed by the vendor’s software-as-a-service (SaaS) apps while blending and aggregating it with data from other systems of record.

Sencha: Sencha Ext JS helps developers build data-intensive, cross-platform web applications for desktops, tablets and smartphones, with 115+ high-performance, pre-tested and integrated UI components. Using Sencha Themer with Ext JS enables developers to quickly and easily design customized application themes using graphical tools, without writing a single line of code.

5 Vuex Plugins For Your Next VueJS Project

There are a lot of good reasons to use Vuex to manage the state of your Vue.js app. For one, it’s really easy to add super-cool features with a Vuex plugin. Developers in the Vuex community have created a tonne of free plugins for you to use, with many of the features you can imagine, and some you may not have imagined.

In this article, I will show you five feature that you can easily add to your next project with a Vuex plugin.

  1. Persisting state
  2. Syncing tabs/windows
  3. Language localization
  4. Managing multiple loading states
  5. Caching actions

 

1. Persisting state

vuex-persistedstate uses the browser’s local storage to persist your state across sessions. This means that refreshing the page or closing a tab won’t wipe your data.

A good use case for this would be a shopping cart: if the user accidentally closes a tab, they can reopen it with the page state intact.

2. Syncing tabs/windows

vuex-shared-mutations synchronizes state between different browser tabs. It does this by storing a mutation to local storage. The storage event triggers an update in all other tabs/windows, which replays the mutation, thus keeping state in sync.

3. Language localization

vuex-i18n allows you to easily store content in multiple languages. It is then trivial to switch languages in your app.

One cool feature is that you can store strings with tokens e.g. “Hello {name}, this is your Vue.js app.”. All your translations can have the same token where it’s needed in the string.

4. Managing multiple loading states

vuex-loading helps to manage multiple loading states in your application. This plugin is handy for real-time apps where changes in state are frequent and complex.

5. Caching actions

vuex-cache can cache your Vuex actions. For example, if you’re retrieving data from a server, this plugin will cache the result the first time you call the action, then return the cached value on subsequent dispatches. It’s trivial to clear the cache when necessary.

I’d love to hear your favorite Vuex plugins in the comments below!

5 Reasons Why We switched from Python To Go

Python is awesome! Especially Python 3 with async functionality. But really Go is not giving any chances to survive in enterprise world…

If you got the idea of this quote, then you probably tried or just looked around Go programming language. Which is I think easiest programming language that can fit in any kind of application development. Yes! you read that right, for me Go is easier to learn than even JavaScript. I think this is the main reason why Go language become so match popular within a few years.

So What We Had Before Using Go?

 

TreeScale.com mainly dashboard and API based web application with some analytical stuff. Here is our technical stack.

  • React.js for Dashboard Frontend
  • Django Python for Dashboard Backend + Authentication service
  • Node.js for API Service
  • PostgreSQL for Database and Cassandra for Logging
  • Custom written Container Registry with Rust Language

As you can see the overall infrastructure is fully micro-service based and most of the logic completely separated, even with different technologies.

That’s the main reason why we started thinking about merging API Service and Backend into single project because they have a lot of things that are similar but codebase is duplicated over multiple programming languages and technologies. But it turns out that we need to work a lot to customize Django’s API services, especially with custom JSON responses.

Why Go?

 

As I told earlier Go Language is the most easiest languages that I’ve ever seen and used. But it was only the first attraction for me.

Here is the main 5 reasons why we choose Go over Python Django

#1 It Compiles Into Single Binary

Golang built as a compiled language and Google developers did great job with it. Using static linking it actually combining all dependency libraries and modules into one single binary file based on OS type and architecture. Which means if you are compiling your backend application on your laptop with Linux X86 CPU you can just upload compiled binary into server and it will work, without installing any dependencies there!

#2 Static Type System

Type system is really important for large scale applications. Python is great and fun language but sometimes you are just getting unusual exceptions because trying to use variable as an integer but it turning out that it’s a string.

# Django will crash process because of this
def some_view(request):
    user_id = request.POST.get('id', 0)
    # If this post request has "id" parameter then
    # user_id would be a string, 
    # but you really thinking it is integer
    User.objects.get(id=user_id)

Go will let you know about this issue during compile time as a compiler error. This is where you winning time for this kind of stupid issues.

#3 Performance!!

This could be surprising but in most of the application cases Go is faster than Python (2 and 3). Here is the results of Benchmarking Game, which are unfair, it depends on application type and usecase.

For our case Go performed better because of his concurrency model and CPU scalability. Whenever we need to process some internal request we are doing it with separate Goroutine, which are 10x cheaper in resources than Python Threads. So we saved a lot of resources (Memory, CPU) because of the built in language features.

#4 You Don’t Need Web Framework For Go

This is the most awesome thing about programming language. Go language creators and the community have built in so many tools natively supported by language core, that in most of the cases you really don’t need any 3rd party library. For example it has http, json, html templating built in language natively and you can build very complex API services without even thinking about finding library on Github!

But of course there is a lot of libraries and frameworks built for Go and making web applications with Go, but I’ll recommend build your web application or API service without any 3rd party library, because in most cases they are not making your life easier than using native packages.

#5 Great IDE support and debugging

IDE support is one of the most important things when you are trying to switch your programming language. Comfortable IDE in average can save up to 80% of your coding time. I found Go Plugin For JetBrains IDEA which has support also for (Webstorm, PHPStorm, etc…). That plugin is giving everything that you need for project development with the power of JetBrains IDEA you can really boost your development.

Based on our code base statistics, after rewriting all projects to Go we got 64% less code than we had earlier.

You really don’t need to debug code which doesn’t exists. Less code, less troubles!

Conclusion

Go gave us huge flexibility, single language for all usecases and for all of them it working very very well. We got about 30% more performance on our Backend and API services. And now we can handle logging real time, transfer it to database and make a streaming with Websocket from single or multiple services! This is awesome outcome from Go language features.

Don’t forget to “Recommend” this post and share your thoughts about this.
Which Programming Language Should I Learn To Get A Job At Google, Facebook, or Amazon?

The choice of programming language acts as a big factor for a novice in the world of programming. If one stumbles upon a language whose syntax is too complex, one would definitely reconsider learning it. But, what if you’ve crossed that entry barrier and you’re looking to make a career and land a job at heavyweights like Google, Facebook, or Amazon?

You might have come across the articles that tell which programming languages are used at big companies like Google, Facebook, etc. The choice of those companies doesn’t necessarily reflect their needs while hiring a candidate. There are few chances that they’d be interested to interview someone who is expert in a single programming language.

Similar views were also expressed by Justin Mattson, Senior Software Engineer, Fuschia at Google. He answered a user’s query on Quora (via Inc.).

In his answer, Mattson says that if a company is hung up on the fact that you know a language X, but not language Y, you shouldn’t be interested in working there. ” Languages are a tool, like a saw. Whether the saw is manual, table or laser is less relevant than understanding the basic principles of wood and how cutting it happens,” he writes.

There are chances that a person is expert in a popular programming language, but that doesn’t make him/her a good engineer. Different programming languages teach us different things–C and C++ teach you what’s happening with memory and other low-level operations and Java, Ruby, etc., test your design choices. So, it’s important that you learn more languages.

“Don’t learn just one, learn at least two, hopefully, three. This will give you a better sense of what feature are often common to most languages and what things differ,” Mattson adds.

But, what about expertise in a single programming language?

 

Is having complete command over one language completely irrelevant? Answering this question, Mattson says that one must become an expert in the language one uses, instead of focusing on what a company wants. “If you say you’re an expert in Python and then can’t use it properly in the interview, that is a problem,” he adds.

In the nutshell, if your fundamentals and design choices are strong, the programming language selection isn’t that important. In such companies, you’ll need to deal with multiple languages and pick up the new one as needed.

A Guide to Becoming a Full-Stack Developer in 2017

Full-Stack Web Development, according to the Stack Overflow 2016 Developer Survey, is the most popular developer occupation today. It’s no wonder then that there are dozens of online and in-person programs that will help people become Full-Stack Developers and then even assist these new developers land high-paying programming jobs.

Some popular online programs can be found on Lynda, Udacity, Coursera, Thinkful, General Assembly, and so much more. Aside from these online programs, there are also in-person coding bootcamps that are teaching people the skills required to become web developers.

In this article I won’t be discussing which websites or coding bootcamps have the best web development programs, instead I will be providing a definitive guide to what I believe are the most important skills required to become a Full-Stack Web Developer today and land a job if you’ve never coded before. I will be basing the list off of three things:

  1. A combination of what most programs in 2017 are teaching students.

  2. My own personal experiences from interviewing at companies for developer positions in the past and also interviewing potential candidates for current Full-Stack Developer positions at my current company.

  3. Stories and feedback from people on Coderbyte who have been accepted to coding bootcamps and then proceeded to get programming jobs.

The Definitive Guide

A Full-Stack Web Developer is someone who is able to work on both the front-end and back-end portions of an application. Front-end generally refers to the portion of an application the user will see or interact with, and the back-end is the part of the application that handles the logic, database interactions, user authentication, server configuration, etc. Being a Full-Stack Developer doesn’t mean that you have necessarily mastered everything required to work with the front-end or back-end, but it means that you are able to work on both sides and understand what is going on when building an application.

If you want to become a Full-Stack Web Developer in 2017 and land your first job, below is a reference guide with a list of things you should learn.

1. HTML/CSS

Almost every single program, whether online or in-person, that is teaching you how to be a web developer will start with HTML and CSS because they are the building blocks of the web. Simply put, HTML allows you to add content to a website and CSS is what allows you to style your content. The following topics related to HTML/CSS come up often in interviews and on the actual job when you’re working:

  • Semantic HTML.
  • Be able to explain the CSS Box Model.
  • Benefits of CSS preprocessors (you don’t necessarily need to understand how to use one on a deep level, but you should to understand what they are for and how they help with development).
  • CSS Media Queries to target different devices and write responsive CSS.
  • Bootstrap (a framework for helping design and layout content on a page and while many online programs or schools focus heavily on teaching Bootstrap, in reality it’s more important to have a deep knowledge of fundamental CSS than specific Bootstrap features and methods).

2. JavaScript

 

The JavaScript language is growing more popular every year and new libraries, frameworks, and tools are constantly being released. Based on the Stack Overflow 2016 Developer Survey, JavaScript is the most popular language in both Full-Stack, Front-end, and Back-end Development. It’s the only language that runs natively in the browser, and can double up as a server-side language as well (as you’ll see below with Node.js). Below are some topics you need to understand as a Full-Stack Developer:

  • Understand how to work with the DOM. Also know what JSON is and how to manipulate it.
  • Important language features such as functional composition, prototypal inheritance, closures, event delegation, scope, higher-order functions.
  • Asynchronous control flow, promises, and callbacks.
  • Learn how to properly structure your code and modularize parts of it, things like webpack, browserify, or build tools like gulp will definitely be helpful to know.
  • Know how to use at least one popular framework (many programs will focus heavily on teaching you a library or framework like React or AngularJS, but in reality it’s much more important to have a deep understanding of the JavaScript language and not focus so much on framework-specific features. Once you have a good understanding of JavaScript, picking up a framework that sits on top of it won’t be too hard anyway).
  • Although some may argue that you should be using this less or that it’s slowly dying, jQuery code still exists in most applications and a solid understanding of it will be helpful.
  • Some knowledge on testing frameworks and why they’re important (some may even claim that this topic should be optional).
  • Learn about some important new ES6 features (optional).

3. Back-End Language

Once you feel you’ve gotten a good grasp on HTML/CSS and JavaScript, you’ll want to move on to a back-end language that will handle things like database operations, user authentication, and application logic. All online programs and bootcamps usually focus on a specific back-end language, and in reality in doesn’t matter which one you learn so much as long as you understand what is going on and you learn the nuances of your chosen language. You’ll get a ton of different responses if you ask someone which back-end language is the best to learn, so below I’ve listed a few popular combinations. An important note: whichever you decide to learn, just stick with it and learn as much as you can about it — there are jobs out there for all the languages listed below.

  • Node.js: This is a great option because Node.js is itself just a JavaScript environment which means you don’t need to learn a new language. This is a big reason why a lot of online programs and bootcamps choose to teach Node.js. The most popular framework you’d most likely learn to aid you in developing web applications is Express.
  • Ruby: Some popular frameworks for developing in Ruby are Rails and Sinatra. Plenty of programs teach Ruby as a first back-end language.
  • Python: Some popular frameworks for developing in Python are Django and Flask.
  • Java: The Java language isn’t taught so much these days when it comes to Full-Stack Web Development, but some companies do use Java as their back-end and it is still a very in-demand language (see image above).
  • PHP: PHP is rarely taught in programs these days, but just like with Java, it is still very in-demand and it is a cornerstone of the web today.

4. Databases & Web Storage

 

When learning to build web applications, at some point you’ll probably want to store data somewhere and then access it later. You should have a good grasp on the following topics related to databases and storage.

5. HTTP & REST

HTTP is a stateless application protocol on the Internet — it’s what allows clients to communicate with servers (e.g. your JavaScript code can make an AJAX request to some back-end code you have running on a server which will happen via HTTP). Some important topics you should learn about are listed below:

6. Web Application Architecture

 

Once you think you have a grasp on HTML/CSS, JavaScript, back-end programming, databases, and HTTP/REST, then comes the tricky part. At this point if you want to create a somewhat complex web application, you’ll need to know how to structure your code, how to separate your files, where to host your large media files, how to structure the data in your database, where to perform certain computational tasks (client-side vs server-side), and much more.

There are best practices that you can read about online on, but the best way to actually learn about application architecture is by working on a large application yourself that contains several moving parts — or even better, working on a team and together developing a somewhat large/complex application.

This is why, for example, someone with 7+ years of experience may not necessarily know CSS or JavaScript better than someone with 2 years of experience, but over all of those years they’ve presumably worked with all sorts of different applications and websites and have learned how to architect and design applications (among learning other important things) to be most efficient and can see the “big picture” when it comes to development. Below are some things you can read that will help you learn how to architect your web applications efficiently:

  • Learn about common platforms as a service, e.g. Heroku and AWS. Heroku allows you to easily upload your code and have an application up and running with very little configuration or server maintenance and AWS offers dozens of products and services to help with storage, video processing, load balancing, and much more.
  • Performance optimization for applications and modern browsers.
  • Some opinions on what a web application architecture should include.
  • Designing Web Applications by Microsoft.
  • MVC.
  • Most importantly though you should try to work on projects with people, look at codebases of popular projects on GitHub, and learn as much as you can from senior developers.

7. Git

Git is a version control system that allows developers working on a team to keep track of all the changes being made to a codebase. It’s important to know a few important things related to Git so that you understand how to properly get the latest code that you’ve missed, update parts of the code, make fixes, and change other people’s code without breaking things. You should definitely learn the concept behind Git and play around with it yourself.

  • Here’s a reference list of some common git commands you’ll likely use.
  • Here’s a tutorial on using Git and GitHub for beginners.

8. Basic Algorithms & Data Structures

This topic is somewhat polarizing in the development world because there are developers who don’t think there should be such a heavy focus on computer science topics like tree traversal, sorting, algorithm analysis, matrix manipulation, etc. in web development. However, there are companies like Google that are notorious for asking these types of questions in their interviews. As someone said about the Front-End engineering interview at Google:

That said, as Ryan McGrath mentions, our front-end (FE) engineers are expected to have a solid CS background, like all our engineers.

 

It’ll be hard work learning all of this, but it’s rewarding in the end and Full-Stack Development is fun! Leave your comments below.