Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
tokumei21256yNo, it's because most programs don't actually care about the extension a file has. It is just part of the file name. Windows still uses the extension to identify file types (and even hides it from the user by default - geez) but that is the only contrary example I can think of.
-
I sense a long time windows user who still believes that file extensions actualy mean something [even more - that they determine file type]... :)
buddy you have soooo much to learn... :) -
@kiru15 the interpreter looks at the code inside the file, not the name of the file.
Think of it as a wallet, the money is inside the wallet (file) and the currency can change (you have one wallet with javascript, the other one with java code)
If you put the java currency inside the javascript wallet, you can still buy things on java island with the javascript wallet.
It's what's inside the wallet that the stores care about, understood? 😉 -
Jifuna37266yAt first I thought this was an easteregg, know I'm disappointed :(
Also why do you have a k directory in the root of your filesystem? -
Code isn't magic, code is text. The parser doesn't do anything, really, except open the file and try to understand the inside. The file can be named whatever you want.
-
LuxARTS16136yThe extension in the name it's just a suffix to identify fast the content. But the real information of the file is on the metadata. The metadata stores the encoding, date created, last date edited, etc. When you open a file, the porgram look this metadata.
In simple words, calling you kirv51 intead of kiru15 will not change your person.
Related Rants
we(Friends) discovered this yesterday.
Steps:
1. created a file.js and added a console.
2. renamed the file.js to file.java
3. ran that file.java through node
result: displayed in that image.
Javascript running .java .....seriously?
js how many hidden surprises you have for me. it was even running in .txt, .php etc
Okay let's come to actual point .
I tried to research on this. however, i couldn't find any links related to it.
Well, I tried the same with casperjs and python.It behaved the same.
is this behaviour because it is a scripting language?
Please do share your thoughts on this
question
js