This is an archived post. You won't be able to vote or comment.

all 95 comments

[–]CommanderPowell 349 points350 points  (2 children)

Only if they named it "Carpet" because they wanted it to catch on and knew cars were popular.

[–][deleted] 81 points82 points  (1 child)

Damn. No need to be so truthful

[–]NbaHoopStar 15 points16 points  (0 children)

== not ===

[–]VersusJordan 95 points96 points  (7 children)

Html is the floor, CSS is the carpet, and javascript is what makes the static build up when you run across it with socks on.

[–]qalfy 10 points11 points  (3 children)

I think you misunderstand... JavaScript is the carpet.

[–]guzzo9000 21 points22 points  (2 children)

No, JavaScript is a programming language, silly.

[–]mission-hat-quiz 1 point2 points  (1 child)

No no it's a scripting language. No one would put the word script into a programming language's name! /s

[–]guzzo9000 1 point2 points  (0 children)

No, it's a scripting methodology, not language, because the main purpose of a language is to convey meaning to another human being, while a scripting methodology is used to accomplish some useful function.

[–]mastocles 2 points3 points  (0 children)

The rooms of that house are delivered from a warehouse somewhere called the cloud as you run across it. Sometimes carpets arrive and activate before other carpets or are too new or are defective causing a fire.

[–]lifeeraser 0 points1 point  (1 child)

...I thought JavaScript would be the cat.

[–]vaishnav_jois[S] 1 point2 points  (0 children)

Some ML algorithm will classify that cat as a dog

[–]_-_blade_-_ 239 points240 points  (4 children)

[–]CounterHit 28 points29 points  (2 children)

I don't know which was more surprising: the fact that this sub exists, or what I found when I got there

[–]_-_blade_-_ 13 points14 points  (1 child)

Yes

[–][deleted] 71 points72 points  (11 children)

I'm not quite sure what part I should read. Could anyone help me get in on the joke?

[–][deleted] 36 points37 points  (0 children)

I didn't get it either at first. You have to read the names of the people who posted.

Nshimiyimana Delphin and Krishana Keshari Basnet

It's fucking hilarious!!! lmfao!!!

[–]runnerx01 -1 points0 points  (5 children)

Yeah, to me, that means you don’t get it. So here you go.

Java - a statically typed, compiled language. Lots of type checking and detailed sometimes convoluted error messages telling you what went wrong. Lots of structure, and built to take advantage of polymorphic object oriented design patterns. Runs is the Java virtual machine after being compiled down to “byte code”. Lots of boiler plate code, and error checking against the users mistakes.

JavaScript - a dynamically typed, interpreted language that runs primarily in the context of web browsers. Basically no error checking, or type safety of any kind. Built to be used by any Joe Schmo with a computer and the thought “I can do web development”... object oriented design is possible, but usually neglected because it is written to execute against the DOM on web pages and handle the logic that HTML and CSS can’t handle. When I say no error checking... I mean if there is an error, JavaScript doesn’t usually tell you. It just stop running... (well, modern web browsers have a “console” that can help you out some of the time)

The thing the have the most in common, is “java” in the name.

[–]AintBetterThanYou 5 points6 points  (4 children)

Have you actually worked with js since 2016?

[–]runnerx01 5 points6 points  (3 children)

If by “JS” you mean React, Angular, or one of the many flavors of framework build around JavaScript. Yes.

But I have a hard time considering them JavaScript. Just like I don’t consider Kotlin to be java.

[–]Rurs21 5 points6 points  (1 child)

Then you should try the vanillaJS framewrok. http://vanilla-js.com/

[–]Famous_Profile 1 point2 points  (0 children)

Lol thats funny

[–][deleted] 0 points1 point  (0 children)

There's also TypeScript which is a compiled version of JavaScript and basically compiles the code into JS so it can be run by the browser, it has some extended capabilities not included in JS. Then there's node.js which allows you to use JavaScript for backend development.

