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.
π 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.