2
Anakata
3y

What exactly is boilerplate code?

Comments
  • 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.
  • 7
    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;

    while(heating){

    int temp = readtemp();

    int error = setpoint - temp;

    setoutput(error);

    }

    Could be prone to oscillation, does not account for time.
  • 1
    Where's waldo
Add Comment