CodeIgniter 3 - Tips to setup your project

CodeIgniter (CI) is a fantastic MVC (Model-View-Controller) framework for PHP web app development. Many people use it for personal or professional projects. In this blog, I will discuss few tips to setup the configuration for your project.

1.) Setting up environment:

 It is very important to set the ENVIRONMENT variable in index.php file. You first develop, test and then move your application to Production. Depending on these phases, your project needs different configurations like API key, payment gateway key etc. For example, when you develop or test your app, you need to connect to the payment gateway's sandbox instance with the sandbox's credentials and when you are ready for prod, you connect to the payment gateway's production instance with real credentials.

How to setup the environment properly? Open the index.php and search for the text:

define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');

This will set the environment depending on the environment variable CI_ENV set in the .htaccess file. Open the .htaccess file and put the below line of code for Apache:

Read More

How to use virtual host in WAMP server in PC

Website development in local computer or PC has lots many configuration. Developers who are using WAMP (Apache, MySQL and PHP bundle for windows) server can develop the website by putting the project files into the WAMP installation folder which is most of the time:

c:\wamp\www\folder_name\

and you need to access your test site as:

http://localhost/folder_name

where the folder name is your project folder name where index.php file exists. As a developer you must have thought of accessing your site as a general URL and also keeping your project folder and files outside the WAMP directory. To accomplish this you need to setup the virtual host into the WAMP server and this blog describe details steps involved to accomplish the goal.

Setting up virtual host in WAMP server involves the below steps:

Read More

What programming language should I choose to start with?

Blog primary image

Many freshers or beginners ask question about what is the best programming language to start with? What programming language should I choose if I want to enter the computing world? Lets discuss about which programming language to start with. Why it is better to choose to start with.

Books to refer for learning:

Read More

Programming Best Practices - A Guide for Application Developers

Standardizing a software product is a nightmare of product manager or software leads. When many people are working to build a software application, each developer has its own style to write code or design. Setting a standard to follow across all development modules help minimizing the risk of being diverted from standardize products.

Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
--Martin Fowler


A good programmer need not only to write code that computer understands but also humans can read and understand it easily. Here come the great aspect of code readability. Watch the four video lecture.

Read More

C Programming: Can you guess the output? Printing ASCII Table.

ASCII C Program

Have you wondered why the above program results in infinite loop? Apparently there is no reason to be. It is a very simple program to print the ASCII table and we know that the ASCII value of characters range from 0 to 255 and it is prominent that the loop is going from 0 to 255. So why the infinite loop?

Read More