The real definition of carbohydrates
The definition of carbohydrates as compounds containing $C$, $H$ and $O$ usually with the empirical formula ${C_m(H_2O)_n}$, is outdated.

More rigorous and a accurate definition would be Polyhydroxy Aldehydes and Ketones composed of Carbon, Hydrogen and Oxygen. Moreover, the nomenclature including Mono-, Di-, Oligo- and Poly- "Saccharide" is preferred over the now obsolete and too-general term "carbohydrate", since the etymological origin of the word "carbohydrate" is from the greek words Carbo- for carbon and hydor- for water which indicates that the carbohydrates are "hydrates" of carbon and have the empirical formula ${C_m(H_2O)_n}$, which is not always true. Instead "saccharide" is derived from the greek word for "sugar" and hence is much more accurate as it does not limit the definition to any empirical formula.   

Apart from the polyhydroxy aldehyde or ketone characteristic of carbohydrate, they have a marked structural and functional variation from other biomolecules. This includes the absence of $S$ (as in proteins), $P$ and $N$ (as in proteins and nucleic acids), presence of Glycosidic bond (as compared to peptide bond in proteins, phosphodiester bond in nucleic acid, and ester linkages in fats or glycerides) and much greater structural uniformity as compared to other biomolecules.However, these characteristics are not absolute as is evident from the fact that several monosaccharide derivatives do contain $S$ or $N$ atoms. Actually, the entire group of amino-sugars (Hexosamines etc.) are usually classified under carbohydrates since they are primarily monosaccharide derivatives obtained through enzymatic amination. 

These characteristics distinguish this class of compounds without having to assign a empirical formula to it. 

ADDENDUM
Adding the clause compounds which can, on simple hydrolysis yield polyhydroxy aldehyde or ketones in the definition helps involve certain non-reducing sugars like Sucrose.