Archive for the ‘Programming’ Category
July 20, 2010
Filed Under (Programming) by publisher
The term PHP, or Hypertext Processor (originally known as Personal Home Page) is a broadly used, all purpose scripting language which was originally developed for website designs which produces dynamic web pages. PHP is specifically designed to suit the web development of the server-side wherein PHP operates on web servers. A PHP code inside a requested data or file is run by PHP runtime, which usually produces contents for dynamic web pages. Moreover, PHP is also useful in command-line scripting and applications such as the client-side GUI.The PHP can be designed on almost any web server, various operating systems and other platforms. PHP can also be used with a number of relational database management systems. The PHP can be availed without any costs, and the group who developed the PHP can provide the programmers all the source code for them to be able to build, extend or even customize the program.The primary role of the PHP is a filter, or the one which takes inputs from a certain file of stream which contains texts or PHP instructions. It then brings out a stream of information (which commonly becomes the HTML). PHP, which was originally developed to produce a dynamic web page, is now focused on server-side scripting. PHP is also similar to other languages in terms of server-side scripting which provides dynamic contents to a certain client from a particular web server. An example of this includes mod perl, JavaServer Pages from Sun Microsystems, and the Active Server Pages from Microsoft.
July 04, 2010
Filed Under (Programming) by publisher
Clean Your CodeCoding can be fun if you like problem solving and just like problem solving, everyone has their own approach to coding. In a positive light, this diversity leads to better and innovative code emerging. In a negative light, it leads to all sorts of haphazard coding. It is the latter that concerns us here in this article. Putting in good practices when you code is very important, especially if you are working as part of a group. This means that at some point, someone else will look at your code and analyze it. This may be due to an effort to optimize it or to debug it or even to check if it is doing what it is supposed to do. Whichever the reason, it is your duty to make the code readable to anyone who wants to take a look at it.Commenting on code is an essential part of good coding. It allows anyone to understand at a glance what the following code is supposed to do. Documenting classes and functions is also another practice that lends a lot of value to a piece of code.Giving your functions, classes and variables meaningful names will make your code very user/coder friendly. Indenting your code is another practice that makes reading it very easy. It helps to identify blocks of code which could look quite complicated otherwise. One more thing you can do is to use braces to denote where a loop begins and ends. This helps debuggers a great deal when it comes to figuring out complicated code.When fixing a bug, try not to delete code. If you identify a section of code that is causing trouble, just comment it out. That way you can always come back to it and use parts of it, if the new fix caused trouble elsewhere in the code.
June 23, 2010
Filed Under (Programming) by publisher
PHP has had a tumultuous past. Since it first appeared it has only grown in popularity and with that popularity came the criticism. PHP’s growth in popularity can be attributed to several “features” it contains. A lack of important features like namespaces and its apparent disorganized state are some of them. But the ease with which a programmer can learn the language has been it most winning feature. Couple that with the previous two “features” and you can see why PHP developers are often looked down upon. PHP code up until recently was regarded as having multiple vulnerabilities due to being developed by inexperienced programmers. The lack of a structure meant that code could be inefficient, filled with inconsistencies and generally behave in unpredictable ways. While all this cannot be disputed, in recent times things have changed for PHP and it has changed for the better. Object Oriented Programming has literally been the savior for the programming language. By bringing in concepts that are used in more structured languages like Java and C++, PHP has grown in stature. “Proper” PHP programmers, those who adhere to the OOP structure have been growing in numbers over the years and PHP finally seems to have taken its rightful place in the programming world. Organized PHP mediums like CakePHP are now the most popular sources for producing PHP code. Frameworks such as CakePHP draw inspiration from other structured mediums like Ruby on Rails. RoR was the single most influential framework that helped the Ruby programming language achieve structure.
June 10, 2010
Filed Under (Programming) by publisher
Back in the day when webpages were nothing more than HTML, caching was a very handy feature. Browsers simply checked with the server to see if there were any updates to the page and in the event there weren’t any, picked up the page from the cache and displayed it. This was especially useful because in those days, internet access was via Dial-Up Modems. Transferring pages that were full of graphics was time consuming and took up all the bandwidth. However, the advent of PHP and Dynamic webpages has nullified the use of the browser cache. This is because of two particular problems. 2. Generally a web server, such as Apache, informs the browser of any changes to a page using the time of modification of the file. With PHP based pages, the script is not likely to change very frequently. But the content will change and the server has no way of knowing if it has changed because the content is held in a database. In this case the server sends no information regarding the modification time and always served a fresh copy of the page.
May 20, 2010
Filed Under (Programming) by publisher
It is hard to imagine nowadays that PHP was originally created just to count the number of visitors to a homepage. In fact, PHP was originally called Personal Home Page. However, the benefits of PHP were soon realized and the developments that have taken place over the years have turned it into a fantastic programming language. Hypertext Preprocessor or PHP has actually made the web what it is today. The flexibility and dynamism of the language have enabled many radical concepts to come to life. Social Networking giant Facebook may never have experienced success if not for the advances made in PHP development. In fact Web 2.0 owes a lot to this language. Part of the language’s success is also due to its ability to interact with relational databases. Particularly its symbiotic relationship with MySQL has made many ungainly and resource hungry processes simple and efficient. Retrieving information from databases and displaying them online has never been this easy before. The enormously successful Blogging website, WordPress is made possible by PHP and MySQL working together. The database powering the blog holds all the individual blogs and serves them up as and when they are requested. Dynamic websites are easier to maintain and update. Updating pages does not mean that new pages have to be coded anew. Instead, updates can be added just like updating a blog. Pages can be generated based on settings, and served up dynamically for the user who is requesting them. The ability to generate dynamic pages has been one of the key reasons of the explosive growth of the internet.
|
|