Metaprogramming (Comment)

The first thing that comes to my mind when reading/hearing the term metaprogramming the word metadata comes to my mind but they don't have the same meaning. Metadata is the data of the data of something, and Metaprogram is not the data of a program, it refers to a program that creates other programs. Imagine a program that creates an app for iOS devices and Android, wait! There is already some options in the internet to do such thing, for example Ionic, but metaprogramming is not that new. There are many other metaprograms like gcc, python interpreter, parse generators like bison, and more.

A great example that I read was the one of Erika. She was more outstanding than his programming professor and made a program that generated another one. Although she didn't create something revolutionary, it was so good to explain metaprogramming.

As mentioned in the lecture, a quine is a program that prints its own source code, but why would this be helpful for something? Imagine that you have multiple servers (thousands or more) and you need to copy your program to all of them, I think it might be easier to create a program with some threads to replicate and send the program. You could even create a program that executes the installation of that program instead of going one by one.

Another example that came to my mind just now is the configuration that is used in a platform for continuos integration in which your code is executed and tested to see if it is ready to be deployable.

To finish I want to talk about the quote by Richard Sites, "I’d rather write programs that write programs than write programs." I agree with him because I think that in order to create advanced programs, one needs to create programs that create and execute other programs. It is like a pile of jenga pieces one behind the other. With just a piece, you can't create a castle, but with many, you could build an empire! 

References:

Ortiz, A. (2007). "An Introduction to Metaprogramming". Obtained on Nov 4, 2017 from http://webcem01.cem.itesm.mx:8005/s201713/tc3049/metaprogramming.html

Comentarios

Entradas populares de este blog

Understanding the SOLID Principles - Comment

Is Design Dead? - Comment