Showing posts with label Programming Facts. Show all posts
Showing posts with label Programming Facts. Show all posts

Wednesday, 9 July 2014

What If Programming Languages Were Superheros

It was a Wednesday afternoon and I started wondering if programming languages were superheroes who would they be?

Recommended: Top 10 Computer Programmers In The World History 

Introduction:

Programming languages all have their own distinctive style and odd character. Not surprisingly these unique set of traits tend to attract deviants that sometimes form a community who then hold conferences to talk about their deviant ways :)

Assembly Language(Hulk)



Assembly fights “close to the metal”, moving and shifting data around like no ones business. Like the Hulk its powers really has no limits. But it comes at a heavy cost, you have to do everything yourself. Power it seems is tied directly to its emotional state. There are no safety nets, the world is not made of rainbows and kittens. Assembly is a lone gun and will carry that heavy burden all day long. But be very careful and don’t make assembly angry, because when assembly gets angry it will scream “ASSEMBLY CRAAASH” and destroy your computer.

Python Language (Batman)



Saving a City from criminals is not easy, solving crimes created by evil geniuses requires a touch of elegance and sophistication. With a vast library just an import away, its not so much programming as merely expressing your will. Let python worry about the details for you. But Python has a dark past too, its real power can never be know, it’s character can never be made public. It hides itself as “just another scripting language, running on an VM interpreter hybrid wasting expensive CPU cycles..”


PHP Language(Joker)



Some minds are so twisted, so mangled they were never meant to be understood. Peering into PHP code, is looking directly into the abyss. But once you stare into the darkness that is PHP, the darkness stares back at you. Some say mixing all concerns (view, logic, mode) all in one place is madness, but maybe PHP is just ahead of the curve?


Also Read: Programming Contest #1 [ Fuzzyprograms ] Prize Money $5 Or 250Rs.


C++ Language(Robocop)



C in its original form, was a normal hardworking decent language. But a fateful accident with Object Oriented Programming and desire to make it faster, stronger, and harder resulted in C++. Yes C++ is super shiny but it also created things like protected abstract virtual base. If you can master this shiny machine then amazing power is yours to be commanded. However most just use the hardworking C side of C++.

Ruby Language(Ironman)



Ruby is advanced, its neurokinetic nanoparticle morphological language is were its power lies. Some say the original Ruby had humble beginnings, made in a cave by single man called Matz with nothing but simple tools. While it combines the best ideas from other languages it ends up just monkey patching it all together. Lately people say Ruby has become shallow and just a big “front”, this is sad because the new generation of kids conflate Ruby with the framework “Ruby On Rails”. The real question on everyones mind is can Ruby stand on its own without its web framework?

Java Language(Wolverine)



An old language, Java was born out from an age of suffering during the jurassic era of C and C++. Its a very verbose and heavy language, but the over engineering is by design (a design that only a committee of bowel movement architects could appreciate). If you want to lift heavy metal, steel or a suspension bridge Java will not let you down. Of course the downside is if you want to lift small light plastic things, Java will be of no use. Java believes that native languages like C and C++ are a disease and that managed languages are the next evolution. Java believes in a final war between native and managed languages as an inevitable clash.

Lisp Language(Professor Xavier)



Is code data or is data code? some say “it’s all in your RAM”. And as for language, do you really need syntax? When you look deep enough you will find that all languages are connected and can be expressed by an AST. Lisp’s simplicity and metacircular evaluator is nothing short of pure genius that is perhaps only comprehensible on another metaphysical plane of existence. Lisp wishes to promote the peaceful message that all data and code can co-exist, it stands in a neutral place where it believes it can create harmony by virtue of homoiconicity. Sadly not everyone understands or appreciates Lisp’s high virtues and instead run away in fear.


So what do you think? if your programming language was a superhero which character would it be?



Sunday, 29 June 2014

Top 10 Computer Programmers In The World History

A programmer is a person who can create and modify computer programs. No matter what type of programmer one may be, each and every contributes something to the society, no matter how trivial. Yet, there are those few who have contributed beyond what a single programmer usually does in an entire lifetime.


Programmers are Computer enthusiasts, who communicate with Computer system by writing codes, And they develop software for Computer. A programmer is also known as Coder, Developer and Software engineer.                                                            

I have written before about faces behind popular programming languages and all seemed geeks of their times! (and their time hasn’t yet passed!). So how much money do programmers make? Or to be specific, top programmers? the ones who created programming languages or used it to achieve phenomenal success (like Google). Here is a list of 10 persons who made great bucks in the Programming world.


Here is a list of world's best programmers around the world who changed computer era by developing computer software, programs and also operating system.



 
Larry Page
                                                              

Co Founder of
Google
and 6th richest in America and 27th Richest Billionaire in the World (Forbes)



Sergey Brin
                                  

Co Founder of
Google
and 28th Richest Billionaire in the World (Forbes)


 
Tim Berners Lee
                                 

(Most influential but not as wealthy as Googlers)

