You heard me. From what I see here, and unless I am looking at a completely wrong place, Google Code Prettify hasn't been updated in almost an year now. Has it been abandoned?

I have just heard about Highlight.js, and it looks promising, up-to-date, and moreover its functionality is similar to that of Google Code Prettify (automatic syntax highlighting for 41 languages).

Is there a reason why Stack Overflow is sticking with Google Code Prettify?

PS: I am only asking, not suggesting, like some have (mis-)understood.

  • 2
    I have a slight hunch that a dev from Stackoverflow might have worked on Prettify and that they might find this a bit insulting. – mowwwalker Mar 23 '12 at 1:10
  • 2
    Cody pretty much answered this: there's really no reason to switch on a whim, especially considering the time invested in integrating Prettify. But you should also consider that this is a bit of code that needs to be both small and extremely fast - it runs on every page, and some pages have... A lot of code on them. Locking up someone's browser for a few extra features won't fly. – Shog9 Mar 23 '12 at 3:02
  • 1
    Maybe it just wasn't updated because nothing needs to be updated :) – BalusC Mar 23 '12 at 4:23
  • @Chichiray : The 'README' page states that "It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl and Ruby, but, because of commenting conventions, doesn't work on Smalltalk, or CAML-like languages." - - So, there's definitely scope for some betterment. – its_me Mar 23 '12 at 4:57
  • 2
    @Shog9: Looking at softwaremaniacs.org/blog/2011/05/22/highlighters-comparison/en I see a case for highlight.js being faster and thus a better choice for SE. With more languages supported (63 as of the latest version), better support for mixing languages (JS in HTML is fully supported) and higher speed, isn't it time for highlight.js to be given some thought? – Martijn Pieters Nov 7 '13 at 14:44
  • @MartijnPieters Is SO still using Google Prettify? – Robert Mallow Nov 16 '14 at 19:08
  • @RobertMallow: yes, nothing has changed there. – Martijn Pieters Nov 16 '14 at 21:54
  • @MartijnPieters thanks. – Robert Mallow Nov 16 '14 at 21:59
  • Official answer was given on a newer request. – Shadow Wizard Wearing Mask V2 May 25 '16 at 5:49

And why would Highlight.js be better than Google Code Prettify, considering that you admit yourself that you just heard of Highlight.js and therefore are probably unaware of its advantages/limitations/etc.?

You mention something about it looking "promising", but what does that mean? Moreover, why do we need something that only looks promising when we have something that already works just fine?

You also contend that it is "up-to-date". I'm not really sure what that means when it comes to a syntax highlighter. Are the syntax of various programming languages changing so rapidly and drastically that you really need to keep the code coloring engines up to date? Moreover, is Google Code Prettify out of date? And if it is, then why couldn't you (or someone else) simply submit a patch to the project, thus bringing it up to date and contributing something to the community at the same time?

You say that "its functionality is similar to that of Google Code Prettify", but that's not a justification for switching to something else. The functionality of Ubuntu is similar to that of Windows, but that in itself is not a good reason for switching.

To steal an explanation from Eric Lippert, features start with a "score" of -100. You have to provide good reasons why they should be implemented because implementing them takes time away from the programmers responsible, time that they could spend doing something else (like fixing bugs or implementing other features). And this is even worse than a regular feature request, because you're suggesting that we switch from something that works to something else that also works. That doesn't really sound like it's worth it to me.

  • 1
    I was only asking. I am no coder. I am beginning my JavaScript lessons... so no wonder I didn't know about Google Code Prettify until about a month ago, and Highlight.js about a day ago. :) (And I didn't mean to insult anyone like @Walkerneo said) Besides I didn't ask you to change - - just why you are using Google Code Prettify over some other. – its_me Mar 23 '12 at 1:28
  • 13
    Not to argue with the position, but to address a couple of points: highlight.js is not popular mostly because I never marketed it (still don't), as for "why better" you might read this: softwaremaniacs.org/blog/2011/05/22/highlighters-comparison/en – isagalaev Mar 23 '12 at 6:52
  • 4
    Credit where it is due: I stole that from former C# language program manager Eric Gunnerson. See blogs.msdn.com/b/ericgu/archive/2004/01/12/57985.aspx – Eric Lippert Mar 26 '12 at 20:13
  • "Are the syntax of various programming languages changing so rapidly and drastically that you really need to keep the code coloring engines up to date?" Apparently Stack Exchange thinks so: still no support for yaml: meta.stackexchange.com/questions/255968/… :p – DylanYoung Nov 6 '18 at 21:17

Not the answer you're looking for? Browse other questions tagged .