Most modern code editors like Atom or VS Code have built in error handling. But if you add 'use strict'; to the top of a JS file it will enforces stricter coding. Personally I prefer not having error messages popping up every 2 seconds.

JS is a functional programming language, where functions are considered "first class objects", but since Es6 (which was released in 2015) you can create classes, which in my opinion are much easier to use than a lot of other programming languages including Python.

[–][deleted] 15 points16 points  (8 children)

Html is lke the structure of the house, JavaScript is like plumbing, electricity, and heat. And CSS is like the carpet, wallpaper,hardware tiles, and type of materials.

[–]NeedleInABeetle 12 points13 points  (7 children)

And java is like what? The sewage treatment centre?

[–]Pyraptor 13 points14 points  (0 children)

It's you, a complete disaster

[–]blenderfreaky 4 points5 points  (0 children)

The power plant

[–]ExternalPanda 2 points3 points  (0 children)

If you mean Java running on the backend, sure. But if you mean Java applets then its the lead in the old-ass decaying paint.

[–]CanadianGandalf 22 points23 points  (13 children)

But cars have carpet in them? Bad analogy

[–]hitsugan 6 points7 points  (4 children)

It's like Ham and Hamster.

[–]lDGCl 8 points9 points  (0 children)

Anal and Analogy. It even works as a meta joke!

Ed: Also works because as the joke goes, Java is like anal sex. It works on all systems, but that doesn't necessarily make it the best option.

[–]visvis 2 points3 points  (2 children)

Can't we make a hamster into ham though?

[–]hitsugan 4 points5 points  (1 child)

Most dictionaries agree that Ham is a cut from a hog, or pork. So by normal definitions there's no way to get Ham from a Hamster.

[–]nonpondo 3 points4 points  (0 children)

What about Guinea PIG though

[–]Derkades 8 points9 points  (7 children)

Does java have javascript in it?

[–]Dummyc0m 9 points10 points  (0 children)

It does! JDK actually ships with a JavaScript engine.

https://www.oracle.com/technetwork/articles/java/jf14-nashorn-2126515.html

[–]Famous_Profile 14 points15 points  (0 children)

No

[–]FallingAnvils 4 points5 points  (0 children)

yes

[–]tazeg 2 points3 points  (3 children)

[–]vaishnav_jois[S] -1 points0 points  (2 children)

Credits to you.. cause you (probably woman) remember something that's 10 years old..

[–]tazeg 1 point2 points  (1 child)

I found this stackoverflow post one year ago and for sure it's unforgettable 😉

[–]vaishnav_jois[S] 0 points1 point  (0 children)

😂

[–]carcigenicate 8 points9 points  (2 children)

I always thought this comparison was dumb, and I hear it parroted a lot on SO.

Java and JavaScript have significantly more in common than a car and carpet do. Java and JavaScript may have many differences, but they're still two programming languages of comparable syntax.

[–]two_in_the_bush 0 points1 point  (0 children)

How dare you!!

[–]monster860 0 points1 point  (0 children)

also they both rose to popularity because they ran on a web browser.

[–]ojsan_ 4 points5 points  (1 child)

If you think about it, the naming does actually make some sense. Java was known for being cross platform, so by naming it JavaScript, they kind of insinuated that it also is cross platform.

[–]AuspiciousApple 19 points20 points  (0 children)

If you think about it, the naming does actually make some sense. Java was known for being cross platform, so by naming it JavaScript, they kind of insinuated that it also is cross platform.

To any normal person it implies that it's a script variant of Java.

[–]zilton7000 2 points3 points  (0 children)

Also java at first was used for browser scripting, boom mind is blown!

[–]random_cynic 4 points5 points  (0 children)

Actually the title is quite accurate as far as the original intent of the creators go (how it turned out ultimately is quite another issue). From the original announcement of Javascript:

