We survey the current trends in OCDMA and optical coding through their applications. Although a prerequisite for OCDMA, optical coding distinguishes itself from OCDMA through major applications where codes are not applied to data and carry network-level information other than user identity. After introducing the principles of coding, we discuss OCDMA and its applications, particularly OCDMA PON. Optical coding and its applications are then reviewed.