JavaScript: Functional Programming for JavaScript Developers - Ved Antani - E-Book

JavaScript: Functional Programming for JavaScript Developers E-Book

Ved Antani

0,0
67,19 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Unlock the powers of functional programming hidden within JavaScript to build smarter, cleaner, and more reliable web apps

About This Book

  • Write powerful code with the high-level functions that JavaScript offers
  • Discover what functional programming is, why it's effective, and how it's used in JavaScript
  • Understand and optimize JavaScript's hidden potential as a true functional language

Who This Book Is For

If you are a JavaScript developer interested in learning functional programming, looking for the quantum leap toward mastering the JavaScript language, or just want to become a better programmer in general, then this book is ideal for you. This guide is aimed at programmers, involved in developing reactive frontend apps, server-side apps that wrangle with reliability and concurrency, and everything in between.

What You Will Learn

  • Get a run through of the basic JavaScript language constructs
  • Code using the powerful object-oriented feature in JavaScript
  • Master DOM manipulation, cross-browser strategies, and ES6
  • Understand the basic concurrency constructs in Javascript and best performance strategies
  • Harness the power of patterns for tasks ranging from application building to code testing
  • Build large-scale apps seamlessly with the help of reactive patterns
  • Explore advanced design patterns, including dependency injection
  • Develop more powerful applications with currying and function composition
  • Create more reliable code with closures and immutable data

In Detail

JavaScript is a high-level, dynamic, untyped, lightweight, and interpreted programming language and functional programming is a style that emphasizes and enables smarter code that minimizes complexity and increases modularity. It's a way of writing cleaner code through clever ways of mutating, combining, and using functions. And JavaScript provides an excellent medium for this approach. By learning how to expose JavaScript's true identity as a functional language, we can implement web apps that are more powerful, easier to maintain and more reliable.

The java script: Functional Programming for JavaScript Developers course will take you on a journey to show how functional programming when combined with other techniques makes JavaScript programming more efficient.

The first module Mastering JavaScript, stress on practical aspects of Javascript development like—Functions and Closures, Runtime debugging techniques, project layout, events and DOM processing, build tools, Object-oriented patterns, isomorphism—everything that a modern Javascript project would need.

The second module, Mastering JavaScript Design Patterns - Second Edition, will explore how design patterns can help you improve and organize your JavaScript code. You'll get to grips with creational, structural, and behavioral patterns as you discover how to put them to work in different scenarios. This updated edition will also delve into reactive design patterns and microservices as they are a growing phenomenon in the world of web development. It will also show you some advanced patterns, including dependency injection and live post processing.

The third module, Functional Programming in JavaScript, will help you to write real-world applications by utilizing a wide range of functional techniques and styles. It explores the core concepts of functional programming common to all functional languages, with examples of their use in JavaScript.

Style and approach

This course will begin with providing insights and practical tips on advanced JavaScript features to build highly scalable web and mobile system and move on to some design patterns with JavaScript. Finally, the course ends with presenting the functional programming techniques and styles in JavaScript.

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 761

Veröffentlichungsjahr: 2016

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



JavaScript: Functional Programming for JavaScript Developers

JavaScript: Functional Programming for JavaScript Developers

Unlock the powers of functional programming hidden within JavaScript to build smarter, cleaner, and more reliable web apps

A course in three modules

BIRMINGHAM - MUMBAI

JavaScript: Functional Programming for JavaScript Developers

Copyright © 2016 Packt Publishing

All rights reserved. No part of this course may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this course to ensure the accuracy of the information presented. However, the information contained in this course is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this course.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this course by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Published on: August 2016

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-78712-466-0

www.packtpub.com

Credits

Authors

Ved Antani

Simon Timms

Dan Mantyla

Reviewers

Ivano Malavolta

Dobrin Ganev

Dom Derrien

Joe Dorocak

Peter Ehrlich

Edward E. Griebel Jr.

Content Development Editor

Pooja Mhapsekar

Graphics

Disha Haria

Production Coordinator

Aparna Bhagat

Preface

Functional programming is a style that emphasizes and enables smarter code that minimizes complexity and increases modularity. It's a way of writing cleaner code through clever ways of mutating, combining and using functions. And JavaScript provides an excellent medium for this approach. JavaScript, the internet's scripting language, is actually a functional language at heart. By learning how to expose JavaScript's true identity as a functional language, we can implement web apps that are more powerful, easier to maintain and more reliable. JavaScript's odd quirks and pitfalls will suddenly become clear and the language as a whole will make infinitely more sense. Learning how to use functional programming will make you a better programmer for life.

This course is a guide for both new and experienced JavaScript developers who are interested in learning functional programming. With a focus on the progression of functional programming techniques and styles in JavaScript, detailed information of JavaScript libraries, this course will help you to write smarter code and become a better programmer.

What this learning path covers

Module 1, Mastering JavaScript, provides a detailed overview of the language fundamentals and some of the modern tools and libraries – like jQuery, underscore.js and jasmine.

Module 2, Mastering JavaScript Design Patterns- Second Edition, is divided into two main parts. The first part covers the classical design patterns, which are found in the GoF book whereas the second part looks at patterns, which are either not covered in the GoF book or ones that are more specific to JavaScript.

Module 3, Functional Programming in JavaScript, explores the core concepts of functional programming common to all functional languages, with examples of their use in JavaScript.

What you need for this learning path

All the examples in this course can be run on any of the modern browsers. For the last chapter from first module, you will need Node.js. You will need the following to run the examples and samples from this course:

