I will be replacing my dishwasher and I am curious what is the current code for the wiring of the dishwasher.
Assuming you're in the US (though I can't imagine it being much different elsewhere, but do check!) ...
Be sure to check the label, but most dishwashers run perfectly happy on a 15A circuit. If a dedicated circuit to the dishwasher isn't possible, you can come out of a general receptacle circuit that isn't otherwise utilized in the kitchen, depending on the rating of the dishwasher. What you want to avoid is a mixer and toaster and dishwasher using the same circuit at once. You may have to do some investigating. Go for the dedicated circuit if that's possible.
NEC 210.8.D specifies that dishwashers must be GFCI protected, and doesn't differentiate between cord-and-cap or direct connection (as it defines an outlet as any connection). However, not all states have adopted this because of the nuisance factor of older appliances and older GFCIs that tended to be overly-sensitive to fluctuation on the neutral leg. Check what applies in your state; you may want to just use a GFCI breaker on the branch circuit feeding the dishwasher as that's the easiest way to be sure, or be absolutely certain you're coming out of the "load" side of a GFCI receptacle that won't otherwise see much use.
Otherwise, if the dishwasher has a cord and cap, you should have an appliance receptacle installed where it can be reached. An appliance receptacle is an outlet with only one place to plug something in. If your state doesn't require the dishwasher being GFCI protected, they'll absolutely want to make sure you use a single appliance receptacle so nothing else can be connected to the unprotected receptacle. Finally, if directly wiring it, just make sure you use the appropriate connector if the vendor doesn't supply one.
Be kind to your future self, or anyone else that has to pull the dishwasher out in the future to service it by leaving enough cable to be able to pull it out and off to the side. Make sure the cable is secured properly wherever it is fed, and protected anywhere that it may be exposed on its path to the dishwasher.
If uncertain or uneasy - you probably want to call an electrician.
Current code suggests a dedicated line run to the breaker box for use with the dishwasher. 2008 NEC indicates that the kitchen should have two 20 amp counter top circuits to run small appliances.[So you can run a microwave and a toaster at the same time.] The NEC also says that those circuits should not be used for anything else.
-In a retrofit situation, you could tap into the counter top circuit if there is no other option. Unfortunately, with this arrangement, the motor and heating element will consume most of your available amps leaving you in a situation where you cannot use other things while the dishwasher is running.
On use of grounding and GFCI's... No matter what you do, ground the dishwasher to a reliable ground. If you are using new wire, this will be easy. Just hook up the green or bare wire to the frame of the dishwasher and bond the other end to the breaker box ground. If it is an older home with a two wire system, You can bond the washer to copper or iron water pipe (NOT A GAS LINE!!!) For safety, be sure that the pipes are bonded to the box ground or at least earth ground.
There is no prohibition on the use of GFCI in this circuit. The electronics in new GFCI devices greatly reduces nuisance tripping. You can use a GFCI breaker, an outlet, or even a GFCI dead front. (This looks like a GFCI outlet with no holes to plug anything in- and could be mounted at the counter top for accessibility)
My installation: (Dishwasher recommends 15 - 20 amp) I ran #12 MC Flex up and over through the attic to the washer and popped out of the wall to a box attached to the inside of the cabinet next to the washer. I installed a 20A GFCI paired with the 20A breaker in the panel. I attached a #10 stranded appliance cord to the washer with a 20A plug. I did this so I could have GFCI protection and also if the washer had a significant malfunction requiring immediate reaction, the cord could be pulled out without having to find the right breaker. I have used this setup for over two years and have not had any trouble from it.
MC Flex (metal clad) is a bit of overkill for residential (unless your local building code requires it), you can just use Romex if you wish. If you are using #14 wire, do not exceed 15A. If you use #12 wire, you can safely use 20A breaker (unless your dishwasher specifies 15A only.)