Giter Club home page Giter Club logo

gentlemanly-php's Introduction

Gentlemanly PHP

Introduction

Many of the early pioneers of computer science, such as Charles Babbage and Ada Lovelace, were British and came from a time when communication was much more civilised than now and letter writing was commonplace. Whilst most programming languages today use a subset of English for their keywords, the terse conciseness of modern code would make it very alien to those early developers. This short script goes some way to solving this problem, allowing the user to write a computer programme in a manner much more becoming an English gentleman or lady.

Usage

The mappings from Gentlemanly PHP to actual PHP can be seen in the source code, defined in the $syntax array. A file containing Gentlemanly PHP code can be passed to the interpreter, which will by default evaluate the code and write a 'proper' PHP version to a separate file. To evaluate and translate a file instructions.gphp to instructions.php, use:

php interpreter.php instructions.gphp

To prevent the evaluation of the code, and to save the translated version to a file called translated.php, use:

php interpreter.php --eval=false --outfile=translated.php instructions.gphp

Instructions to the interpreter take the form of a letter, and so must have a correct salutation and sign-off. The interpreter will use the name at the end of the letter to address the user and so one should sign-off in the manner that one would wish to be addressed. For example, the canonical Hello World programme would be:

Dear Interpreter,

Proclaim "Hello world!";

Yours sincerely,
<your name here>

Acknowledgements

This was started after reading the entertaining article If PHP were British, by Dave Child.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.