A computer with Windows 7 or higher, Linux or Mac OSX installedLatest version of Google Chrome or Mozilla Firefox browserA texteditor of your choice. Sublime Text, Vi, Atom or Notepad++ would be ideal. The choice is entirely yours.

There are standalone JavaScript engines written in C++ (V8) and Java (Rhino) and these are used to power all sorts of tools such as nodejs, couchdb and even elasticsearch. These patterns can be applied to any of these technologies.

Who this learning path is for

If you are a JavaScript developer interested in learning functional programming, looking for the quantum leap towards mastering the JavaScript language, or just want to become a better programmer in general, then this course is ideal for you. This guide is aimed at programmers, involved in developing reactive front-end apps, server-side apps that wrangle with reliability and concurrency, and everything in between.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this course—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail <[email protected]>, and mention the course's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packtproduct, we have a number of things to help you to get the most from your purchase.

Downloading theexample code

You can download the example code files for this course from your account at http://www.packtpub.com. If you purchased this course elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

Log in or register to our website using your e-mail address and password.Hover the mouse pointer on the SUPPORT tab at the top.Click on Code Downloads & Errata.Enterthe name of the course in the Search box.Select the course for which you're looking to download the code files.Choose from the drop-down menu where you purchased this course from.Click on Code Download.

You can also download the code files by clicking on theCode Filesbutton on the course's webpage at the Packt Publishing website. This page can be accessed by entering the course's name in the Search box. Please note that you need to be logged into your Packt account.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

WinRAR / 7-Zip for WindowsZipeg / iZip / UnRarX for Mac7-Zip / PeaZip for Linux

The code bundle for the course is also hosted on GitHub at https://github.com/PacktPublishing/JavaScript--Functional-Programming-for-JavaScript-Developers.We also have other code bundles from our rich catalog of books, courses and videos available at https://github.com/PacktPublishing/. Check them out!

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our courses—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this course. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your course, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the coursein the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at <[email protected]> with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this course, you can contact us at <[email protected]>, and we will do our best to address the problem.

Part 1. Module 1

Mastering JavaScript

Explore and master modern JavaScript techniques in order to build large-scale web applications

Chapter 1. JavaScript Primer

It is always difficult to pen the first few words, especially on a subject like JavaScript. This difficulty arises primarily because so many things have been said about this language. JavaScript has been the Language of the Web—lingua franca, if you will, since the earliest days of the Netscape Navigator. JavaScript went from a tool of the amateur to the weapon of the connoisseur in a shockingly short period of time.

JavaScript is the most popular language on the web and open source ecosystem. http://githut.info/ charts the number of active repositories and overall popularity of the language on GitHub for the last few years. JavaScript's popularity and importance can be attributed to its association with the browser. Google's V8 and Mozilla's SpiderMonkey are extremely optimized JavaScript engines that power Google Chrome and Mozilla Firefox browsers, respectively.

Although web browsers are the most widely used platforms for JavaScript, modern databases such as MongoDB and CouchDB use JavaScript as their scripting and query language. JavaScript has become an important platform outside browsers as well. Projects such as Node.js and io.js provide powerful platforms to develop scalable server environments using JavaScript. Several interesting projects are pushing the language capabilities to its limits, for example, Emscripten (http://kripken.github.io/emscripten-site/) is a Low-Level Virtual Machine (LLVM)-based project that compiles C and C++ into highly optimizable JavaScript in an asm.js format. This allows you to run C and C++ on the web at near native speed.

JavaScript is built around solid foundations regarding, for example, functions, dynamic objects, loose typing, prototypal inheritance, and a powerful object literal notation.

While JavaScript is built on sound design principles, unfortunately, the language had to evolve along with the browser. Web browsers are notorious in the way they support various features and standards. JavaScript tried to accommodate all the whims of the browsers and ended up making some very bad design decisions. These bad parts (the term made famous by Douglas Crockford) overshadowed the good parts of the language for most people. Programmers wrote bad code, other programmers had nightmares trying to debug that bad code, and the language eventually got a bad reputation. Unfortunately, JavaScript is one of the most misunderstood programming languages (http://javascript.crockford.com/javascript.html).

Another criticism leveled at JavaScript is that it lets you get things done without you being an expert in the language. I have seen programmers write exceptionally bad JavaScript code just because they wanted to get the things done quickly and JavaScript allowed them to do just this. I have spent hours debugging very bad quality JavaScript written by someone who clearly was not a programmer. However, the language is a tool and cannot be blamed for sloppy programming. Like all crafts, programming demands extreme dedication and discipline.

A little bit of history

In 1993, the Mosaic browser of National Center for Supercomputing Applications (NCSA) was one of the first popular web browsers. A year later, Netscape Communications created the proprietary web browser, Netscape Navigator. Several original Mosaic authors worked on Navigator.

In 1995, Netscape Communications hired Brendan Eich with the promise of letting him implement Scheme (a Lisp dialect) in the browser. Before this happened, Netscape got in touch with Sun Microsystems (now Oracle) to include Java in the Navigator browser.

Due to the popularity and easy programming of Java, Netscape decided that a scripting language had to have a syntax similar to that of Java. This ruled out adopting existing languages such as Python, Tool Command Language (TCL), or Scheme. Eich wrote the initial prototype in just 10 days (http://www.computer.org/csdl/mags/co/2012/02/mco2012020007.pdf), in May 1995. JavaScript's first code name was Mocha, coined by Marc Andreessen. Netscape later changed it to LiveScript, for trademark reasons. In early December 1995, Sun licensed the trademark Java to Netscape. The language was renamed to its final name, JavaScript.