We are encouraging to write tests. To cover your code. To decrease uncertainty.
Yet, I’m still seeing a lot of articles where someone shares his knowledge about particular features and… he shows how the code works using main() method:
public class WhateverApp {
public static void main(String[] args) {
DescribedFunctionalityProvider provider = new DescribedFunctionalityProvider();
Result result = provider.showHowYouDoingThings();
System.out.println(result.showThatReallyWorks());
}
}
I’ve got one simple question – why?