Metaprogramming seems to be a useful tool when one is actually able to use it to solve a real practical problem. Otherwise, metaprogramming looks like an interesting and enjoyable experiment to understand how a language works.
Basically, metaprogramming referes to the art or science of creating programs responsible of creating other programs and/or running them. When is this useful? When a program can be modified during runtime on interpreted programming languages, when a program requires a lot of repetitive code, or when a program needs to react with a solution on the fly.
For many interpreted programming languages, one of the fundamental solutions for what problems may arise when metaprogramming are the "eval" instructions. What these instructions do basically is transforming strings into interpretable statements.
How about you create a program whose only purpose is to read and execute whatever is found in a text file or even just run a part of a program's source code?
Suscribirse a:
Comentarios (Atom)
An Introduction to Metaprogramming (Commentary)
Metaprogramming seems to be a useful tool when one is actually able to use it to solve a real practical problem. Otherwise, metaprogrammin...
-
We tend to get excited when experimenting an orginazed concept such as Object Oriented Programming, we want to make full use of all its qu...
-
The term "craftmanship" is nowadays used mostly for the arts, or for hand crafted goods, nobody would really think about a prog...
-
In the course of all my years of studying Computer Sciences, UML has been hammered religiously into my brain as the best (and sometimes o...