What's the design purpose of Gradle doFirst and doLast? : <p>For example I have the Gradle script like:</p>

<pre><code>myTask_A {
    doFirst {
        println "first string"

    }
    doLast {
        println "last string"
    }
}
</code></pre>

<p>The following two tasks have exactly the same execution result:</p>

<pre><code>myTask_B {
    doFirst {
        println "first string"
        println "last string"
    }
}

myTask_C {
    doLast {
        println "first string"
        println "last string"
    }
}
</code></pre>

<p>What's the design purpose of the the doFirst &amp; doLast as any of above tasks produces the same result?</p>
