Further Edit: General deterrence also sometimes takes priority over rehabilitation, even for youthful offenders, in cases of large-scale drug manufacture and cultivation. A recent example is the Court of Appeal’s decision in Doan v The Queen  VSCA 258.
Nettle JA [at 17, the other members of the Court agreeing]:
I agree and I wish only to add a brief observation concerning the submission advanced on behalf of the appellant that the judge had erred in the emphasis which his Honour placed on the importance of general deterrence. In my view lest there be any doubt about it, there should be no doubt that in cases involving cultivation of a narcotic plant in not less than a commercial quantity, general deterrence is at the forefront of sentencing considerations. Consequently, as the judge rightly observed, in cases of this kind there is less room to give weight to considerations of such as youth and antecedents that would otherwise be the case. In the result the judge also correctly found in a case of this kind an immediate term of imprisonment should ordinarily be regarded as virtually unavoidable.
In Braslin and Cowen v Tasmania  TASCCA 1, the Court of Appeal identified a number of authorities across jurisdictions making similar observations about the role of youth as mitigation:
Mr Braslin’s age
28 Mr Braslin was nearly 20 years old at the time of these offences. As such, in strict terms, he qualifies as a “young offender” so that the principles applicable to such offenders applied to him; see for example Maney v White  TASSC 7 and Spaulding v Lowe 4/1985. However, whilst youthfulness of itself is generally taken to be a mitigating factor, and the rehabilitation of the offender assumes predominant importance, that is not exclusively so, and does not remain true for all cases irrespective of their nature. In R v Tran  VSCA 52; (2002) 4 VR 457 at  Callaway JA said:
The rehabilitation of youthful offenders, where practicable, is one of the great objectives of the criminal law, but it is not its only objective. It is not difficult to cite cases where other objectives have had to prevail. It is true that, in the case of a youthful offender, rehabilitation is usually far more important than general deterrence, but the word I have italicised is there to remind us that there are cases where just punishment, general deterrence or other sentencing objectives are at least equally important.
29 Deterrence and retribution do not cease to be significant merely because persons in their late teens are the persons committing grave crimes, particularly crimes involving physical violence…; R v Phan (1991) 55 A Crim R 128 at 135.
The moderation of the emphasis given to rehabilitation rather than general deterrence and retribution has been acknowledged where the young person “has conducted him or herself in the way an adult might conduct him or herself and has committed a crime of violence of considerable gravity”; R v AEM  NSWCCA 58 at  – ; KT v R (2008) 182 A Crim R 571 per McClellan CJ at CL at . In the latter case, McClellan CJ at CL continued:
25 … In determining whether a young offender has engaged in ‘adult behaviour’, the court will look to various matters including the use of weapons, planning or pre-meditation, the existence of an extensive criminal history and the nature and circumstances of the offence. Where some or all of these factors are present the need for rehabilitation of the offender may be diminished by the need to protect society.
26 The weight to be given to considerations relevant to a person’s youth diminishes the closer the offender approaches the age of maturity. [References omitted]
30 Whilst still qualifying as a youthful offender, Mr Braslin was approaching the end of the time for which such a claim can be made. Regard must be had to the nature and circumstances of these offences, particularly the premeditation and the detailed planning involved. The commission of such crimes, which include a crime of strong violence and considerable gravity, indicates the behaviour of an adult. It is true that Mr Braslin has no convictions for any matters of real significance, but it must be said that the frequency and extent of his offending in a short period of time, at the least shows a disregard for the law. For those reasons, factors of deterrence and retribution/denunciation were not overshadowed by issues of youth and rehabilitation, but were entitled to be given considerable weight.
Edit: Another recent example of the courts’ willingness to sentence young first-time offenders to immediate imprisonment is found in the South Australian case of Crispin v Police  SASC 210 (see below)
The hot-button issue of the moment is assaults in public, usually by young men, and usually fuelled by alcohol. On the one hand, community concern about this particular type of crime is intense, and the need for general deterrence is obvious. On the other, the youth and (frequently) absence of criminal history of the accused are significant mitigating factors. How does the Court effectively balance these competing interests in arriving at an appropriate sentence? R v Mills (1998) 4 VR 235 is quoted from both ends of the bar table. For the prosecution, the case provides support for the proposition that imprisonment is an appropriate disposition for a serious assault, even where the accused is young and has no previous criminal history (the question then becoming how that imprisonment should be served.) Mills also endorses a number of mitigatory principles:
i. Youth of an offender, particularly a first offender, should be a primary consideration for a sentencing court where that matter properly arises.
ii. In the case of a youthful offender rehabilitation is usually far more important than general deterrence. This is because punishment may in fact lead to further offending. Thus, for example, individualised treatment focussing on rehabilitation is to be preferred. (Rehabilitation benefits the community as well as the offender.)
iii. A youthful offender is not to be sent to an adult prison if such a disposition can be avoided, especially if he is beginning to appreciate the effect of his past criminality. The benchmark for what is serious as justifying adult imprisonment may be quite high in the case of a youthful offender; and, where the offender has not previously been incarcerated, a shorter period of imprisonment may be justified. (This proposition is a particular application of the general principle expressed in s.5(4) of the Sentencing Act.)
(These three points were made by counsel in oral argument in Mills and incorporated into the judgment of Batt JA, and later repeated with approval by Maxwell P in R v Wyley  VSCA 17.) The Court of Appeal said in DPP v Ross that, “[consistency] in sentencing is absolutely fundamental to public confidence in the criminal justice system. It is also a basic requirement of the rule of law.” Despite this, it’s impossible to state a general rule of when Mills will influence the penalty for a youthful offender, and when it won’t. DPP v Bridle  VSCA 173 and R v Lay  VSCA 120 are assault cases where sentence has been mitigated by the application of Mills. Of course, there have been other cases where youthfulness has been accepted as a factor in mitigation of penalty without the case of Mills being specifically referred to. On the other side of the ledger, in R v Jones  VSCA 204, R v Teichelman  VSCA 224, R v Johns  VSC 415 , DPP v Lawrence  VSCA 154 and DPP v Simpas & HR  VSCA 40 reference to Mills has not resulted in a lesser sentence on appeal. Why some sentences and not others were reduced by Mills turns on the individual circumstances of each case. In Wyley, Maxwell P rejected the suggestion that there are some categories of cases which attract the Mills considerations and others that do not. He said,
19 In the course of argument, it was contended for the appellant that there were now recognised classes of case to which the principles in Mills were inapplicable. Conversely, it was said, there are certain kinds of case where those principles should be given ‘full application’. With respect, however, I consider that these submissions reflect a misunderstanding of what was said in Mills. There is not some special set of rules applicable to young offenders of which it can be said either that they do not apply at all or, alternatively, that they apply fully. Rather, what Mills did, in my respectful opinion, was to draw attention to the great significance for sentencing of looking to the offender’s future, as well as to the past conduct for which the offender is being sentenced. 20 Mills constantly reminds sentencing courts, and this Court on appeal, that there is great public benefit in the rehabilitation of an offender and in maximising the prospect that the offender will carry on a law-abiding life in the future. But that consideration is not unique to young offenders. Nor is there any one correct answer as to how the balance is to be struck between that consideration and others which may point towards a period, or a longer period, of imprisonment, rather than a non-custodial sentence. Thus understood, the later cases of DPP v Lawrence and R v Nguyen are not to be viewed as ‘excluding the principles in Mills’, but simply as instances of how those principles are to be applied. 21 As counsel properly conceded towards the end of his submissions, there is a role for general deterrence to play in relation to every class of case. In relation to certain classes of case, however, general deterrence may have a particularly important role to play. The present case is of that kind. Violence of this kind, in circumstances of this kind, is so prevalent, that general deterrence is seen to have particular importance. But, again, the role of general deterrence will vary with the circumstances of the case.
Edit: Back in 1975, Bray CJ of the South Australian Supreme Court famously said of youthful offenders in Birch v Fitzgerald (1975) 11 SASR 114 at 116-117,
Nevertheless, there are offences in which, as it seems to me, the deterrent purpose of punishment must take priority. When people act under the influence of liquor, passion, anger or the like so as to constitute themselves a physical danger or potential physical danger to other citizens it may well be that a sentence of imprisonment will be appropriate, even in the case of a first offender of good character, in order to impress on the community at large that such behaviour will not be tolerated … it may be that the incidence of such violence will be reduced if it is brought hme to those likely to resort to it that if they do they may very well be punching, striking, butting or kicking themselves into gaol.
This passage was reproduced recently in the decision of Anderson J in Crispin v Police  SASC 210.
Many of the cases referred to emphasise a Youth Justice Centre as the appropriate place of incarceration for a youthful offender, if imprisonment is found to be necessary. In some cases the Court will determine a less severe penalty becomes appropriate if the option of YJC is not available (if, for example, the accused is outside the designated age bracket, though still considered youthful). However, where the maximum period for incarceration in YJC is exceeded by the term of imprisonment thought necessary by the Court, adult prison may then become the appropriate sentencing option: R v PP  VSC 578.