An Introduction to Metaprogra... what?
During my first years studying programming, I always considered
that creating a program that wrote programs was something quite confusing and
complicated. I consider this article to be something useful and simple to
introduce the concept of metaprogramming, even if I got lost at some point of
the way and did not completely grasp the whole idea.
The professor is right in that a metaprogram is usually
considered as something complicated and a little bit mystified. It was quite
helpful that the example for the introduction to this topic was given in ruby,
since it is a very simple yet powerful language that is dynamic and lets you
concentrate in the concept rather than in the language syntax, almost like it
was pseudocode.
What was left not so clear to me is how code modification
during runtime can be considered as metaprogramming. Since it is something so
exclusive of certain languages and until this course I had not been introduced
to it or used it, I’m not very familiar with the concept of how is this
considered and I just see it as benefit of inheritance because editing a class
so its children have access to the new methods and you do not have to write them
in each class you want to use them.
I had not thing of metaprogramming as something that us, programmers
would interact with very frequently, but that does not seem to be the case since,
yes, a compiler and an interpreter are also metaprograms. Although I do not see
this as something that I would personally write every day, let alone writing
quines, I believe it is something interesting, to conceptualize and keep in
mind that a program is just another file you can write as output when printing
an output of a program.
Comentarios
Publicar un comentario