Back to Browse

Templating languages: The hidden costs - Fun Fun Function

50.9K views
Apr 24, 2017
28:21

๐Ÿ’– Support the show by becoming a Patreon https://www.patreon.com/funfunfunction # Videos mentioned: ๐Ÿ”— Declarative programming: https://www.youtube.com/watch?v=yGh0bjzj4IQ ๐Ÿ”— Reduce basics: https://www.youtube.com/watch?v=Wl98eZpkp-c ๐Ÿ”— Currying: https://www.youtube.com/watch?v=iZLP4qOwY8I # Hot spots in the video: 04:23 Expressive 11:23 Declarative 15:41 Complexity 18:06 Social cost 21:32 Loss of tools ๐Ÿ”— mpj on Twitter https://twitter.com/mpjme ๐Ÿ”—The camera I use http://amzn.to/2kwlpAD ๐Ÿ”— The microphone and sound recorder I use http://amzn.to/2kwli8e http://amzn.to/2lcVSfd ๐Ÿ”— The lights I use http://amzn.to/2ld8jrX # Partial script Today Iโ€™m going to compare templating languages, like Handlebars, to generating DOM with JavaScript, like React does. There are two main arguments for using templating languages - that they are expressive and declarative. But there are also three big costs of using template languages, complexity, social cost, and loss of tools. Five years ago or so, the industry standard way of rendering DOM was to use a template language to glue your business logic together with your HTML. Then a few years ago React arrived on the scene, and did away with templating languages completely, and instead just using a JavaScript in place of the templating language. The native JavaScript approach is gaining a lot of traction, but a lot of developers still hold template languages in high regard, and are not convinced that the native JavaScript approach is a step forward. In this video, Iโ€™m not going to talk about some cost and benefits of template languages. Some feel that templates language vs. native JavaScript is just a matter of taste - I donโ€™t agree with that. I totally recognize that computer science isnโ€™t physics and there isnโ€™t a clear-cut right or wrong, but there are benefits and costs that we can and should reason about. The two big benefits of templates are that they are expressive and declarative. Expressive. Templating languages are very expressive, because unlike JavaScript, templating languages are designed just for expressing HTML. Declarative. Templating languages are designed to encourage declarative interfaces. By the way, if youโ€™re not sure what declarative programming is you can watch [this video] first and this video is going to make a lot more sense. But, all technologies have both benefits and costs, and to add a templating language youโ€™re paying with added complexity, social cost, and loss of tools. Complexity. Template languages also add complexity, because they introduce an entire little language engine to your stack. Social cost. Anyone working with your codebase now has to learn this extra little language in addition to JavaScript. Loss of tools. If youโ€™re using a templating language, youโ€™re throwing away all the power of JavaScript, not just the power of the language itself, but also libraries written in it, and tooling like editors and linters. ๐Ÿ’› Follow on Twitch and support by becoming a Subscriber We record the show live Mondays 7 AM PT https://twitch.tv/funfunfunction ๐Ÿ’› Fun Fun Forum Private discussion forum with other viewers in between shows. https://www.funfunforum.com. Available to patron members, become one at https://www.patreon.com/funfunfunction ๐Ÿ’› mpj on Twitter https://twitter.com/mpjme ๐Ÿ’› CircleCI (Show sponsor) Robust and sleek Docker-based Continuous Integration as a service. I used CircleCI prior to them becoming a sponsor and I love that their free tier is powerful enough for small personal projects, even if they are private. Use this link when you sign up to let them know you came from here: https://circleci.funfunfunction.com ๐Ÿ’› Quokka (Show sponsor) Wonder how MPJ evaluates JavaScript inline his editor. Quokka is the answer - use this link when you buy to let them know you came from here: http://quokka.funfunfunction.com ๐Ÿ’› FUN FUN FUNCTION Since 2015, Fun Fun Function (FFF) is one of the longest running weekly YouTube shows on programming ๐Ÿ… thanks to its consistency and quality reaching 200,000+ developers. ๐Ÿคฆโ€โ™‚๏ธ The Failing Together concept is what makes FFF unique. Most coding content out there focus on step-by-step tutorials. We think tutorials are too far removed from what everyday development is like. Instead, FFF has created a completely new learning environment where we grow from failure, by solving problems while intensively interacting with a live audience.

Download

1 formats

Video Formats

360pmp495.8 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Templating languages: The hidden costs - Fun Fun Function | NatokHD