An Introduction to Metaprogramming

During my first years of programming, I've always considered this idea quite cool although I didn't quite know what I was doing. There were sometimes when I had to make a simple script but that would turn into something very tedious because of some repetitive but different task that had to be written, and sometimes there was a way in which you could easily make a way around it, but this wasn't always the case, as when I tried to convert a string inside the runtime of the program. Afterward, in the Programming Languages course, I got a better idea on metaprogramming and what problems it attempted to solve.

A metaprogram is usually considered as something complicated and basically something magic; it works somehow, not sure how. However, our professor and author of the article teaches us this is not always true.

The article's example is very simple and teaches you how this could be easily achieved using a simple syntax language like Ruby. Fortunately, this example made me a bit more conscious of how this is achieved and it's no longer magic for me.

Comentarios

Entradas populares