This blog seemed a little complicated since it
explains many terms that I did not fully understand. First of all, I had to
investigate what was Metaprogramming and found that: “Metaprogramming is
the art of writing of computer programs with the ability to treat programs as
their data. It means that a program could be designed to read, generate, analyze
or transform other programs, and even modify itself while running. In some cases, this allows
programmers to minimize the number of lines of code to express a solution
(hence reducing development time), or it gives programs greater flexibility to efficiently handle new
situations without recompilation. One of the types of metaprogramming involves
only writing their program using generic programming”
When reading all this information I remembered
my classes of Programming Languages where we use LISP like programming language.
One of the features of LISP is that it is a functional language which allows
you to make or use macros, which are precisely programs that write programs,
something like writing with code what you want to code. The advantage of this
was made the programs more efficient and we reduced the compilation time.
When we talk about Compile-Time we mean to
prepare for the future of our program, with this I mean that Compile-Time
Metaprogramming allows us to interact with the compiler to allow the
construction of arbitrary program fragments by user code. We must always be
prepared for growth, and Compile-Time Metaprogramming is a powerful tool that
helps us to apply optimizations and new features to our language.
For those who were surprised when using macros,
this tool will leave them with the mouth open. It is good that we learn ways to
improve the code because, that our program works does not mean that it does on
the best way, we should always seek to improve and make our code as optimal as
possible and prepare it for the future.
No hay comentarios:
Publicar un comentario