Code Monkey home page Code Monkey logo

here-be-dragons's Introduction

Here Be Dragons

Here be dragons is an Intellij/Android Studio plugin that let's you annotate your impure Java methods with the @SideEffect annotation and shows a little dragon icon in the gutter when you call them.

How the plugin works

Why would I want to do this?

When writing functional style code, isolating impure and pure functions becomes very important. This helps you visually identify which methods are impure when a bunch of methods are being called in a code block.

For a beginner friendly introduction to functional programming in Android, please checkout out my blog series.

Installation

Install the plugin

Download the plugin jar and select "Install Plugin From Disk" in IntelliJ's plugin preferences.

Add the annotation library

Add the jcenter repository to your gradle build file if it's not already present:

repositories {
    jcenter()
}

Next, add the lib containing the @SideEffect annotation as a dependency:

dependencies {
    compile 'com.anupcowkur:here-be-dragons-annotation:1.0.0'
}

Usage

Simpy add the @SideEffect annotation to any method you want like this:

import com.anupcowkur.herebedragons.SideEffect;

public class Test {
    @SideEffect
    public void foo() {
        // do some impure things
    }
}

And when you call the method anywhere, you'll see the dragon icon show up in the IDE gutter.

License

This project is licensed under the MIT License

here-be-dragons's People

Contributors

anupcowkur avatar

Watchers

 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.