
714 P.2d 1010 (1986)
204 N.M. 789
STATE of New Mexico, Plaintiff-Appellant,
v.
Dino James TABAHA, Defendant-Appellee.
No. 8909.
Court of Appeals of New Mexico.
February 4, 1986.
Paul G. Bardacke, Atty. Gen., Anthony Tupler, Asst. Atty. Gen., Santa Fe, for plaintiff-appellant.
Jacquelyn Robins, Chief Public Defender, David Stafford, Appellate Defender, Santa Fe, for defendant-appellee.

OPINION
HENDLEY, Judge.
The state appeals from an order quashing an information for failure to charge a crime. Because the facts were not disputed and because the state asked the court to rule on the questions raised by defendant's motion to quash, the trial court was of the view that a legal, not factual, issue was presented. Cf. State v. Mares, 92 N.M. 687, 594 P.2d 347 (Ct.App. 1979). The state does not disagree, nor do we.
We affirm.
The information charged battery upon a peace officer, contrary to NMSA 1978, Section 30-22-24 (Repl.Pamp. 1984). The defendant is an eighteen-year-old resident at the New Mexico Boys' School at Springer. The alleged victim is an employee of the corrections department, classified as a juvenile correctional officer II. The principal functions of such a correctional officer include exercising custody and care of residents committed to the Springer facility; supervising training, recreation, and work activities of residents; counseling; maintaining shift logs; writing incident and accident reports; censoring mail; and performing related work, all under supervision. If a resident of the Springer facility *1011 commits a bad act, the juvenile correctional officer may physically restrain a resident and file a report on the incident. The report is reviewed at several levels and the superintendent must make the final determination of whether to initiate disciplinary or criminal proceedings.
Section 30-22-24 proscribes battery upon a "peace officer while he is in the lawful discharge of his duties." NMSA 1978, Section 30-1-12(C) (Repl.Pamp. 1984) defines peace officer as "any public official or public officer vested by law with a duty to maintain public order or to make arrests for crime." (Emphasis added.) The trial judge, after exhaustively reviewing the pertinent statutes and case law, concluded that, while juvenile correctional officers may have the power to maintain order and make arrests in their particular domain, they were not vested by law with a duty to do so. Accordingly, they were not peace officers within the meaning of Section 30-1-12(C) to which the crime of battery upon a peace officer, contrary to Section 30-22-24, would be applicable. We agree.
A duty is that which is required by one's station or occupation. City of Clovis v. Archie, 60 N.M. 239, 290 P.2d 1075 (1955). The critical word is "required." Over the years, the legislature has known how to require certain behavior of certain people and, thus, establish duties. See, e.g., NMSA 1978, § 4-41-2 (Repl.Pamp. 1984) (sheriff shall be conservator of the peace, shall suppress assaults, shall apprehend and commit felons to jail, and shall cause offenders to keep the peace and appear in court); NMSA 1978, § 4-41-9 (Repl.Pamp. 1984) (deputy sheriffs are authorized to discharge duties of sheriffs); NMSA 1978, § 3-13-2 (Repl.Pamp. 1985) (municipal police officers shall execute and serve certain writs, shall suppress breaches of the peace, shall apprehend certain persons, shall arrest certain persons, and shall have the same responsibilities as sheriffs); NMSA 1978, § 29-2-18 (Repl.Pamp. 1984) (state police have certain powers and duties; they shall be conservators of the peace, and shall be charged with enforcement of other laws); NMSA 1978, § 29-9-11 (Repl.Pamp. 1984) (investigators of Governor's Organized Crime Prevention Commission shall be peace officers and have the powers and duties of peace officers); NMSA 1978, § 16-2-30 (it shall be the duty of certain state park and recreation division employees to enforce certain laws); NMSA 1978, § 29-1-2 (Repl.Pamp. 1984) (it shall be the duty of sheriffs, deputies, and constables to trace and discover stolen livestock and property); NMSA 1978, § 29-1-1 (Repl.Pamp. 1984) (duties of all peace officers and sanction of removal from office for breach of duty).
In contrast, jailers and correctional officers are simply given powers in certain sections of legislation. NMSA 1978, Section 33-1-10 (Cum.Supp. 1985) gives correctional officers, whose duty it is to hold people in custody, the powers of peace officers to arrest and enforce laws on the premises of a correctional facility. It also provides that correctional officers shall not be liable for performing the duties of a peace officer authorized by the section. A parallel section exists for jailers. NMSA 1978, § 33-3-28(A) (Cum.Supp. 1985).
Significantly, Section 33-3-28, the section on jailers, contains a subsection C: "Crimes against a jailer * * * shall be deemed the same crimes and shall bear the same penalties as crimes against a peace officer." Section 33-1-10 has no parallel provision.
In other areas of the law, the legislature has consistently treated peace officers differently than correctional officers. In prescribing aggravating circumstances under which the death penalty may be imposed, one such circumstance is that the victim was a peace officer and another such circumstance is that the victim is an employee of the corrections department. NMSA 1978, § 31-20A-5 (Repl.Pamp. 1981). See also NMSA 1978, § 30-22-17 (Repl.Pamp. 1984) (making it a third degree felony for a prisoner to assault an officer or employee of any penal institution).
*1012 The state contends that, given the similarity between Sections 33-1-10 and 33-3-28(A), the trial court's focus on duty, as opposed to power, is not defensible. This argument, however, misses the point. Peace officer is defined in terms of duty. § 30-1-12(C). Courts are to give legislation effect as written. State v. Russell, 94 N.M. 544, 612 P.2d 1355 (Ct.App. 1980). The legislature having used the word "duty" in its definitional section, the trial court was required to focus on the word "duty."
The state contends that the presence of subsection C in Section 33-3-28 was overemphasized by the trial court. This argument ignores a basic principle of statutory construction. It is presumed that the legislature does not enact useless legislation. State ex rel. Bird v. Apodaca, 91 N.M. 279, 573 P.2d 213 (1977). According to the state's analysis, both jailers and correctional officers are, by virtue of Sections 33-1-10 and 33-3-28(A), already given peace officer status so that crimes against them are covered by statutes such as Section 30-22-24, proscribing battery on a peace officer. Accepting this analysis would render Section 33-3-28(C) a useless enactment. Under Apodaca, we cannot accept it.
Finally, the state appears to be arguing that a ruling that a correctional officer is not a peace officer within the meaning of Section 30-1-12(C) would be absurd, would undermine the express objectives of the legislation, and would be applying a strained and unnatural construction to work an exemption from just penalties. These arguments presuppose the answer to the exact issue we are called upon to decide in this appeal: whether a correctional officer is a peace officer for criminal code purposes. It may be that there are good reasons for the legislature to decide to treat correctional officers like peace officers for purposes of crimes against them. It may also be that there are good reasons for the legislature to have decided not to treat correctional officers like peace officers. As the trial judge noted, the correctional officer legitimately may call upon the sheriff, the New Mexico State Police officer, or the municipal officer for aid in any given circumstance. Wisdom may dictate that course out of considerations of lack of law enforcement academy training, lack of training in use of weapons, lack of physical strength, and problems of implementing an arrest. While the state has expressed good reasons to protect correctional officers from crimes enumerated by NMSA 1978, Sections 30-22-21 to -26 (Repl.Pamp. 1984), the trial judge has expressed equally good reasons for not giving them such protection. When there are good reasons both for and against a particular course of action, the decision to take that course or not is a legislative judgment.
The legislature has not yet taken the course advocated by the state. The legislature has thus far given the protection of Sections 30-22-21 to -26 only to those vested by law with certain duties. § 30-1-12(C). Because correctional officers are not vested with such duties and because the legislature has not seen fit to give them express protections as it has done with jailers, we hold that a correctional officer is not a peace officer for purposes of charging defendant with battery on a peace officer. As we said in State v. Garcia, 98 N.M. 585, 651 P.2d 120 (Ct.App. 1982), another case decided by the same trial judge and involving issues analogous to those presented here, "[c]omplaints of the inadequacy of legislation to reach the result desired by the State must therefore be addressed to the legislature, not to the courts."
The order of the trial court is affirmed.
IT IS SO ORDERED.
BIVINS and MINZNER, JJ., concur.
