Factory Functions in JavaScript

preview_player
Показать описание
💖 Support the show by becoming a Patreon

Video transcript and code examples here:

💛 Follow on Twitch
We record the show live Mondays 7 AM PT

💛 Fun Fun Forum

💛 mpj on Twitter

💛 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:

💛 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:

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

Tutorials try to solve a problem. Failing Together makes you grow as a developer and coworker.

📹 Each show is recorded live on Twitch in a 2-hour livestream on Mondays. The host, assisted by the audience, is tasked to complete a programming challenge by an expert guest. Like in the real world, we often fail, and learn from it. This, of course, reflects what the audience identifies with, and is one of the most praised aspects of the show.

⏯ On Fridays, an edited version of the show is adapted for and published on YouTube.

Content Topics revolve around: JavaScript, Functional Programming, Software Architecture, Quality Processes, Developer Career and Health, Software Development, Project Management
Рекомендации по теме
Комментарии
Автор

If you paired up with the guy who wrote 'You dont Know Javascript', the concepts would be so well explained they could air it on Sesame Street.

nosajghoul
Автор

Thanks for 2 reasons:
1) For learning English
2) For teaching in a simple way !

tilakmadichettitheappdeveloper
Автор

I am a Sr dev and have been coding for about 13yrs. I discovered your channel while looking up good js videos for refresher's and interns. I have to say, out of everything out there, this is one of the few channels that really does a good dive into the language. Keep up the awesome work :)

Bjstacos
Автор

The speed of the factory vs class instantiation isn't really an issue, it's the memory footprint that you should be mindful of. The issue is that an object factory returns completely separate objects that repeat all of the same code, rather than all referencing the class blueprint. This eats more memory.

vbikcl
Автор

Great videos! I discovered this channel last night and watched all of them!

Adam.Garrett-Harris
Автор

Thanks for this channel ! Very clear speech, informative content, shitty humour...
Actually english not being your native language makes your videos clearer and a lot easier to understand for non-native english speakers and especially for dumb french people like me :)
Please keep doing such a good job !

lifeacoeur
Автор

"my gentle soul. It looks like chit"!! lololol. Love it.
I like your style. You teach well, and effectively convey poignant points easily. Good job.

venicebeachsurfer
Автор

I like how you got out of a bar and decided "hey I'm going to make a programming video!" haha. Nice wrist band. And nice vid too.

softengi
Автор

You just earned my subscription because you give attention to some of this little concepts in programming which is very important to any Software Engineer Junior or Senior...

zackoncode
Автор

Very clear, concise, accurate and informative.

ianjamiesonmusic
Автор

You can freeze the "this" in your Class via the BabelJS "es7.classProperties".
ie: talk = ()=>{ console.log(this.sound) };
And thank you for your work ! Keep it going it's great !

BrettCoffin
Автор

Thank you so much for this video. Got asked to create some factory functions solve something at work and I was a bit lost until I found this video.

velocity
Автор

"It hurts my gentle and beautiful soul to look at this code - it looks like... the shit!" - awesome! :))))

wishmaker
Автор

It's good to note that you can also have factory that use shared prototypes with es5 "Object.create(proto)" so you avoid re-creating part of common code, but that won't free you from "this" so it's not prefect...

Also making part of your object in a common separated object can be done for performance, where you can pass your object to the common methods instead of having them nicely on your object directly.
A bit less expressive, but avoid the trap of this.

Not sure I made perfect sense here, hard to do without propers exemples but, even in the case of performance benefices, you can avoid classes.

GodOfMacro
Автор

Again a superb video. You have made factory functions so simple. Thank you

HariShekhar
Автор

it's awsome! I was watching all the functional programming videos, and i love them! I only implemented functional prog in Haskell before see your videos, and now i will consider to use javascript in the future!

ericromanenghi
Автор

whatching your vids not to learn js, but to cheer yourself up

nchecker
Автор

Wow how have I never stumbled across your videos before? Good stuff, informative, educating and funny :-)

jakobud
Автор

This is an incredible description! Thank you!

wishmaker
Автор

Still relevant, and still the best resource for breaking down JS concepts imo

scottldn
visit shbcf.ru