Transclusion: Scary words in programming, episode 2

Welcome to episode 2 of Scary Words in Programming!

scary-words-in-programming-with-pam

This week, I wanted to pick on a word that we see a lot in JavaScript land lately, that my friend John K. Paul referenced in his talk, Ember Components Transclude My Directives.

Transclusion

When you read the Angular documentation, you might read such gems as:

ngTransclude: Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion. (source)

What the shit does that mean? Just because you use a word over and over again, Angular, doesn’t mean you described it!

Luckily transclusion really isn’t that scary … transclusion is including another thing in your first thing, by reference.

What.

Well, if you understand what people talk about when they talk about web components, then you understand transclusion. If I wrote some thing (a), somewhere, and I then include that thing in what I’m working on now (b), I’ve transcluded it. If I make a change to a, it is reflected in b, because of being passed by reference.

So you understand it, but didn’t know it!

Interestingly, transclusion was coined by the same person who coined “hypertext” and “hypermedia” – which are other ideas relating to the idea that you should be able to define something once, and then pass it around (share it) among other implementations. If you’re interested in it, that book has plenty of scary – or made up, your choice – words to check out.

 

Be Sociable, Share!

Tags: ,

One Response to “Transclusion: Scary words in programming, episode 2”

  1. Jon Moore October 19, 2014 at 5:58 pm #

    One very familiar example of transclusion is the IMG tag from HTML, at least where the @src is a web URL and not a data: one.

Leave a Reply