The padding implementation shown in this exercise is more concise than the implementation shown in the last exercise. However, isn’t it also less readable? Which implementation should I use?


#1

Question

The padding implementation shown in this exercise is more concise than the implementation shown in the last exercise. However, isn’t it also less readable? Which implementation should I use?

Answer

Either implementation is fine to use so long as you are consistent with it. Most style guides recommend using the more concise padding declaration when possible but it is sometimes necessary to use the padding declarations shown in the last exercise.

Once you remember that the more concise padding declaration specifies values moving clockwise starting from the top of a box, the readability of this declaration is not so obscured.