Wednesday, July 8, 2015

Java != JavaScript



This topic is somewhat a pet peeve of mine.. I tend to get slightly annoyed when people or job descriptions act as if Java is JavaScript, and vice versa. They are not related! Yes, they are both prevalent in our everyday lives; from the phones we use to the websites we access. A lot of software that an average person will interact with regularly, technology wise, will have been influenced entirely if not partially by one of these two languages. Everything from your mobile device, websites, to even the apps on your smart TV.. Here's one example of a line of smart TV's that are in fact populated with apps that are programmed in Java (FYI: Android apps are typically programmed with a combination of Java and Android XML) ----> http://www.theverge.com/2015/1/5/7497383/sony-new-smart-tv-run-android-tv-ces-2015


Here are some quick facts..



Java:

-Launched by Sun Microsystems in 1995.
-Developed by James Gosling.
-Object-Oriented Programming Language (objects represent instances of a class).
-Strongly-Typed language.
-Runs on the Java Virtual Machine(JVM).
-The language was originally named OAK.
-Considered a general-purpose programming language.
-Able to run on any OS where JVM is available.
-Java supports multi-threaded programming.
 (multiple processes running simultaneously)
-De facto language used to develop Android apps.
-Filename extension is .java


HELLO WORLD IN JAVA:

class helloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}






JavaScript:

-Developed at Netscape and released after Java in 1995
-Originally called LiveScript, Sun Microsystems gave Netscape
 an exclusive license to allow the switch from LiveScript to JavaScript.
-Does not use classes.
-Typically embedded in HTML.
-Interpreted and ran by the client's browser.
-Loosely-typed language (Don't have to declare a data type before using it).
-Supported by all if not most browsers.
-Prototyped scripting language with object-oriented aspects.
-Filename extension is .js




HELLO WORLD IN JAVASCRIPT:    
                            
<!DOCTYPE HTML>                                  
<html>                                                              
<body>                                                                  
                                                                           
  <p>Header...</p>                                        
                                                                       
  <script>
    alert('Hello, World!')
  </script>

  <p>...Footer</p>

</body>
</html>






Both awesome and productive languages? YES! The same? NO!

1 comment:

Getting 60gb of Json Data into MySql

The other day I had write a 60gb Json file to a MySql database. The data was already clean and deduped, so all that had to be done was to wr...