Treasure Match

Judah turns four this Sunday. We’re having a small party in a nearby park. Pam has organized everything; the kids, the place, the cake, the theme. To invite everyone, she used her PaperlessPost app…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Metaprogramming

Part 1: Introduction into Metaprogramming and Code generation

This article will be mostly an introduction into the two topics. There will be several examples in different programming languages to help give you a better understanding of the topics, and hopefully get you excited to start using them yourself (hint: you probably already do).

Metaprogramming can help make your code contain less repetition, and improve code readability. And in some cases it can make you feel like a wizard.

Metaprogramming simply means to write programs that write programs. An analogy that is often used is the car factory.

Imagine yourself as someone who builds cars, and one day you notice that the steps you are performing can be automated. So you decide to automate this process, and in the process you build a car factory. But again you notice that building your factory involves similar steps as well, so you automate them, building a factory that builds factories that builds cars. This is metaprogramming.

Don’t worry if some of these terms are not familiar. This article contains descriptions and examples to most of the topics mentioned above.

Add a comment

Related posts:

How Birthdays can be Used to Enrich Lives

Birthdays are one of those strange traditions we have. Whereas with Thanksgiving, we stuff ourselves silly and shop until we pass out the next day, birthdays compel friends to do most whatever the…

3 Good things I learned after getting laid off from my very first job

I have a story to tell today. It’s taken a while to ripen. I didn’t know how to start, what to say, or if it would even matter… A few things you should know about me before I tell my story — I’m a…

Like 11

The Twin Towers were the proud symbol of the New York City skyline for many years until they ceded their location to a space sublime.