What exactly is boilerplate code?

  • 5
    It is code you write that does not directly address the business problem, but you have to write in order to use some kind of tooling, and the tooling helps to address the business problem.
  • 3
    Boiler plate code is repetitive code which you end up using as is in a lot of places.
  • 8
    A bunch of shit that keeps you from doing work
  • 4
    @example-user And here is the winner.
  • 3
    Instant noodles
  • 4
    "Could the compiler sensibly generate this code for me?"

    If yes, it's boilerplate.

    In Java for instance (kind of famous for boilerplate) - getters, setters, equals, hashcode, tostring etc. would all come under this category. It's not doing anything clever, it's just repetitive, bog standard code you have to spit out before getting started with the "real" work.
  • 1
    int setpoint=100 + altoffset;


    int temp = readtemp();

    int error = setpoint - temp;



    Could be prone to oscillation, does not account for time.
  • 1
    Where's waldo
  • 2
    @Aitkotw All in favor of renaming boilerplate to ramen....?
Add Comment