reklama - zainteresowany?

Refactoring JavaScript. Turning Bad Code Into Good Code - Helion

Refactoring JavaScript. Turning Bad Code Into Good Code
ebook
Autor: Evan Burchard
ISBN: 978-14-919-6487-3
stron: 442, Format: ebook
Data wydania: 2017-03-13
Księgarnia: Helion

Cena książki: 152,15 zł (poprzednio: 176,92 zł)
Oszczędzasz: 14% (-24,77 zł)

Dodaj do koszyka Refactoring JavaScript. Turning Bad Code Into Good Code

How often do you hear people say things like this? "Our JavaScript is a mess, but we’re thinking about using [framework of the month]."

Like it or not, JavaScript is not going away. No matter what framework or ”compiles-to-js” language or library you use, bugs and performance concerns will always be an issue if the underlying quality of your JavaScript is poor. Rewrites, including porting to the framework of the month, are terribly expensive and unpredictable. The bugs won’t magically go away, and can happily reproduce themselves in a new context. To complicate things further, features will get dropped, at least temporarily.

The other popular method of fixing your JS is playing “JavaScript Jenga,” where each developer slowly and carefully takes their best guess at how the out-of-control system can be altered to allow for new features, hoping that this doesn’t bring the whole stack of blocks down. This book provides clear guidance on how best to avoid these pathological approaches to writing JavaScript:

  • Recognize you have a problem with your JavaScript quality.
  • Forgive the code you have now, and the developers who made it.
  • Learn repeatable, memorable, and time-saving refactoring techniques.
  • Apply these techniques as you work, fixing things along the way.
  • Internalize these techniques, and avoid writing as much problematic code to begin with.

Bad code doesn’t have to stay that way. And making it better doesn’t have to be intimidating or unreasonably expensive.

Dodaj do koszyka Refactoring JavaScript. Turning Bad Code Into Good Code

 

Osoby które kupowały "Refactoring JavaScript. Turning Bad Code Into Good Code", wybierały także:

  • Windows Media Center. Domowe centrum rozrywki
  • Ruby on Rails. Ćwiczenia
  • DevOps w praktyce. Kurs video. Jenkins, Ansible, Terraform i Docker
  • Przywództwo w Å›wiecie VUCA. Jak być skutecznym liderem w niepewnym Å›rodowisku
  • Scrum. O zwinnym zarzÄ…dzaniu projektami. Wydanie II rozszerzone

Dodaj do koszyka Refactoring JavaScript. Turning Bad Code Into Good Code

Spis treści

