Introduction

Front-end web development is evolving. Long gone are the days of writing static HTML files with self-contained CSS. As web developers in this modern world, we need to understand and utilize an endless number of frameworks, plugins, techniques and more. Knowing the right tools to use and when to use them is key to building successful solutions.

Despite our best efforts, it can be difficult to keep up with the speed of advancing web development. We sure as hell can’t slow it down. And why would we want to? It’s so exciting to not know where technology is headed and what could be around the next corner. We should both prepare for change and embrace it. And that is exactly where front-end developers excel. We build what the consumer sees and because of that, we want to use the most cutting-edge technologies to create the biggest impact.

This book came to be from the lessons we, the authors, have learnt through trial and error whilst working on front-end development projects ranging from enormous high-traffic sites such as MSNBC, The GRAMMYs and BravoTV to startups and experiments such as Drupalize.Me and BracketCloud. We want to share with you the tools that we use and the standards that we follow. Our ultimate goal is for you to walk away understanding the core concepts of front-end development so you can confidently go and work on your own projects.

This book is somewhat opinionated based on our experience, so you’ll find some of the content heavily geared towards a particular way of doing things. Of course, there are many ways of accomplishing the same task in the world of front-end development; that’s what makes it so accessible and yet so complicated. Learning one way of doing something can make learning the alternatives a much more palatable task, so we encourage you to look into any and all of the technologies presented herein and even go on to see if something else might better fit your needs.

Who This Book Is For

The content in this book is aimed at those who are new to front-end web development. Regardless of whether you are a beginner or expert developer, the concepts outlined in this book are essential to embracing the rapidly evolving web. We won’t be covering the general basics of web development so you will most likely want to get up to speed on the fundamentals of web programming such as HTML, CSS and JavaScript. We will also be utilizing the command line, so some basic knowledge of how to use that on your operating system is recommended.

If you hear yourself asking any of the following questions, this book will likely be very useful for you!

  • “What actually is front-end development?”
  • “How can I be a more efficient web developer?”
  • “What is Grunt/AngularJS/SASS/<insert popular tool name here>?”
  • “How do I fit all of these front-end tools together into a project?”
  • “How can I build a front-end application that can scale?”

An Overview of This Book

Every web project that you work on is different and there is no ‘one size fits all’ set of tools. However, throughout the chapters in this book, we’ll introduce you to some of the most popular, useful and powerful tools used in front-end web development so that when you’re done reading you will be able to apply the concepts and techniques to whatever you are working on.

1. Getting Started

The aim of the first chapter of this book is to help get you acclimated with front-end development in general. You’ll learn what’s expected from a front-end developer and get a short overview of the types of projects a front-end developer might be tasked with. We’ll even take you through setting up your computer for local development.

2. Frameworks

This chapter jumps right into some of the more popular JavaScript frameworks and template languages in use today. We’ll cover the details of what exactly a ‘framework’ is and talk about the MVC pattern before getting into the details of installation and practical usage of 3 popular frameworks: AngularJS, Backbone.js and Ember.js.

3. Styling

There’s a lot more to styling than just throwing CSS at your markup; that just leads to a big mess of unreadable spaghetti code sprinkled with !important parmesan. Here we’ll cover CSS preprocessors like Sass, organizational methods for your styles, and the kind of impact your CSS may have on a project’s performance.

4. Dependency Management

Getting your whole team on the same page code-wise can be challenging. Heck, even making sure you’re using the same version of that awesome Ruby gem after an update can be a pain. This chapter on dependency management covers a number of really handy front-end package managers like npm, Bower, and Bundler. You’ll learn what a package manager is and how to use it effectively to keep your project on track.

5. Automation

Do you like doing the same repetitive tasks over and over? No? Neither do we.

The automation chapter is about just that, automation. We’ll go over how you can remove the tedium from front-end development and just get to work. In this chapter you’ll learn how to perform tasks like checking your JavaScript or CSS for errors whenever you save a file, minify your code to shave off some file size, and even how to automatically refresh your browser whenever something changes. Once you get started, you’ll never look back.

Example Code

This book contains many code snippets for demonstration purposes. Code may appear differently depending on the device you are using to read this book. Here is an example of a code snippet so you know what to expect:

1 var gulp = require('gulp'),
2   uglify = require('gulp-uglify');
3 
4 // This task uglifies our JS files.
5 gulp.task('compress', function() {
6   gulp.src('src/js/*.js')
7     .pipe(uglify())
8     .pipe(gulp.dest('dist'))
9 });

You will also notice that we reference code inline like this throughout the book.

Contacting the Authors

If you have any feedback or questions, please feel free to contact us via the Front-End Fundamentals Google Group.

You can either create a new topic via the web interface or you can send an email to the mailing list address: front-end-fundamentals@googlegroups.com

We will do our best to consider each and every new message received. Please understand that depending on the volume of requests, it may be difficult for us to respond immediately.