When source code makes you want to cry.

The first step to starting my project is working out how to combine the source code together for each inspired program. I can see it is possible to combine PHP, CSS, HTML and Javascript together, the issue is I don’t understand how to do this and what my limitations are.

From my understanding CSS and HTML have been written to work together, Turnwell (2013) explains this as HTML and CSS both being different types of markup (code) and that they have their own unique syntax (the way the code has been written). HTML is the structure for a page and CSS gives the HTML it’s style.

I believe the trickier of the two languages will be getting PHP and Javascript to communicate. King (2003) observes one of the main reasons why programmers get stuck with PHP and Javascript is a lack of understanding of what they both do and where one ends and the other takes over, “Javascript works only on the browser and PHP works only on the web server” (King 2003, pp1).

My other roadblock is not being able to find a definitive answer from an experienced programmer or a tutorial explaining how to combine them all together as one file. I’ve found plenty of chat rooms and posts on sites like Reddit who give ‘industry’ explanations of how it works but nothing that has been explained by an academic.

Ford (2015) believes “A coder needs to be able to quickly examine and identify which giant, complex library is the one that’s the most recently and actively updated and the best match for his or her current needs. A coder needs to be a good listener.” (Ford 2015, pp.3). So I’m going to take Ford’s approach and do my best to become a good listener.

What I’ve been able to work out from hours of scrolling Reddit forums and code forums is this:

There are three main processes involved with getting programming languages to speak.

Marshalling:
This refers to the process of converting an ‘object’ into something that can be loaded by another program. An ‘object’ can be a variable, a data structure, a function or a method and as such, is a value in memory referenced by an identifier. I’m still a little unsure what this means but I gather ‘marshalling’ allows the written code that identifies values and actions and can be translated into a new type of code that can be then understood by a new program.

Serialization:
This is very similar to ‘marshalling’ but is more to do with a developer being able to save the ‘object’ and recreate it into a different format that can communicate with other programs. From my understanding ‘serialization’ has more to do with memory and storage and ‘marshalling’ has more to do with translating code values and identifiers.

Language Binding:
This is the process of ‘gluing the code together’ and can kind of be understood as providing the ‘special code glue’. My basic understanding is ‘binding’ maps a pathway between different code languages. When you have multiple types of languages such as Javascript or C++ the ‘language binding’ requires a thing called a wrapper library that bridges the two programs together. I believe some languages like CSS and HTML offer a thing called a foreign functions interface that allows easy conversations and messages to be delivered between the programs. Now this is where it gets trickier, programs that don’t have a set up foreign functions interface need a special written thing called an application programming interface or ‘API’. It looks like API’s are sub-code languages that are specially set up to provide communication between more complex programming languages which means I might be in trouble….

At this stage I really don’t know if I can achieve what I’m hoping to achieve without being an expert coder and considering I don’t understand much more than the basics of coding maybe expecting myself to write an API is a bit much.

 

References

Turnwell, A., Alex Turnwall 2014, HTML & CSS: how they work together, viewed 20 September 2018.<http://www.turnwall.com/articles/html-and-css-work-together/>

King, S., itamer 2003, Using PHP and Javascript together, viewed 20 September 2018. <https://www.itamer.com/using-php-and-javascript-together/278/>

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.