I am running 12/2 from breaker to switch then 14/3 to garbage disposal and dishwasher but realized we have the new codes to think about and wasn't sure if this is code compliant. Because my coworker mentioned what if someone plugged in an under cabinet instant hot water heater to dishwasher plug instead?
If you have any #14 wire in the circuit, you must put a 15 A breaker on it; it cannot be a 20 A breaker even though there is #12 wire from the breaker to the first switch. The difference in cost between #14 and #12 is small, so don't try to save a buck here - it won't work and can present a serious fire hazard. Mixing wires in a circuit can also confuse future homeowners, as they see #12 wire coming into the breaker and think they can slap a 20 A breaker on it.
It is common (or at least, not uncommon) to have both (all) outlets under the sink switched. Garbage disposals obviously need one, but having a switch on the dishwasher is also nice for child-proofing it. If you were only planning to switch one of the outlets, add another switch into your plans.