tryexceptpass

tryexceptpass

By Cristian MedinaTechnology
Download on the App Store

tryexceptpass episodes

  • Episode 4 - 7 Practices for High Quality Maintainable Code
    • Code is complicated, hard to test, difficult to understand and can frustrate others.
    • Writing cleaner code can save you from reimplementing software simply that you cannot understand.
    • It’s an iterative process and there’s several principles to help you do that.
    • Keep it Simple Stupid (KISS) tells us to avoid unnecessary complexity and reduce moving parts. The idea is to write for maintainability.
    • Don’t Repeat Yourself (DRY) is about avoiding redundant implementations of the same function. You should think about refactoring.
    • You Aren’t Gonna Need It (YAGNI), an Extreme Programming principle, says we should stick with the requirements and avoid adding unneeded features or functions.
    • Composition over Inheritance asks us to take care when applying classes an inheritance in your design because it can lead to inflexible code.
    • Favoring Readability reminds us that writing software is like writing prose. Organize your code as if you’re writing a novel.
    • Practice Consistency tells us to stick with our decisions throughout the project. Keep the same format, implementation flow and design principles.
    • Consider How to Test a solution before writing it, or at least while writing. It helps you avoid traps that can unnecessarily complicate the code base.
    • 14 min
    • Episode 3 - Decoupling Database Migrations at Application Startup
      • Data models change and evolve with your application.
      • There’s plenty of tools that keep track of database schemas and automatically generate scripts to upgrade or downgrade them.
      • It’s common for developers to run a migration at the start of their app before running app code.
      • Our author explains two common problems with this approach.
        1. Modern day production deployments and horizontal scaling can get you into a race condition.
        2. You start assuming that new code will only ever run with the new schema.
        3. You can decouple migrations from code changes by disabling parallelism during this time.
        4. Make it a separate command or lock the database during the upgrade.
        5. We can easily implement locking ourselves in any language.
          • Use Redis locks if you’re ok with something external to the DB.
          • Use the DB itself by writing to an extra table to say that you’re upgrading it.
          • Plan your deployment appropriately so you can run old code with new by making migrations additive in the short term.
          • Using a script at startup that optionally performs the migration based on an environment variable integrates wel with Docker and cloud services.
          • Upgrades of both code and data should be part of your testing BEFORE releasing to production.
          • 14 min
          • Episode 2 - Writing README files
            • What’s a README?
            • Modern day added formatting. Mostly Markdown, sometimes Restructured Text.
            • What to include in a README?
              • Name the project
              • Intro / Summary / Overview
              • Prerequisites
              • Installation instructions
              • Usage instructions
              • Contribution instructions.
              • Credit for important contributors.
              • Acknowledgments of projects you based yours on.
              • Ways to communicate with you or the community.
              • License information.
              • Project status information in the form of badges.
              • 14 min
              • Episode 1 - Practicality: ORMs vs SQL
                • It’s up to us to learn how to apply design patterns and industry trends to our projects.
                • What’s an Object Relational Mapper (ORM)?
                • Why do I want to use one?
                • Unexpected quirks of using ORMs. What are the tradeoffs?
                • What about scalability?
                • 17 min

                About tryexceptpass

                From the publisher's feed

                Keep up with software engineering best practices and tradeoffs from tryexceptpass.org and around the web.