Summary of RailsConf 2014 - All the Little Things by Sandi Metz

This is an AI generated summary. There may be inaccuracies.
Summarize another video · Purchase summarize.tech Premium

00:00:00 - 00:35:00

Sandi Metz discusses how to write smaller, more manageable objects in order to make your code easier to understand and reason about. She uses metrics to measure the complexity of a code fragment, and finds that it is too complex for humans to understand. She introduces a subjective metric, "Flog," which assesses how complicated a code is. Finally, she discusses the benefits of making small objects, how this leads to a 75% decrease in class complexity, and how to apply object-oriented design principles to make change easier.

  • 00:00:00 Sandi Metz discusses how to write smaller, more manageable objects in order to make your code easier to understand and reason about. She uses metrics to measure the complexity of a code fragment, and finds that it is too complex for humans to understand. She introduces a subjective metric, "Flog," which assesses how complicated a code is.
  • 00:05:00 The author of the video describes how to identify code that needs to be changed, using the "squint test." Once the code is identified, the author tries to make a change, but is unsuccessful. Eventually, he makes a new, more efficient pattern for the code and refactoring begins. The author emphasizes the importance of tests in refactoring, and how without them, the process can be risky and difficult.
  • 00:10:00 Sandi Metz discusses how to catch execution paths in code using Normal and Bailing, and how this helps to speed up refactoring. She also notes that it is cheaper to keep duplication in code than to make the wrong abstraction.
  • 00:15:00 Sandi Metz discusses the principle of "Don't Repeat Yourself" (DRY) and how it can be applied in development. She also discusses the concept of small methods and how they can make code more simpler. Finally, she discusses why developers may not undertake refactorings, citing the increased complexity that can be caused by doing so.
  • 00:20:00 The author discusses how open/closed design principles dictate that new behavior can be added without editing existing code. Open/closed design principles are a style guide for organizing code that have all the obvious tradeoffs. On the macro level, the goal is to get to a point where new behavior can be added without editing existing code. On the micro level, what this means is that when different prefixes and suffixes are seen, the author assumes that a class with a method tick exists and creates a new class to hold that information. This example shows how trust can be built as the author refactors code.
  • 00:25:00 Sandi Metz discusses how she separates the thing she's switching on from the thing she does when she switches, how this makes code simpler, and how she uses inheritance to create a shallow, narrow hierarchy of subclasses that are at the leaf nodes of her object graph.
  • 00:30:00 In this video, Sandi Metz discusses the benefits of inheritance and how it can be used effectively. She then goes on to describe a refactoring she did where she removed code that was related to the inheritance hierarchy. The final result was more concise code that was easier to read.
  • 00:35:00 Sandi Metz discusses the benefits of making small objects, how this leads to a 75% decrease in class complexity, and how to apply object-oriented design principles to make change easier. She provides a slide deck with more information on the topic.

Copyright © 2024 Summarize, LLC. All rights reserved. · Terms of Service · Privacy Policy · As an Amazon Associate, summarize.tech earns from qualifying purchases.