
508 P.2d 141 (1973)
95 Idaho 309
STATE of Idaho, Plaintiff-Respondent,
v.
William L. OGATA, Defendant-Appellant.
No. 11056.
Supreme Court of Idaho.
March 1, 1973.
*142 Racine, Huntley, Herzog & Olson, Pocatello, for defendant-appellant.
W. Anthony Park, Atty. Gen., James G. Reid, Deputy Atty. Gen., Boise, Thomas C. Whyte, Deputy Pros. Atty., Idaho Falls, for plaintiff-respondent.
McQUADE, Chief Justice.
This is an appeal from a sentence and commitment for a term not to exceed two years in the Idaho State Penitentiary. The judgment followed a plea of guilty to the charge of "Unlawful Delivery of a Schedule 1 Controlled Substance, to-wit: Heroin" in violation of I.C. § 37-2732. Appellant appeals from the sentence portion of the judgment, contending that the district court abused its discretion in denying his application for probation.
William L. Ogata, the appellant, is a twenty-three year old Vietnam veteran. During the last two months of a fourteen month tour of duty in Vietnam, some of which time was spent near the demilitarized zone, he acquired the heroin habit. While in Vietnam, he turned himself in to *143 the army drug treatment program, but was not cured of his addiction.
After returning to the United States in April, 1971, with an honorable discharge, Ogata continued to use heroin. He had mailed some of the drug to himself in Idaho before leaving Vietnam, and heroin was subsequently sent to him by two soldiers still in Vietnam. There was testimony at the hearing in mitigation that heroin sold in the United States is commonly 4% pure. Ogata's heroin was much purer. Two samples of it tested by State officials were 33% and 90% pure, respectively. Ogata used much of the heroin himself, but also began to sell a portion of it. He was arrested on July 2, 1971, after a sale of the drug to a State narcotics agent. Between his return to the United States in April and his arrest in July, he had made four or five sales of heroin which, he testified, brought him approximately $200.
While being held in the Bonneville County jail, prior to his arraignment in district court, Ogata underwent treatment with methadone and, to all appearances, successfully broke the heroin habit. He was released on $10,000 bail. Ogata was arraigned before the district court on October 22, 1971, and pleaded not guilty. On November 12, 1971, he changed his plea to guilty and a presentence investigation was requested and ordered. His bail was continued.
Meanwhile, in the fall of 1971, Ogata enrolled in Idaho State University at Pocatello, where he had been a student before his induction into the army. During the fall semester of 1971, he achieved a 3.17 grade point average and taught recreational activities at Fort Hall.
Sentencing took place on December 10, 1971. In addition to the pre-sentence investigation report, the district court considered the testimony of several witnesses who knew Ogata and his family. They testified that Ogata had a good relationship with his family, and that he was determined to do well academically and to stay away from drugs. Ogata also testified on his own behalf. The defense requested a withheld sentence.
The district court sentenced appellant to either two or five years in the state penitentiary, leaving the choice of term up to appellant. The choice apparently was given because of differing parole consequences attached to the differing sentences. He chose the two year term. Notice of appeal was filed on December 23, 1971. The district court denied an application under I.C. § 19-2809 for a certificate of probable cause, and refused continuation of bail. On February 2, 1972, a justice of this Court issued a certificate of probable cause. The matter of bail was referred back to the district court and on February 11, 1972, bail was continued in the amount of $10,000.
In this appeal, Ogata claims that the district court abused its discretionary sentencing power under I.C. § 19-2601 when it refused to grant him probation and sentenced him to two years in the state penitentiary. Ogata argues that a penitentiary sentence was not justified by the facts and circumstances before the district court. He also claims that the court denied him probation and imposed the penitentiary sentence for a reason allegedly not sanctioned by law, i.e. solely to deter others who might be inclined to engage in the same type of illegal activity.
It is well settled that the question of whether the trial court has abused its discretion in denying probation is a proper issue for review on appeal.[1] However, before this Court will interfere with a sentence imposed by the trial court, an appellant must show a clear abuse of the trial court's discretion.[2] Furthermore:
"This court has stated on numerous occasions that the length of a sentence is *144 within the discretion of the district court and that a sentence will be set aside only for an abuse of discretion, which ordinarily will not appear when the sentence is within the limits prescribed by statute. State v. Dunn, 91 Idaho 870, 434 P.2d 88 (1967); King v. State, 91 Idaho 97, 416 P.2d 44 (1966); State v. Gish, 89 Idaho 334, 404 P.2d 595 (1965)."[3]
This reasoning has been held applicable to the denial of probation and imposition of a penitentiary sentence as well as to cases where sentences within the statutory limits were claimed to be excessive.[4]
The maximum sentence for a violation of I.C. § 37-2732 is fifteen years in prison and/or a fine of $25,000. Ogata was sentenced to two years in prison without a fine. This sentence is well within the limits set by the legislature for the punishment of the crime of which he was convicted. However, Ogata contends that the district court abused its discretion in denying him probation after being presented with evidence of the circumstances under which he became addicted, his subsequent cure, his good record of military service, his scholastic success, his lack of a prior criminal record, his avowals of determination to avoid future involvement with drugs, and the strong testimony of several character witnesses to the effect that Ogata was a good candidate for probation with a will to succeed. We agree that this is an impressive showing in extenuation and mitigation.
However, the granting of probation is not a matter of right.[5] A defendant does not become automatically entitled to a sentence of probation upon presenting a certain quantum of mitigating evidence in his favor. A sentencing hearing is not analogous to a civil trial in which the plaintiff is entitled to a judgment in his favor if he meets his burden of proof.
The purpose of I.C. § 19-2601 is to promote:
"[T]he reformation and rehabilitation of a defendant, particularly a first offender, and to give him an opportunity to reform and take his proper place in society."[6]
Without question, rehabilitation of the offender is of great importance in the administration of criminal justice.
However, we cannot ignore the fact that another statute is involved in this case. Ogata was convicted of the crime of selling heroin and I.C. § 37-2732 was enacted, in part, to punish such crime. The sale or "pushing" of narcotics is a serious offense. It is not a victimless crime, but one that contributes to the debilitation of the unfortunate purchasers. The record in this case shows that the heroin sold by appellant was extremely pure, thus posing the threat of death by overdose to an unwary user. We cannot justifiably hold, even in view of the strong showing of rehabilitation made by Ogata, that it was an abuse of discretion for the district court to sentence him to two years in prison for selling heroin.
In summarizing the first part of his argument, appellant states that: "[W]e can give no set of circumstances where a person might come before this court on this charge with a stronger case in support of a non-penitentiary sentence." He contends that: "Either Judge Martin abused his discretion or it shall be the Idaho law that all persons charged with this crime must go to the penitentiary without exception." This contention is not valid. The other district courts of this State are vested with discretion of equal dignity to that accorded Judge Martin. We have looked at the circumstances of this particular case and have found no abuse of discretion. In doing so, we do not and indeed may not, *145 establish any rigid mandate for future sentencing of those who violate I.C. § 37-2732.
This Court has ruled that in considering an application for probation, the district judge must consider five factors:
"1) All the facts and circumstances surrounding the offense of which the defendant is convicted; 2) whether the defendant is a first offender; 3) the previous actions and character of the defendant; 4) whether the defendant might reasonably be expected to be rehabilitated; and 5) whether it reasonably appears that the defendant will abide by the terms of the probation."[7]
Furthermore, the decision regarding probation must be based on reason rather than emotion.[8] It cannot be arbitrary or based upon whim, caprice, or upon a ground not sanctioned by law.[9]
The statements of the district court, made when he imposed sentence on Ogata justify a conclusion that the judge had considered all of the circumstances and the testimony offered in Ogata's behalf and found his decision a difficult one to make. Among other things he stated:
"It makes my heart ache to see a good kid like you in my Court * * *. It's heart rending, just absolutely heart rending. These parents are lovely, these witnesses are grand and Mr. Ogata's a fine fellow * * *. I haven't any doubt that Mr. Ogata is not going to use dope any more, I think he's that strong; but while his education might be delayed a little it certainly is not going to be extinguished now because I think he's got what it takes."
It cannot be said that sentencing one convicted of selling heroin to two years in the penitentiary is whimsical, arbitrary or capricious, especially in light of the fact that the maximum penalty prescribed by the legislature is much more severe.
In addition to alleging that the district court abused his discretion by imposing a penitentiary sentence in light of appellant's good prior record and efforts to rehabilitate himself after his arrest, appellant strenuously objects to certain statements made by the court at the sentencing hearing which show that one of the considerations the court had in mind was the deterrent effect on potential drug pushers of imposing a penitentiary sentence on appellant. Appellant contends that such is not a ground sanctioned by law in Idaho for the denial of probation. In examining the authority cited by appellant in support of this contention, we find that it is invalid.
The statement relied on by appellant is dictum from the recent case of State v. Kauffman.[10] That case was an appeal from the denial of probation to a young man convicted of the possession of marijuana, a first offense. The Kauffman case did not in any way involve the issue of general deterrence as a motive for sentencing one convicted of crime to the penitentiary. The crucial statement in the Kauffman case reads as follows:
"[I]n State v. Yockey * * * this court held that it was error for the trial court to deny probation on the ground that to sentence the defendant to prison would deter others from crime. The court pointed out that this was not a *146 logical reason sanctioned by law for denial of probation."[11]
The Yockey case[12] involved the sentencing of two young men  nineteen and twenty years of age  to one to fifteen years in the penitentiary for first degree burglary. They were first offenders and had returned the items of property (jackknives) which they had stolen. The trial judge denied their application for probation after receiving testimony in mitigation at a sentencing hearing. The judge gave several reasons for his action. He was reluctant to put them in the county jail "during the heated period of the year." He said that he took "for granted" that the probation statute could have been applied to them but said:
"Without reference whatever to this statute  without reference to that at all [then I.C.A. § 19-2501] * * * the theory of the criminal law (is) not to seek vengeance against the wrongdoer, but, abstractly, to deter others from the commission of crime."[13]
He added: "I have been so wrought up about this matter and all cases of this kind."[14] He also said: "No matter what judgment is pronounced, it should be in the nature of an example in deterring others from committing crime."[15]
This Court concluded that the trial judge did not in fact exercise any discretion at all, as he was required to do by the probation statute then in effect. Later cases in Idaho have interpreted the reversal and remand in Yockey as based on the failure of the trial court to give the defendants a "significant hearing."[16]
The portion of Yockey which is at issue on this appeal reads as follows:
"While punishment inflicted may be said to have for one of its purposes the deterring of others from committing crime, it cannot be said it is the first prime object, nor a logical reason sanctioned by law upon which to deny relief under the provisions of I.C.A. § 19-2501."[17]
The Yockey court was divided four ways. In addition to the majority opinion, there were two special concurrences and a dissent. One of the concurrences and the dissent disagreed with the majority's view that deterrence of others is not a lawful ground on which to sentence a defendant to prison.
Yockey has been cited several times in past years, but not once has it been cited in support of the proposition that deterrence of others is not a lawful consideration in sentencing. The only exception is the dictum in Kauffman which both oversimplified the Yockey case and turned a statement that deterrence of others is not the prime purpose of punishment into a statement that it cannot be considered at all.
On the other hand, there are two Idaho cases handed down twenty years after Yockey which acknowledge deterrence of others to be a valid consideration in the sentencing process. In State v. Moore,[18] the defendant was convicted of a "crime against nature" and was denied probation. He appealed, referring the Court to testimony from witnesses as to his good character, reputation, standing in the community and to the testimony of a psychiatrist that he was a good risk for probation. This Court, in affirming the sentence imposed *147 by the lower court, listed four objectives of criminal punishment:
"1. Protection of society;
2. Deterrence of the individual and the public generally;
3. The possibility of rehabilitation;
4. Punishment or retribution for wrongdoing."[19]
The Court went on to say:
"The primary consideration is, and presumptively always will be, the good order and protection of society. All other factors are, and must be, subservient to that end. Important as are the humanitarian considerations affecting the accused, his family and other relatives, and the importance to society of rehabilitation itself, such considerations cannot be allowed to control or defeat punishment, where other factors are ignored or subordinated to the detriment of society."[20]
In State v. Wilson,[21] the appellant had pleaded guilty to a "crime against nature" and was sentenced to the penitentiary after a sentencing hearing in which some witnesses recommended a withheld sentence so that the appellant could receive psychiatric treatment. One of the assignments of error was that the trial judge abused his discretion in denying probation. At the time of sentencing, the judge alluded to the fact that the offense in question involved homosexual activity with a fourteen year old boy. He then went on to say:
"This Court feels that you as an adult, along with all other adults, have an obligation to the youth of the community * * *. Besides the rehabilitation of the individual, society must be protected * * *. The public and others so inclined must know that if they engage in activities like yours, that they can expect more than the prospect of psychiatric treatment or probation, and those who have similar inclinations must suppress their inclinations * * *." (Emphasis added).[22]
This Court in affirming the judgment of conviction found no abuse of discretion in the denial of probation. The Court stated:
"Whether appellant was a good risk or a poor risk for probation is not in itself decisive of the issues and possible rehabilitation is not the controlling consideration. In cases of crimes committed against society, the trial court must consider the protection of society, the deterrence of the individual and the public generally, the possibility of rehabilitation and punishment for wrongdoings."[23]
The courts of several other states have held that deterrence of others is a valid consideration in sentencing or denial of probation.[24] In Lynch v. State,[25] the defendants were convicted of inciting to riot, conspiracy to riot and disturbing the public peace. They were sentenced to varying terms in the Maryland House of Corrections. They appealed, alleging inter alia that the sentence represented an abuse of discretion and was cruel and unusual. In affirming the sentence, the court referred to "the possible disastrous consequences of a race riot" and stated: "In the imposition of sentence, the court must not only consider the accused, but in cases of serious import, the example to others of like inclination."[26]
Much has been written about the purposes of the codification of criminal laws and the role of punishment in the administration of criminal justice. Without attempting an exhaustive analysis of these *148 two interrelated subjects, it seems clear that at least three purposes of the enactment of criminal statutes are:
1. To express concisely what behavior society considers to pose an unjustifiable threat of harm to individual or public interests.
2. To warn a potential offender of the consequences which he can expect if he violates the law.
3. Thereby to prevent or reduce the incidence of the proscribed type of conduct.[27]
To the extent that the view is accepted that one of the primary purposes for the enactment of criminal laws is to deter members of society from conduct which is deemed harmful, it is inconsistent to hold that enforcing those laws by inflicting the legislatively prescribed punishment can never be motivated by deterrence. "General deterrence" continues to be a proper consideration in the imposition of punishment, though certainly not the only criterion.[28]
Turning to the case before us, we therefore conclude that it was not improper for Judge Martin to take into consideration his desire to protect the population of Bonneville County from future exploitation by purveyors of illicit narcotics. Therefore his comments at the sentencing hearing such as: "[I]f we fail to enforce these laws, the next one has a license[,]" and "I would think I would be something less than a Judge if I didn't make this determination, and it would be so easy, so easy to do it the other way, but then I'd have my conscience to live with. It's this sort of thing that starts another kid on the same route as Mr. Ogata's going through[,]" are not an indication of an abuse of discretion, but an indication of a proper concern for the relation between the enforcement of the law and the prevention of that conduct which the law prohibits.
Although we feel that the case of State v. Yockey[29] can be distinguished on its facts from the present case, and furthermore that the decision in Yockey really turned on the failure of the trial court to exercise any discretion at all, to the extent that this opinion conflicts with that case, State v. Yockey is disapproved.
On remand the district court is authorized to retain statutory 120 day jurisdiction, pursuant to I.C. § 19-2601.
The judgment is affirmed.
DONALDSON, C.J., and SHEPARD, McFADDEN and BAKES, JJ., concur.
NOTES
[1]  State v. Mitchell, 77 Idaho 115, 289 P.2d 315 (1955).
[2]  State v. Cypher, 92 Idaho 159, 165, 438 P.2d 904 (1968); State v. Sedam, 62 Idaho 26, 38, 107 P.2d 1065 (1940). See generally 24A C.J.S. Criminal Law § 1878 and cases cited therein at n. 65.5 (1962).
[3]  State v. Butler, 93 Idaho 492, 493, 464 P.2d 931, 932 (1970).
[4]  State v. Gish, 89 Idaho 334, 338, 404 P.2d 595 (1965).
[5]  State v. Kauffman, 94 Idaho 20, 23, 480 P.2d 614 (1971).
[6]  State v. O'Dell, 71 Idaho 64, 69, 225 P.2d 1020, 1022 (1950).
[7]  State v. Kauffman, supra note 5, at 22, 480 P.2d at 616. See also State v. Gish, supra note 4 at 338; State v. Mitchell, supra note 1 at 118.
[8]  State v. Kauffman, supra note 5, at 22; State v. Moore, 93 Idaho 14, 16, 454 P.2d 51 (1969).
[9]  State v. Edelblute, 91 Idaho 469, 477, 424 P.2d 739 (1967); State v. Grady, 89 Idaho 204, 213, 404 P.2d 347 (1965); State v. Freeman, 85 Idaho 339, 349, 379 P.2d 632 (1963); State v. Mitchell, supra note 1, at 119; State v. Ellis, 70 Idaho 417, 421, 219 P.2d 953 (1950).
[10]  Supra note 5.
[11]  Id., at 22, 480 P.2d at 616.
[12]  State v. Yockey, 57 Idaho 497, 66 P.2d 111 (1937).
[13]  Id., at 501, 66 P.2d at 112.
[14]  Id., at 501, 66 P.2d at 112.
[15]  Id., at 500, 66 P.2d at 112.
[16]  State v. Edelblute, supra note 9, at 476; State v. Carpenter, 67 Idaho 277, 285-286, 176 P.2d 919 (1947) (dissenting opinion.)
[17]  57 Idaho, at 502, 66 P.2d at 113.
[18]  78 Idaho 359, 304 P.2d 1101 (1957).
[19]  Id., at 363, 304 P.2d at 1103.
[20]  Id., at 363, 304 P.2d at 1103.
[21]  78 Idaho 385, 304 P.2d 644 (1956).
[22]  Id., at 387-388, 304 P.2d at 645.
[23]  Id., at 388, 304 P.2d at 646.
[24]  See Wilson v. State, 220 Tenn. 565, 421 S.W.2d 91 (1967); State v. Rinehart, 255 Iowa 1132, 125 N.W.2d 242 (1963); State v. Gridley, 353 S.W.2d 705 (Mo. 1962); cf. Chosick v. Reilly, 125 Cal. App.2d 334, 270 P.2d 547 (1954).
[25]  2 Md. App. 546, 236 A.2d 45 (1967); cert. den. 393 U.S. 915, 89 S.Ct. 236, 21 L.Ed.2d 200 (1968).
[26]  Id., at 56.
[27]  Cf. Model Penal Code § 1.02(1) (Official Draft 1966).
[28]  See generally, Andenaes, The General Preventative Effects of Punishment, 114 U.Penn.L.Rev. 949 (1966).
[29]  Supra, note 12.
