685

I have one simple question, that got stuck in my mind for a few days: What is VanillaJS? Some people refer to it as a framework, you can download a library from the official pages.

But when I check some examples or TodoMVC, they just use classic raw JavaScript functions without even including the library from the official pages or anything. Also the link "Docs" on the official webpage leads to the Mozilla specification of JavaScript.

My question is: Is VanillaJS raw JavaScript? And if yes, why people refer to it as "framework" when all you need is a browser without any special included scripts?

I am sorry for a probably stupid question but I have no idea what people are talking about when they say "VanillaJS".

Cerbrus
  • 70,800
  • 18
  • 132
  • 147
user1377911
  • 7,285
  • 5
  • 18
  • 16
  • 245
    VanillaJS is regular Javascript. That's the joke. – Nelson Dec 06 '13 at 23:54
  • 30
    http://vanilla-js.com (download the library, tick all the options and look into the source code to see how it's done) – Qantas 94 Heavy Dec 06 '13 at 23:55
  • 35
    Like vanilla ice-cream is basically plain, "vanilla" in a lot of slang means "plain or boring" – TecBrat Dec 06 '13 at 23:55
  • 4
    No! You don't need to download it! It's pre-installed on every browser! – cronvel Jul 14 '15 at 11:07
  • 21
    “Final size: 0 bytes uncompressed, 25 bytes gzipped.” Love it :O) – cronvel Jul 14 '15 at 11:11
  • 23
    The really depressing thing is it appears on job specs as VanillaJS - tragic how little many recruiters know about the roles they recruit for. – Phil Lello Feb 05 '16 at 09:45
  • 1
    @PhilLello Please link me to one of these job specs! – BadgerBadgerBadgerBadger May 08 '16 at 06:27
  • @Kaylors here's search results for job specs requesting applicants to be versed in VanillaJS - as of right now it yields 29 search results: http://www.jobrobot.de/content_0400_jobsuche.htm?cmd=res&keywords=vanilla&txt=ja&respage=0 – HumanInDisguise Jul 05 '16 at 06:34
  • VanillaJS is pretty much regular Javascript. When you click on the documentation, you'll be transported to MDN Javascript page. It was I think developer joke. Vanilla means unexciting, normal, conventional. – Kent Aguilar Dec 12 '17 at 10:13
  • 1
    It took me 5 minutes to understand why is that vanilla js library is 0 KB! LOL! vanilla-js.com – Duke Feb 26 '18 at 11:15
  • PSA: Don't add a "VanillaJS" tag. It is not a library, language or feature. It's a joke. As such, it is not useful as a tag. – Cerbrus Oct 10 '18 at 07:49

9 Answers9

580

This is VanillaJS (unmodified):

// VanillaJS v1.0
// Released into the Public Domain
// Your code goes here:

As you can see, it's not really a framework or a library. It's just a running gag for framework-loving bosses or people who think you NEED to use a JS framework. It means you just use whatever your (for you own sake: non-legacy) browser gives you (using Vanilla JS when working with legacy browsers is a bad idea).

ThiefMaster
  • 310,957
  • 84
  • 592
  • 636
  • Why do you qualify your answer with (non-legacy)? Or rather, why is it a "bad idea"? – Blue Skies Dec 07 '13 at 00:03
  • Because it's a major pain in the ass to deal with oldIE without at least some helper functions - and when you need them you are better off with some lightweight library instead of re-implementing them on your own. – ThiefMaster Dec 07 '13 at 00:04
  • 1
    That's a matter of opinion, and is dependent on the circumstance. – Blue Skies Dec 07 '13 at 00:04
  • "for your own sake: non-legacy" - better? ;) – ThiefMaster Dec 07 '13 at 00:05
  • 13
    FYI: Vanilla JS is now 0 bytes, 25 bytes compressed. – Trisped Jun 19 '15 at 22:09
  • 8
    @BlueSkies The fact "that plain ("vanilla") JS is bad when working with legacy browsers" is not an opinion, it's a fact. It's the very reason why frameworks like jQuery and others were invented: to simplify your life when dealing with the browser-incompatibilities hell! :) The only reason why vanilla JS started coming back in 2016 is that most modern browsers are now much more standards-compliant than they were in the past, so you need less and less frameworks (especially if you are a javascript expert). – Sorin Postelnicu Mar 07 '17 at 20:36
  • In my opinion this answer is too unclear for such a simple thing. Other answers, telling directly that this is a joke, are less confusing. At the first time I thought that writing `// VanillaJS v1.0` in code is some serious and meaning convention. – Karol Selak Mar 28 '17 at 16:37
  • 1
    In my opinion most developers should understand this answer just fine ;) – ThiefMaster Mar 28 '17 at 16:38
  • 2
    But StackOverflow is for all developers, not only most :) – Karol Selak Mar 28 '17 at 21:21
369

Using "VanillaJS" means using plain JavaScript without any additional libraries like jQuery.

People use it as a joke to remind other developers that many things can be done nowadays without the need for additional JavaScript libraries.

Here's a funny site that jokingly talks about this: http://vanilla-js.com/

Koen Peters
  • 12,798
  • 6
  • 36
  • 59
74

VanillaJS is a term for library/framework free javascript.

Its sometimes ironically referred to as a library, as a joke for people who could be seen as mindlessly using different frameworks, especially jQuery.

Some people have gone so far to release this library, usually with an empty or comment-only js file.

