Printing a full BYTE in BIN format - 00000000..11111111

uint8_t enc, old = 0;
#define bits 8  //set to desired print width

void loop() {
  enc =  PIND<<2;          //shift PIND 2 to left
  enc |= (PINB & 0b11);  //OR lower 2 pins of PINB

    if(enc != old){            // compare sample to memory
    old = enc;                  // if different, update memory

    for(char b=0; b<bits; b++){
      Serial.print( ( (enc>>b) & 1) ); //print "0" OR "1" at bit position
    Serial.println(); //newline
  delay(5);    //not really necessary 

Could this make it into the language somehow? Maybe as part of the playground or snuck into a tutorial? I could not find an easy to understand example of how to print a BYTE in BIN format. Simply doing:

x = PIND;

will not always result in eight zeros or ones.
The method I wrote tonight does this and will print the eight “0” or “1” characters correctly.

sprintf() is your friend