Sunday, February 5, 2017

Intro to Programming: PHP


By Xavier Reinders


The most widely interacted with programing languages are not those that run massive servers or perform complex calculations for NASA but those that run the World Wide Web. These languages can be divided up into different categories; interface, background, subprograms and database. Interfaces format what users see, background programs handle movement between interfaces and information flow, subprograms are little games or apps built into a website, and databases are where all the information is stored. PHP, the language I will discuss today, is a background program.


Example of PHP code for a site structure
As a background language PHP as multiple functions and responsibilities within a website. Programming is a fickle thing where even the smallest mistake, a missed letter, could potentially bring down even large sites or programs, as such no one responsibility is the most important. The first responsibility that PHP has is interacting with the interface and database languages. PHP, like most languages, is an open library platform meaning anyone who uses the language can create and share their own functions or function libraries. There is a group of these libraries developed by the creators of PHP and other programmers that allow it to interact with a number of interfaces and databases. PHP does not directly interact with any sub programs that are in a different language instead this job is given to the interface language.
PHP’s second responsibility is structuring the website or web app. While the interface language may make the site presentable and pretty, PHP provides the structure and framework for all functionality in the site. If a website were an office building PHP would make up most of the building, from stairs and elevators to rooms and doors to mail chutes and mail carriers. It creates the entire layout for the site like pages, the means to traverse it like links, the security like password displays, and information transport through input-output boxes.
The final responsibility of this language is temporary information storage and thinking, understanding what to do with input. I put these together because they work off each other within the actual program. PHP receives information puts it somewhere and then starts working with it, doing math or sending user information, like name, birthday, password, to a database somewhere. It can then use that to pull information related to that specific user like account information or whatever else the programmer wants it to do.


While it satisfies each of these responsibilities as a background program it also has some advantages over other background programs. One of the biggest reasons for its widespread use among web developers is because it's relatively simple as far as programming languages go. Ease as far as programming languages go comes from how abstracted from binary it is, meaning how close is it to how humans speak, tell it to do something, it does something. Another of its large advantages is that it is widely recognized by other languages  and systems so it poses few problems when it is used on a wide variety of platforms. On top of that it includes simple libraries to either integrate it into other languages, interface, or integrate other languages into it, interface and database.

No comments:

Post a Comment