Ben McCormick
  • 25,260
  • 12
  • 52
  • 71
  • 3
    @ThomasW I like portability and concise, productive syntax too. That's why I write `function doSomething(args) { ... }` and then in my code I can just `doSomething` in even less code than jQuery. ;) – Niet the Dark Absol Jul 11 '14 at 14:52
  • 4
    Great, if you don't have to deal with real-world DOM or browser issues. Most people building webapps do. DOM manipulation & browser portability are the problems, to which jQuery was invented (improving on Prototype.js) as a solution. I agree with@NiettheDarkAbsol, that for pure algorithm code jQuery is not relevant. – Thomas W Jul 12 '14 at 01:56
  • @ThomasW Do "real-world DOM or browser issues" cause a huge problem in IE 9 and later? As far as I can tell, most of said issues are with IE 8 and earlier. IE on XP was unsupported when you wrote that comment, and IE 8 on Windows Vista and Windows 7 is no longer supported now that Microsoft is supporting only the latest IE available for each OS. – Damian Yerrick Mar 06 '16 at 14:54
  • Sure, IE 9 and 10 have incompatibilities! Somewhat fewer, but they still exist. Another developer and I spent 4-5 weeks at my last job squashing such bugs. I believe compatibility bugs/ variances will continue to exist for the forseeable future. – Thomas W Mar 07 '16 at 04:55
  • And if you include the enterprises inside it will take at least a decade – Randall Flagg Mar 16 '16 at 08:16
48

This is a joke for those who are excited about the JavaScript frameworks and do not know the pure Javascript.

So VanillaJS is the same as pure Javascript.

Vanilla in slang means:

unexciting, normal, conventional, boring

Here is a nice presentation on YouTube about VanillaJS: What is Vanilla JS?

simhumileco
  • 31,877
  • 16
  • 137
  • 115
  • 3
    This is really just a stupid joke that is very confusing to newbies. It's so obvious that front end engineers like to cloud the waters so they can appear to know more than the next person. – Ringo Jul 17 '17 at 05:07
  • 1
    @Ringo Not any more than French jokes that require a deep knowledge of French culture to understand are intended to make people who tell them appear to know more than others. People *may* be using some "in-jokes" to exclude others, but that's not a good assumption to make, especially when they are quick to explain when asked. – Roy Tinker Jan 03 '18 at 20:22
45

The plain and simple answer is yes, VanillaJS === JavaScript, as prescribed by Dr B. Eich.

JackDev
  • 4,891
  • 1
  • 39
  • 48
43

VanillaJS === JavaScript i.e.VanillaJS is native JavaScript

Why, Vanilla says it all!!!

Computer software, and sometimes also other computing-related systems like computer hardware or algorithms, are called vanilla when not customized from their original form, meaning that they are used without any customization or updates applied to them (Refer this article). So Vanilla often refers to pure or plain.

In the English language Vanilla has a similar meaning, In information technology, vanilla (pronounced vah-NIHL-uh ) is an adjective meaning plain or basic. Or having no special or extra features, ordinary or standard.

So why name it VanillaJS? As the accepted answer says some bosses want to work with a framework (because it's more organized and flexible and do all the things we want??) but simply JavaScript will do the job. Yet you need to add a framework somewhere. Use VanillaJS...

Is it a Joke? YES

Want some fun? Where can you find it, http://vanilla-js.com/ Download and see for yourself!!! It's 0 bytes uncompressed, 25 bytes gzipped :D

Found this pun on internet regarding JS frameworks (Not to condemn the existing JS frameworks though, they'll make life really easy :)), enter image description here

Also refer,

Community
  • 1
  • 1
prime
  • 14,464
  • 14
  • 99
  • 131
5

"Vanilla JS” is an expression that got popular after the publishing of a satire website in 2012 (http://vanilla-js.com/). There’s a section covering its story/meaning in this post.

So why the joke? It kind of came as a modern response to the old school knee-jerk reflex of relying on jQuery and additional JS libraries. With the ECMAScript spec and modern browsers capabilities, the need to bypass plain JS with external libraries to maintain consistency across browsers just isn’t there anymore. Here’s a site that shows you how true this is with concrete examples: http://youmightnotneedjquery.com/

VinnyG
  • 6,883
  • 7
  • 58
  • 76
1

This word, hence, VanillaJS is a just damn joke that changed my life. I had gone to a German company for an interview, I was very poor in JavaScript and CSS, very poor, so the Interviewer said to me: We're working here with VanillaJs, So you should know this framework.

Definitely, I understood that I'was rejected, but for one week I seek for VanillaJS, After all, I found THIS LINK.

What I am just was because of that joke.

VanillaJS === plain `JavaScript`
AmerllicA
  • 29,059
  • 15
  • 130
  • 154
0

There's no difference at all, VanillaJS is just a way to refer to native (non-extended and standards-based) JavaScript. Generally speaking it's a term of contrast when using libraries and frameworks like jQuery and React. Website www.vanilla-js.com lays emphasis on it as a joke, by talking 'bout VanillaJS as though it were a fast, lightweight, and cross-platform framework. That muddies the waters! Thus, it can be a little philosophical question: "how many things do I compile to Vanilla JavaScript without being VanillaJS themselves?" So, a mere guideline for that is: if you can write the code and run it in any current web-browser without additional tools or so called compile steps, it might be VanillaJS.

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220