Deciding which compiler for PIC18F26K22 in MPLAB X, C18 or XC8?
As Roger says, use XC8. It's the newer compiler.

The C18 compiler is obsolete and it won't support any newer devices.

Another disadvantage of C18 is that it only supports the PIC18 family of microcontrollers as opposed to the XC8, which supports all the 8-bit PIC microcontrollers: PIC10, PIC12, PIC16, PIC18.



I'd also argue that XC8 (which is based on the HI-TECH C Compiler) is a tad easier to use than C18.
Just take a look at how you would declare an ISR in both compilers:

C18:

void isr(void)
{
   /* ... */
}

#pragma code high_vector=0x08

void interrupt_at_high_vector(void)
{
    _asm GOTO isr _endasm
}

#pragma code

#pragma interrupt isr


vs XC8:

void interrupt isr(void)
{
   /* ... */
}