Question regarding sinking current?

I have what is probably a fairly straightforward question for those who know. I've just started playing with some electronics, and I'm a little concerned about frying parts such as transistors and other ICs.

I recall that when attaching things such as LED's to the outputs of ICs, resistors should be used to limit the current passing through the IC. Likewise, current through transistors must be limited.

However, one schematic I've seen attaches a LED directly from the output of a 555 timer to Vcc, and all is well. However, when I, without thinking, hooked up a single transistor and LED (2n3904, with 5V) with no resistors (imagine the basic transistor test circuit but with no resistors), I fried the transistor.

How do you know when a resistor must be used to limit current?

If I were to connect the output of my 555 timer directly to the base of my 3904 transistor and use no resistors anywhere else, will my transistor still fry?

LED's always need current limiting, to keep the current within the correct range. Not doing so will fry both the LED and probably the transistor.
The current to the Base of a transistor must also be limited, not only to protect the transistor but also the 555 output, as (assuming a grounded emitter NPN) the base will draw whatever current is required to get the Base voltage down to .6 - .7 volts.

An ordinary LED has a max allowed continuous current of only 30mA.
The max output current from a 555 is well over 200mA.
If they are connected together without a current-limiting resistor then they will both fry.

But what if the 555 is switched on / off continuously at a fast pace with a quite small duty cycle? There would be a certain point where the LED would see an average current of 30 mA or less. Isn't it?

Ahh, I guess maybe it's the blinking that prevents the 555 from frying, though it's not blinking particularly fast at all.

Based on what's been said, if there were any IC's with a high impedence input, then am I right in saying they will not need any resistors from input to output? I assume that if they existed, it would be stated in their spec sheets?

It is good design practice to limit the current rather than relying on the
current limiting of the IC.

There is probably not enough power dissipated in the 555 to destroy
it. If the 555 self-limits to say 50mA and is powered off a 5V supply
the power dissipated would be 250mW. With a thermal resistance of
100degC/W you would get a 25degC temperature rise. The IC
temperature would be apx 50degC which is below the 70degC maximum
operating temperature.

Also as the sink current rises so does the output voltage which further reduces
the sink current (see the output voltage specification in the datasheet).

For 100% duty cycle you should be able to drive an LED without current limiting
but it is good design practice to current limit.

Reducing the duty cycle reduces the average current but may not help with the
IC temperature issue. The thermal mass of the IC die is small enough so
that after apx 50-100mS it will reach the temperature calculated by multiplying
the power dissipation by the thermal resistance. Unless your on-time is below
50-100mS the duty cycle won't help with the heating.

In power semiconductor specifications there is an
"Maximum Effective Transient Thermal Impedance" graph that can be used
to calculate the Thermal Impedance using duty-cycle and on-time. Take a look
the graph of a power MOSFET like the IRF540. You will see that beyond a certain
on-time the thermal resistance of the IC does not change.

The 555 timer specification does not have this graph since you are expected
to limit the current.