Skip to content

Instantly share code, notes, and snippets.

@jonnyjava
jonnyjava / working_effectively_with_legacy_code.md
Created November 4, 2019 21:51
Working effectively with legacy code summary

WORKING EFFECTIVELY WITH LEGACY CODE

To me, legacy code is simply code without tests. I’ve gotten some grief for this definition. What do tests have to do with whether code is bad? To me, the answer is straightforward, and it is a point that I elaborate throughout the book: Code without tests is bad code. It doesn’t matter how well written it is; it doesn’t matter how pretty or object-oriented or well-encapsulated it is. With tests, we can change the behavior of our code quickly and verifiably. Without them, we really don’t know if our code is getting better or worse.

Chapter 1 Changing Software

Four Reasons to Change Software: For simplicity’s sake, let’s look at four primary reasons to change software.

The 15 Commitments of CONSCIOUS LEADERSHIP

When leaders are below the line, they are closed and defensive, and when they are above the line, they are open and curious.

WHAT’S WRONG WITH BEING RIGHT

Once leaders develop self-awareness and locate themselves accurately below the line, they create the possibility for shifting, a master skill of conscious leaders.

Shifting is moving from closed to open, from defensive to curious, from wanting to be right to wanting to learn, and from fighting for the survival of the individual ego to leading from a place of security and trust.

@jonnyjava
jonnyjava / 97_Things_Every_Programmer_Should_Know.md
Last active November 27, 2023 22:16
97 Things Every Programmer Should Know: Collective Wisdom from the Experts

97 Things Every Programmer Should Know: Collective Wisdom from the Experts

  1. Act with Prudence

    • Pay off technical debt as soon as possible. It would be imprudent to do otherwise.
  2. Apply Functional Programming Principles

  3. Ask "What Would the User Do?" (You Are Not the User)

    • Spending an hour watching users is more informative than spending a day guessing what they want.
@jonnyjava
jonnyjava / The_principles_of_object-oriented_javascript.md
Last active August 2, 2023 09:56
The principles of object-oriented javascript by nicholas c. zakas

The principles of Object-Oriented Javascript

TYPES

JS uses two kinds of types: primitive and reference. Primitive types are stored as simple data types. Reference types are stored as objects, which are really just references to locations in memory.

Primitive Types

There are five primitive types in JavaScript:

  1. Boolean true or false
  2. Number Any integer or floating-point numeric value
  3. String A character or sequence of characters delimited by either single or double quotes (JavaScript has no separate character type)
@jonnyjava
jonnyjava / Tpp.md
Last active April 14, 2023 15:00
The Pragmatic Programmer: From Journeyman to Master

The Pragmatic Programmer: From Journeyman to Master

Tips collected

  1. Care About Your Craft
  • Why spend your life developing software unless you care about doing it well?
  1. Think! About Your Work
  • Turn off the autopilot and take control. Constantly critique and appraise your work.
  1. Provide Options, Don't Make Lame Excuses
  • Instead of excuses, provide options. Don't say it can't be done; explain what can be done.
@jonnyjava
jonnyjava / Refactoring.md
Created May 11, 2017 15:12
Refactoring - Ruby edition

Refactoring

Preface

What is refactoring?

Refactoring is the process of changing a software system in such a way that it not alter the external behaviour of the code yet improves its internal structure It's a process of clean up to minimize the chances to introduces bugs. Refactoring means improve the code design

Chapter 1 - A first example

  • Start writing a good test coverage
  • First refactor, then add new features

Reactive Design Patterns

The Reactive Manifesto

A system:

  1. It must react to its users (responsive).
  2. It must react to failure and stay available (resilient).
  3. It must react to variable load conditions (elastic).
  4. It must react to inputs (message-driven).
@jonnyjava
jonnyjava / poodr.md
Last active November 27, 2022 17:27
Practical Object-Oriented Design in Ruby

Practical Object-Oriented Design in Ruby

1 Introduction

  • OO is about managing dependencies. Objects interact between them exchanging messages
  • Code must follow S.O.L.I.D. principles
    • Single responsibility
    • Open/Closed
    • Liskow substitution
  • Interface segregation
@jonnyjava
jonnyjava / CleanCode.md
Last active August 3, 2022 12:28
Clean Code summarized

Clean Code

The boy scout rule

Leave the campground cleaner than you found it

Naming

  • If a name requires a comment, then the name doesn't reveal its intent
  • Use searchable, meaningful and pronounceable names
  • Avoid mental mapping