Skip to main content

Posts

Showing posts from 2014

Hack : A Look at Programming Language By Facebook

As every PHP developer should be aware of the Programming Language developed by Facebook : Hack.
It is basically based on PHP, you can say PHP but a strongly / statically typed language like Java.(i.e. a language which have fixed datatype).

Let me give you a simple example.
In normal PHP ,we have functions like

<?php
function addOne($num1){
     return ($num1+1);
}
?>

But in hack this code will be changed to

<?hh
 function addOne(int $num1) : int{
     return ($num1+1);


You must have notice the major difference. Inside function parameters, in HACK, we have mentioned int as datatype and int as return type.
This is one of major difference between PHP and Hack.

But this is not the only reason, Why Hack actually evolves??
Basically, We have an advantage in PHP that it need not to be compiled(unlike java), just make changes in file and reload the browser. Languages like Java are slow in sense that they first need to be compiled, then they can be run, but they are easier to manage if the cod…

JSON : Tutorial and Usage

Json Introduction

What is JSON?
JSON stands for JavaScript Object NotationJSON is lightweight text-data interchange formatJSON is language independent *JSON is "self-describing" and easy to understandJSON uses JavaScript syntax for describing data objects, but JSON is still language and platform independent. JSON parsers and JSON libraries exists for many different programming languages. Json Format Example : { "employees": [ { "firstName": "John", "lastName": "Doe" }, { "firstName": "Anna", "lastName": "Smith" } ] }
Why JSON?