If later you needed to allow differently sized grids (e.g., 16x16), hard-coding the grid size would make it more difficult. Whether a more-general solution is best would depend on how likely this prospect is, though.