@funfunfunction
  @funfunfunction
Fun Fun Function | Templating languages: The hidden costs - Fun Fun Function @funfunfunction | Uploaded April 2017 | Updated October 2024, 4 hours ago.
πŸ’– Support the show by becoming a Patreon
patreon.com/funfunfunction

# Videos mentioned:

πŸ”— Declarative programming: youtube.com/watch?v=yGh0bjzj4IQ
πŸ”— Reduce basics: youtube.com/watch?v=Wl98eZpkp-c
πŸ”— Currying: 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
twitter.com/mpjme

πŸ”—The camera I use
amzn.to/2kwlpAD

πŸ”— The microphone and sound recorder I use
amzn.to/2kwli8e
amzn.to/2lcVSfd

πŸ”— The lights I use
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
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 patreon.com/funfunfunction

πŸ’› mpj on Twitter
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:
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:
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.
Templating languages: The hidden costs - Fun Fun FunctionYou dont use version control in REAL projects! (Software developer war stories with Sean May)Unit testing in JavaScript Part 1 - Why unit testing?Closure exposure therapy - Exploring closures in JavaScript with friendly live mob programmingOptional Chaining Operator in JavaScriptCoding and Cooking - MPJs Musings - Fun Fun FunctionFearless by loving failure - Isa Silveira - Developer DiscussionsTrying React Hooks for the first time with Dan AbramovTest Driven Development (TDD) on a real appDoes pair programming actually save time? (Brian Clark)Announcement: Twitch Live Streams + Holiday VacationCode Review: How can we do it better?

Templating languages: The hidden costs - Fun Fun Function @funfunfunction

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER