GithubHelp home page GithubHelp logo

dhandapani-d / refactor-the-mega-controller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from andymatuschak/refactor-the-mega-controller

0.0 0.0 0.0 42 KB

Commits contain refactoring steps taken in my talk, "Let's Play: Refactor the Mega-Controller"

Swift 99.64% C 0.36%

refactor-the-mega-controller's Introduction

Let's Play: Refactor the Mega-Controller

Hello! This project needs some explanation.

This is the companion source for a talk I've been giving under the same name. You can also watch a more "improvised" version of it I gave at Realm.

The idea is to take a highly-coupled, highly-ugly view controller implementation and to incrementally isolate, abstract, and test components of it, reducing dependencies of each piece along the way.

I've tried to use this project to demonstrate some of the architectural design principles I've been developing for Swift. The source probably won't make much sense outside of the context of the talk, but perhaps in time I'll annotate the source with docstrings so that it can be read on its own.

If you're reading this outside the context of my talk, I'll offer this caveat: all added layers of abstraction also add complexity. Not all of these steps will necessarily be worth it given the tradeoffs of your own project. This project attempts to demonstrate aggressive isolation for instructive purposes, but I don't always advocate that in practice.

How to read the refactorings

The progressive refactorings are represented in the Git history. HEAD represents where the refactoring stopped. You'll want to step back to the first revision, then step forward to see how each step was refactored.

Now you try!

I did these refactorings pretty quickly. You should feel free to try your hand at cleaning up this awful view controller on your own; send me pull requests, and we'll chat about 'em!

refactor-the-mega-controller's People

Contributors

andymatuschak avatar ibrahimkteish avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.