Refactoring JavaScript. Turning Bad Code Into Good Code eBook -- spis treści

  • Foreword
  • Preface
    • Why This Book Exists
    • Who This Book Is For
    • How To Use This Book
    • Some Words in This Book
      • App, Application, Program
      • Inclusivity Through Words and Diagrams
      • Users
      • Third-Party Libraries and Communities
      • API, Interface, Implementation, Client Code
      • Inputs (Nonlocal and Free Variables)
    • Conventions Used in This Book
    • Using Code Examples
    • OReilly Safari
    • How to Contact Us
    • Acknowledgments
  • 1. What Is Refactoring?
    • How Can You Guarantee Behavior Doesnt Change?
      • Why Dont We Care About Details of Implementation?
      • Why Dont We Care About Unspecified and Untested Behavior?
      • Why Dont We Care About Performance?
    • What Is the Point of Refactoring if Behavior Doesnt Change?
      • Balancing Quality and Getting Things Done
      • What Is Quality and How Does It Relate to Refactoring?
      • Refactoring as Exploration
    • What Is and Isnt Refactoring
    • Wrapping Up
  • 2. Which JavaScript Are You Using?
    • Versions and Specifications
    • Platforms and Implementations
    • Precompiled Languages
    • Frameworks
    • Libraries
    • What JavaScript Do You Need?
    • What JavaScript Are We Using?
    • Wrapping Up
  • 3. Testing
    • The Many Whys of Testing
    • The Many Ways of Testing
      • Manual Testing
      • Documented Manual Testing
      • Approval Tests
      • End-to-End Tests
      • Unit Tests
      • Nonfunctional Testing
      • Other Test Types of Interest
    • Tools and Processes
      • Processes for Quality
        • Coding standards and style guides
        • Developer happiness meeting
        • Pair programming
        • Code review
        • Test-driven development
      • Tools for Quality
        • Version control
        • Test frameworks
        • Assertion/expectation syntax libraries
        • Domain-specific libraries
        • Factories and fixtures
        • Mocking/stubbing libraries
        • Build/task/packaging tools
        • Loaders and watchers
        • Test run parallelizers
        • Continuous integration (CI) services
        • Coverage reporters
        • Style checkers, aka linters
        • Debuggers/loggers
        • Staging/QA servers
    • Wrapping Up
  • 4. Testing in Action
    • New Code from Scratch
    • New Code from Scratch with TDD
    • Untested Code and Characterization Tests
    • Debugging and Regression Tests
    • Wrapping Up
  • 5. Basic Refactoring Goals
    • Function Bulk
    • Inputs
    • Outputs
    • Side Effects
    • Context Part 1: The Implicit Input
      • this in Strict Mode
    • Context Part 2: Privacy
      • Is There Privacy in JavaScript?
    • Wrapping Up
  • 6. Refactoring Simple Structures
    • The Code
    • Our Strategy for Confidence
    • Renaming Things
    • Useless Code
      • Dead Code
      • Speculative Code and Comments
      • Whitespace
      • Do-Nothing Code
      • Debugging/Logging Statements
    • Variables
      • Magic Numbers
      • Long Lines: Part 1 (Variables)
      • Inlining Function Calls
      • Introducing a Variable
      • Variable Hoisting
    • Strings
      • Concatenating, Magic, and Template Strings
      • Regex Basics for Handling Strings
      • Long Lines: Part 2 (Strings)
        • Solution 1
        • Solution 2
        • Solution 3
        • Solution 4
    • Working with Arrays: Loops, forEach, map
      • Long Lines: Part 3 (Arrays)
      • Which Loop to Choose?
      • Better Than Loops
    • Wrapping Up
  • 7. Refactoring Functions and Objects
    • The Code (Improved)
    • Array and Object Alternatives
      • Array Alternative: Sets
      • Array Alternative: Objects
      • Object Alternative: Maps
      • Array Alternative: Bit Fields
    • Testing What We Have
      • Our Setup Test
      • Characterization Tests for classify
      • Testing the welcomeMessage
      • Testing for labelProbabilities
    • Extracting Functions
      • Getting Away from Procedural Code
      • Extracting and Naming Anonymous Functions
      • Function Calls and Function Literals
    • Streamlining the API with One Global Object
      • Extracting the classifier Object  
      • Inlining the setup Function
      • Extracting the songList Object
      • Handling the Remaining Global Variables
      • Making Data Independent from the Program
      • Scoping Declarations: var, let, and const
      • Bringing classify into the classifier
      • Untangling Coupled Values
      • Objects with Duplicate Information
      • Bringing the Other Functions and Variables into classifier
      • Shorthand Syntax: Arrow, Object Function, and Object
      • Getting New Objects with Constructor Functions
      • Constructor Functions Versus Factory Functions
      • A class for Our Classifier
      • Choosing Our API
      • Time for a Little Privacy?
      • Adapting the Classifier to a New Problem Domain
    • Wrapping Up
  • 8. Refactoring Within a Hierarchy
    • About CRUD Apps and Frameworks
    • Lets Build a Hierarchy
    • Lets Wreck Our Hierarchy
      • Constructor Functions
      • Object Literals
      • Factory Functions
      • Evaluating Your Options for Hierarchies
    • Inheritance and Architecture
      • Why Do Some People Hate Classes?
      • What About Multiple Inheritance?
      • Which Interfaces Do You Want?
    • Has-A Relationships
    • Inheritance Antipatterns
      • Hyperextension
      • Goat and Cabbage Raised by a Wolf
    • Wrapping Up
  • 9. Refactoring to OOP Patterns
    • Template Method
      • A Functional Variant
    • Strategy
    • State
    • null Object
    • Wrapper (Decorator and Adapter)
    • Facade
    • Wrapping Up
  • 10. Asynchronous Refactoring
    • Why Async?
    • Fixing the Pyramid of Doom
      • Extracting Functions into a Containing Object
      • Testing Our Asynchronous Program
      • Additional Testing Considerations
    • Callbacks and Testing
      • Basic CPS and IoC
      • Callback Style Testing
    • Promises
      • The Basic Promise Interface
      • Creating and Using Promises
      • Testing Promises
    • Wrapping Up
  • 11. Functional Refactoring
    • The Restrictions and Benefits of Functional Programming
      • Restrictions
      • Benefits
      • The Future (Maybe) of Functional Programming
    • The Basics
      • Avoiding Destructive Actions, Mutation, and Reassignment
        • Avoiding reassignment in conditional tests
        • Avoiding reassignment in loops
        • Avoiding reassignment in conditional bodies
        • Avoiding destructive functions
        • Avoiding destruction in general
      • Dont return null
      • Referential Transparency and Avoiding State
      • Handling Randomness
      • Keeping the Impure at Bay
    • Advanced Basics
      • Currying and Partial Application (with Ramda)
      • Function Composition
      • Types: The Bare Minimum
        • The case for types
        • Less intuitive aspects of types
    • Burritos
      • Introducing Sanctuary
      • The null Object Pattern, Revisited!
      • Functional Refactoring with Maybe
      • Functional Refactoring with Either
    • Learning and Using Burritos
    • Moving from OOP to FP
      • Return of the Naive Bayes Classifier
      • Rewrites
    • Wrapping Up
  • 12. Conclusion
  • A. Further Reading and Resources
    • Origins of Refactoring
    • Baseline JavaScript(s)
    • Keeping Up with JavaScript
    • JavaScript Reference
    • Object-Oriented Programs/Patterns (Including Anticlass Stances)
    • Async
    • Functional
    • Tools
    • Non-JS-Specific but Relevant Sources
    • Me
  • Index

Dodaj do koszyka Refactoring JavaScript. Turning Bad Code Into Good Code

Code, Publish & WebDesing by CATALIST.com.pl



(c) 2005-2024 CATALIST agencja interaktywna, znaki firmowe należą do wydawnictwa Helion S.A.