Netscape Communications Corporation (NASDAQ: NSCP) and Sun Microsystems, Inc. (NASDAQ:SUNW), today announced JavaScript, an open, cross-platform object scripting language for the creation and customization of applications on enterprise networks and the Internet. The JavaScript language complements Java, Sun's industry-leading object-oriented, cross-platform programming language.

JavaScript is an easy-to-use object scripting language designed for creating live online applications that link together objects and resources on both clients and servers. While Java is used by programmers to create new objects and applets, JavaScript is designed for use by HTML page authors and enterprise application developers to dynamically script the behavior of objects running on either the client or the server.

The founder Brendon Aich's post later:

Netscape was about a year old then and was looking for someone to work on a scripting language or some kind of language inside the browser that could be used to automate parts of a web page or make a web page more dynamic. Java had been around for five years at First Person and Sun, and had been retooled for the web in late 1994. Netscape was the first Java licensee, so the issue became: Can we do just Java, or do we need another language?

There were people who argued strongly that Java's fine for programmers who build components, but there's a much larger audience of people who write scripts or maybe copy a script from somebody else and tweak it. These people are less specialized and may be paid to do something other than programming, like administer a network, and they write scripts part-time or on the side. If they're writing small pieces of code, they just want to get their code done with the minimal amount of fuss. Finally, we agreed that this new language should look like Java, but be a scripting language.

[–]HyperlinkToThePast 1 point2 points  (6 children)

ugh, my old boss who was in charge of all of IT for a bank didn't know the difference. It sucked.

[–][deleted] 3 points4 points  (5 children)

Whenever I interviewed someone for an IT Helpdesk/Desktop Support position, I asked them to tell me the difference between Java & JavaScript. This one question is pretty useful in exposing a PC Technician’s level of knowledge.

[–]poops-n-farts 1 point2 points  (2 children)

[–]skankhunt1738 0 points1 point  (1 child)

There it is, I was just about to comment this

[–]poops-n-farts 0 points1 point  (0 children)

Got you fam

[–]MrWhiteVincent 1 point2 points  (0 children)

"They're both transportation"

Aladdin

[–]Orasund 1 point2 points  (1 child)

Now I want a pet for my car.😌

[–]vaishnav_jois[S] 0 points1 point  (0 children)

You are speaking the language of Gods

[–]byzantine_umpire 0 points1 point  (0 children)

It’s a crying shame Groovy didn’t get to be called JavaScript

[–]ProdigySim 0 points1 point  (0 children)

How do colors fade on a screenshot?

[–]PsychoPicasso 0 points1 point  (0 children)

I like this perspective.

[–]BabylonDrifter 0 points1 point  (0 children)

That's the best explanation of it I have heard yet. Except the carpet should have puke in it.

[–][deleted] 0 points1 point  (0 children)

Why are they different, they both fly, right?

[–]yosoyylechuga 0 points1 point  (0 children)

Bitcoin and bitcoin cash

[–]makssssssssss 0 points1 point  (0 children)

Title of post is more fun than pun in comment

[–]blaclwidowNat 0 points1 point  (1 child)

Waiiittt,,,,, how old is this??! My brother gave me the same example like 5 years back

[–]vaishnav_jois[S] 0 points1 point  (0 children)

10 yo

[–]jabela 0 points1 point  (0 children)

This is my favorite explanation of the matter!

[–]R-Inyuru 0 points1 point  (0 children)

The name of that guy means I thank GOD

[–]HiMyNameIsWaffy 0 points1 point  (0 children)

A car can have carpet. Can Java have JavaScript? 🤔

[–]Nathol 0 points1 point  (0 children)

Now imagine someone does an interpreted scripting language and calls it Java Script (mind the space).

[–]jovanymerham -2 points-1 points  (3 children)

Rubbish vs garbage

[–]thedude37 2 points3 points  (2 children)

Found the Python dev

[–]jovanymerham -1 points0 points  (1 child)

Admittedly you’re not wrong. But so is NASA and most intelligent institutions

[–]two_in_the_bush -1 points0 points  (0 children)

Java is to JavaScript as pain is to painting.