The right way to abstract - Deepstash
Machine Learning With Google

Learn more about computerscience with this collection

Understanding machine learning models

Improving data analysis and decision-making

How Google uses logic in machine learning

Machine Learning With Google

Discover 95 similar ideas in

It takes just

14 mins to read

The right way to abstract

The right way to abstract

Start by implementing the problem in the concrete, not in the abstract. Don't try to guess what interfaces you will need. Discover them.

Only after implementing the problem in the concrete, go on to decoupling. Ask yourself: "What do I need to decouple to make it better, to allow it to deal with change as the data or business changes?".

Leaving the code in the concrete is also an option. Don't force abstractions when they are not necessary. Prefer duplication over the wrong abstraction because duplication is cheaper to deal with.

2

17 reads

MORE IDEAS ON THIS

Wrong abstractions

Wrong abstractions

If you find yourself passing parameters and adding conditional paths through shared code, the abstraction is wrong. It's no longer right for the codebase.

Wrong abstractions are no longer common abstractions; they are series of conditions mixed with vaguely related ideas. T...

2

22 reads

DRY is not a silver bullet

DRY is not a silver bullet

"Don’t repeat yourself" (DRY) is usually good advice, but you have to get the abstractions right. Otherwise they quickly become unmaintainable.

Here's how it usually plays out:

  1. You write a cool abstraction
  2. Time passes

2

43 reads

Fix wrong abstractions

Fix wrong abstractions

In the long run, it's better to fix wrong abstractions ASAP than to add more code and make everything more complicated.

Your goal is to remove the abstraction and conditionals, and to reduce each caller to only the code it needs. Here's how:

    2

    17 reads

    CURATED FROM

    CURATED BY

    ocpodariu

    Alt account of @ocp. I use it to stash ideas about software engineering

    Related collections

    More like this

    The SMART Method

    The SMART Method

    Time commitment to get started: Medium

    Type: Abstract

    Perfect for people who: Are in the early phases of a big project and need to strategize before jumping in.

    What it does: Turns big, abstract ideas and goals ...

    Tips for entrepreneurs to succeed during the pandemic

    ... and beyond:

    • Be agile. Pivoting has gotten a lot of businesses through the pandemic. Continuing to adapt to it is what helps you keep going.
    • Communicate honestly and authentically. When facing a crisis, be transparent with everyone affected ...

    Applying the Many-to-Many decision-making model

    • Frame the challenge or problem as a question. "What must we do now to become number one in commercial lending?"
    • Carefully consider all the people who can meaningfully answer the question and involve many who will need to execute them.
    • Don't tell people what to exp...

    stash-superman-illustration

    Explore the World’s

    Best Ideas

    200,000+ ideas on pretty much any topic. Created by the smartest people around & well-organized so you can explore at will.

    An Idea for Everything

    Explore the biggest library of insights. And we've infused it with powerful filtering tools so you can easily find what you need.

    Knowledge Library

    Powerful Saving & Organizational Tools

    Save ideas for later reading, for personalized stashes, or for remembering it later.

    # Personal Growth

    Take Your Ideas

    Anywhere

    Organize your ideas & listen on the go. And with Pro, there are no limits.

    Listen on the go

    Just press play and we take care of the words.

    Never worry about spotty connections

    No Internet access? No problem. Within the mobile app, all your ideas are available, even when offline.

    Get Organized with Stashes

    Ideas for your next work project? Quotes that inspire you? Put them in the right place so you never lose them.

    Join

    2 Million Stashers

    4.8

    5,740 Reviews

    App Store

    4.7

    72,690 Reviews

    Google Play

    samz905

    Don’t look further if you love learning new things. A refreshing concept that provides quick ideas for busy thought leaders.

    Shankul Varada

    Best app ever! You heard it right. This app has helped me get back on my quest to get things done while equipping myself with knowledge everyday.

    Ashley Anthony

    This app is LOADED with RELEVANT, HELPFUL, AND EDUCATIONAL material. It is creatively intellectual, yet minimal enough to not overstimulate and create a learning block. I am exceptionally impressed with this app!

    Sean Green

    Great interesting short snippets of informative articles. Highly recommended to anyone who loves information and lacks patience.

    Giovanna Scalzone

    Brilliant. It feels fresh and encouraging. So many interesting pieces of information that are just enough to absorb and apply. So happy I found this.

    Ghazala Begum

    Even five minutes a day will improve your thinking. I've come across new ideas and learnt to improve existing ways to become more motivated, confident and happier.

    Laetitia Berton

    I have only been using it for a few days now, but I have found answers to questions I had never consciously formulated, or to problems I face everyday at work or at home. I wish I had found this earlier, highly recommended!

    Jamyson Haug

    Great for quick bits of information and interesting ideas around whatever topics you are interested in. Visually, it looks great as well.

    Read & Learn

    20x Faster

    without
    deepstash

    with
    deepstash

    with

    deepstash

    Access to 200,000+ ideas

    Access to the mobile app

    Unlimited idea saving & library

    Unlimited history

    Unlimited listening to ideas

    Downloading & offline access

    Personalized recommendations

    Supercharge your mind with one idea per day

    Enter your email and spend 1 minute every day to learn something new.

    Email

    I agree to receive email updates