When working with the vector tools (such as the shape tools), Photoshop has a preference to “Snap Vector Tools and Transforms to Pixel Grid”. This preference is extremely helpful when creating shapes that need solid, straight edges as it snaps the edges of the shapes to be fully aligned to a pixel, preventing soft, anti-aliased edges. Julieanne Kost explains it as simply as I’ve seen.