Switches vs. Latches: Understanding the Key Differences and Their Applications