Claim to fame: Creator of WorldWideWeb!




                                                Also Read:  History Of C Language

Matt MullenWeg
                                                     

Creator of the most popular OpenSource Blogging platform Wordpress. He is 27 now.



Rasmus Lerdorf
                                 

Creator of the language that runs 34% of websites today!


James Gosling
                                                                                         

Claim to Influence: Creator of Java


               Download E-book For Free (100%) ~Programming Language : Click Here




Linus Torvalds
                                                         

Creator of the popular OpenSource OS Linux 




Dennis Ritchie
                                                     

Creator of C Language and key Developer of UNIX OS


 
Bjarne Stroustrup
                               

Claim to Fame & Influence: Creator of C++


 
Bram Cohen
                              

Creator of torrent P2P protocol. Thanks to him for millions of pirated downloads!

NOTE:

Which of the above mentioned greatest programmers of all time has influenced you the most? Share your thoughts with us in the comments section below!

Tuesday, 1 April 2014

C program that won’t compile in C++




Although C++ is designed to have backward compatibility with C there can be many C programs that would produce compiler error when compiled with a C++ compiler. Following are some of them.

1) In C++, it is a compiler error to call a function before it is declared. But in C, it may compile

#include<stdio.h>

int main()

{

   foo(); // foo() is called before its declaration/definition

}

int foo()

{

   printf("Hello");

   return 0;

} 



2) In C++, it is compiler error to make a normal pointer to point a const variable, but it is allowed in C.

#include<stdio.h>

int main(void)

{

    int const j = 20;

    /* The below assignment is invalid in C++, results in error

       In C, the compiler *may* throw a warning, but casting is

       implicitly allowed */

    int *ptr = &j;  // A normal pointer points to const

    printf("*ptr: %d\n", *ptr);

    return 0;

}



3) In C, a void pointer can directly be assigned to some other pointer like int *, char *. But in C++, a void pointer must be explicitly typcasted.


#include<stdio.h>

int main()

{

    void *vptr;

    int *iptr = vptr; // In C++, it must be replaced with int *iptr = (int *)vptr;

    return 0;

}

This is something we notice when we use malloc(). Return type of malloc() is void *. In C++, we must explicitly typecast return value of malloc() to appropriate type, e.g., “int *p = (void *)malloc(sizeof(int))”. In C, typecasting is not necessary.

4) This is the worst answer among all, but still a valid answer. We can use one of the C++ specific keywords as variable names. The program won’t compile in C++, but would compiler in C.

#include<stdio.h>
 
int main(void)
{
    int new = 5;  // new is a keyword in C++, but not in C
    printf("%d", new);
}

Similarly, we can use other keywords like delete, explicit, class, .. etc.

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above

Saturday, 29 March 2014

Did You Know You Can Also Print "Hello World" Without Using Semicolon

Generally when we use printf("") statement, we have to use a semicolon at the end. If printf is used inside an if Condition, semicolon can be avoided.

Yes, You can see the example.

Source Code
 #include<stdio.h> 
 int main(){ 
 //printf returns the length of string being printed 
 if (printf("Hello World\n")) //prints Hello World and returns 11 
 { 
 //do nothing 
 } 
 return 0; 
 } 
   

Output

Explanation:

The if statement checks for condition whether the return value of printf("He llo World") is greater than 0. printf function returns the length of the string printed. Hence the statement if (printf("H ello World")) prints the string "Hello World".


You may also like:

* Draw a Bouncing Ball on Surface using C++ Graphics 

* C++ Program To Implements Snake and Ladder Game ( Graphics )

Tuesday, 18 March 2014

Quine - Print its own Source Code as Output

How Many Of You Know That You Can Also Print Your Source Code As An Output Using Quine.

What Is A Quine ??


A quine is a computer program which takes no input and produces a copy of its own source code as its only output. The standard terms for these programs in the computability theory and computer science literature are "self-replicating programs", "self-reproducing programs", and "self-copying programs".

Quine – A self-reproducing program


A quine is a program which prints a copy of its own as the only output. A quine takes no input. Quines are named after the American mathematician and logician Willard Van Orman Quine (1908–2000). The interesting thing is you are not allowed to use open and then print file of the program.

An example of a quine in C language is given below which produces the source code as an output.

To the best of our knowledge, below is the shortest quine in C.

Source Code
main()
{
    char *s="main() { char *s=%c%s%c; printf(s,34,s,34); }";
    printf(s,34,s,34);
}



Output


This program uses the printf function without including its corresponding header (#include ), which can result in undefined behavior. Also, the return type declaration for main has been left off to reduce the length of the program. Two 34s are used to print double quotes around the string s.

NOTE: It can be written in any other language like java, python, etc.

And in Python:


s = 's = %r\nprint(s%%s)'
print(s%s)


And in Ruby:

eval s="print 'eval s=';p s"

If you find a shorter C quine or you want to share quine in other programming languages, then please do write in the comment section.

Contact Us

Want to ask anything? Be our guest, give us a message.

Name Email * Message *