Static Variable and Static Functions

Class and object are almost synonymous. One needs another. You need a class because you need one or many objects. Objects usually retain the characteristics of class and represent them when they are instantiated. But there is a caveat. Each object with its own set of member variables is destroyed after the execution.
What happens then if you want to retain the member values of an object throughout the program?
You can declare it as a ‘static’ variable or static function.

Read More…

Using Methods or Functions

One of the key pillars on which modular programming stands now is methods. Sometime you may call it functions. In fact ritually in C# it is called methods and PHP is happy about calling it functions. After all, it is something that makes a program move. It is actually full of action. Without a method or function program becomes immovable.

Read More…

Abstraction and Encapsulation

Abstraction and Encapsulation
Abstraction and Encapsulation are important features of any Object Oriented Programming language. Abstraction means presenting the required feature hiding others. Encapsulation means packaging one or more components together. Let us have a detail look into the inside stories of Abstraction and Encapsulation.

Read More…

Loop, Fibonacci Series and WordPress

What is Fibonacci Series?

The Fibonacci sequence is named after Fibonacci. His 1202 book Liber Abaci introduced the sequence to Western European mathematics,[4] although the sequence had been described earlier in Indian mathematics.[5][6][7] By modern convention, the sequence begins either with F0 = 0 or with F1 = 1. The Liber Abaci began the sequence with F1 = 1, without an initial 0.

Read More…

Namespace : C#, PHP and WordPress

The first statement in a typical C# program is
using System;
By declaring this statement we are including namespaces in the program. It means now we can refer to the classes defined in the namespace ‘System’. What does it actually mean?
Read More…

What PHP is and what is the difference with C#?

I take out the definition from the page of PHP Manual directly.

Read More…

The Principles of Object-Oriented Programming – Compiler and C Sharp

Usually vocabulary and grammar build a language. Programming language also follow almost the same pattern as it has a set of keywords which may compared to vocabulary and syntax that can be categorised as grammar.
Through vocabulary and grammar people interpret and understand language. Now the question is, can computer directly interpret and understand the instructions written in any programming language?
No, they can not.
A computer needs a translator to translate those set of instructions and thereby execute them. So something comes between programming language and machine language that computer understands. A special program called ‘compiler’ is needed to do that job. It follows the input-process-output (IPO) procedure to get the job done.
This process of conversion is called compilation. At the end of the day each programming language needs a compiler, like C# needs ‘csc’ compiler.

The Principles of Object-Oriented Programming – Introducing C# and PHP

Introducing C# and PHP

Computer languages have come up a long way since 1940s. It develops, rebuilds itself making path for the new languages to appear and thereby has changed the whole gamut of the computer science.
In the 1940s, scientists punch the instructions into a room sized computer and those instructions were a series of one and zeros. It was complicated and called machine language. You may also call it First Generation of Computer Language.

Read More…

Flexibility of classes and Polymorphism

Flexibility of Classes

The concept of classes is inexorably flexible. One may want to extend an old class adding few new characters. In doing so one must not abandon the old class. Suppose is a web site that stores information about various programming language. Now one would like to add a different kind of topic into it like literature. As language is sequential, you can say it is a spitting image of any procedural programming language as it runs sequentially. They both share some common traits, tendency and over all logic.

Read More…

The Principles of Object-Oriented Programming – C# and PHP: A Comparative Study – part 3


You can sense an object. So an object shows some tangible behaviour or you may call it as an tangible entity that you can feel, see or smell. Suppose a tennis ball has some characters like

1) it has a visual boundary
2) it has a well defined purpose (like bouncing)
3) it involves an action that you can direct to it (like hitting or tossing)
4) you can see, feel or even smell it

Read More…