What is "bleed through"?

I am working through the Arduino ShiftOut Tutorial. In Code Sample 2.2 2 Byte One By One on lines 137 and 138 I find

* //zero the data pin after shift to prevent bleed through*
* digitalWrite(myDataPin, 0);*

I can't see any change in program behaviour if I comment out line 138 so why is it there?
Anyway, what is "bleed through"?

Thanks

That line should not be needed, the clock-a-bit-out code is:

    //Sets the pin to HIGH or LOW depending on pinState
    digitalWrite(myDataPin, pinState);
    //register shifts bits on upstroke of clock pin  
    digitalWrite(myClockPin, 1);
    //zero the data pin after shift to prevent bleed through
    digitalWrite(myDataPin, 0);

On the 74HC595 data on the SER (pin 14) of the chip only needs to be presented at least 150nS before SRCLK (pin 11) goes high. Nothing you do with the data pin before or after that should make any difference. (*)

'bleed through' is an odd term to use here, but a quick search turned up an example of someone who used this term to describe a problem they were having with their LED's being driven via a 74HC595 - so this myth might have started there.

Anyway... that line does nothing.

If the hardware was a bit flakey (poor power supply, no decoupling etc.) then that line might have some effect, but it wouldn't be a 'fix'

Yours,
TonyWilk

(*) P.S.
If that line had set the data pin HIGH, that might make some sense to 'pre-set' the data line:
Usually, a data pin can be driven LOW faster than it goes HIGH - on a fast processor the time between writing a data bit and setting the clock pin high could get close to the minimum for the chip, so, without adding any delay, you arrange for the data pin to either already be high or to switch LOW (which it does quick) before the clock line goes HIGH. Bit of a hack tho'

Pure guessing from my side:That line has a side effect that the dataline is always LOW when exiting the function even if the last bit was HIGH. Although it did not need to be in the for loop, that might help with power consumption to not leave a pin HIGH when it’s not needed?

This is an old thingy though - If you read the source code now you would see

void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val)
{
	uint8_t i;

	for (i = 0; i < 8; i++)  {
		if (bitOrder == LSBFIRST)
			digitalWrite(dataPin, !!(val & (1 << i)));
		else	
			digitalWrite(dataPin, !!(val & (1 << (7 - i))));
			
		digitalWrite(clockPin, HIGH);
		digitalWrite(clockPin, LOW);		
	}
}