- Видео 11
- Просмотров 15 073
Jan Hesters
Германия
Добавлен 20 июн 2024
Subscribe to master React, Next.js, Remix and engineering management.
I was the 7th employee at Hopin and built out the frontend, which scaled to millions of users as the company grew from a $6 million to a $7.7 billion valuation. Then I co-founded ReactSquad, a marketplace of vetted senior React developers for SaaS companies.
If you’re expanding your team and need to hire React developers book your free discovery call today! 👉 www.reactsquad.io/schedule-a-call
I was the 7th employee at Hopin and built out the frontend, which scaled to millions of users as the company grew from a $6 million to a $7.7 billion valuation. Then I co-founded ReactSquad, a marketplace of vetted senior React developers for SaaS companies.
If you’re expanding your team and need to hire React developers book your free discovery call today! 👉 www.reactsquad.io/schedule-a-call
How To Set Up Next.js 15 For Production In 2024
Want to hire a senior React developer? Visit reactsquad.io/jan now!
If you’re expanding your team and need to hire React developers book your free discovery call today! 👉 www.reactsquad.io/schedule-a-call
--------------------------------------------------------------
Learn how you can set up a scalable Next.js app (with React). This video covers everything from initial configuration with TypeScript, Tailwind CSS, and ESLint to advanced topics like internationalization (i18n), database integration using Prisma, and end-to-end testing with Playwright.
This tutorial shows you how to set up Next.js 15 for production and is the perfect guide to learn a Next.js production setup when you want to set...
If you’re expanding your team and need to hire React developers book your free discovery call today! 👉 www.reactsquad.io/schedule-a-call
--------------------------------------------------------------
Learn how you can set up a scalable Next.js app (with React). This video covers everything from initial configuration with TypeScript, Tailwind CSS, and ESLint to advanced topics like internationalization (i18n), database integration using Prisma, and end-to-end testing with Playwright.
This tutorial shows you how to set up Next.js 15 for production and is the perfect guide to learn a Next.js production setup when you want to set...
Просмотров: 1 017
Видео
What Is Memoization? (In JavaScript And TypeScript)
Просмотров 30121 день назад
Want to hire a senior React developer? Visit reactsquad.io/jan now! If you’re expanding your team and need to hire React developers book your free discovery call today! 👉 www.reactsquad.io/schedule-a-call What is memoization in JavaScript? How does memoization work? Get answers to these questions and more in this memoization and caching video tutorial. Learn how to use memoization to speed up y...
Unleash JavaScript's Potential With Functional Programming
Просмотров 3,4 тыс.Месяц назад
Want to hire a senior React developer? Visit reactsquad.io/jan now! If you’re expanding your team and need to hire React developers book your free discovery call today! 👉 www.reactsquad.io/schedule-a-call What is functional programming? Using this tutorial, you can learn functional programming with JavaScript. Explore the functional programming paradigm in JavaScript. This "step-by-step with no...
Higher-Order Components Are Misunderstood In React
Просмотров 1,7 тыс.Месяц назад
Want to hire a senior React developer? Visit www.reactsquad.io/jan now! If you’re expanding your team and need to hire React developers book your free discovery call today! 👉 www.reactsquad.io/schedule-a-call What are higher-order components in React? How do you use higher-order components? In this tutorial, you're going to learn the definition of React higher-order components. This guide shows...
12 Keys to Write Senior-Level Tests (Test Desiderata in JavaScript)
Просмотров 360Месяц назад
Want to hire a senior React developer? Visit www.reactsquad.io/jan now! If you’re expanding your team and need to hire React developers book your free discovery call today! 👉 www.reactsquad.io/schedule-a-call In this video, you'll learn 12 testing best practices that every senior developer should know. You will see real-world JavaScript examples for Kent Beck’s article "[Test Desiderata](medium...
JavaScript Generators Explained, But On A Senior-Level
Просмотров 1,5 тыс.2 месяца назад
Want to hire a senior React developer? Visit www.reactsquad.io/jan now! If you’re expanding your team and need to hire React developers book your free discovery call today! 👉 www.reactsquad.io/schedule-a-call What is a JavaScript generator function? In this video, you'll dive deep into how JavaScript generators work, exploring concepts like push and pull streams, lazy and eager data processing,...
Build A React Native App With Multiple Screens Masterclass
Просмотров 1,4 тыс.3 месяца назад
Want to hire a senior React developer? Visit www.reactsquad.io/jan now! If you’re expanding your team and need to hire React developers book your free discovery call today! 👉 www.reactsquad.io/schedule-a-call How to build an Expo React Native app with complex navigation and multiple screens? In this tutorial you'll learn how to create a React Native app with nested navigators. You'll also see h...
useCallback vs. useMemo
Просмотров 3,9 тыс.3 месяца назад
Want to hire a senior React developer? www.reactsquad.io/jan now! If you’re expanding your team and need to hire React developers book your free discovery call today! 👉 www.reactsquad.io/schedule-a-call What is the difference between useCallBack and useMemo? When should you use useMemo and useCallback? In this video tutorial you’ll learn how to use these two React hooks and see some real-world ...
I liked this video, it have explained many javacript concepts, but the code suggested at 30:56 is not working correctly, inspite of addition via add3, its returning NaN, because pipe(...fns) .... is not able to pass all params to add3(), add3 is able to receive on first param only, @Jan Hesters, pls check,
Amazing video ❤
Thank you!
Question, are the terrible shirts a requirement too?
Right into the feels! 💔😄 Wear whatever you want 😉
In my 25 years of web development, I’ve never attended a class as good as this one. Amazing video with presentation awesomeness on another level. Hats off to you! 🙏 Keep rocking! I also like the horses in the background 😂
What a crazy complement! Thank you very much! 🙏
You gotta love YT algorithm. Spent 3 days setting up a monorepo using turborepo, hell of a pain... Could you create a similar video on setting up for production for a monorepo?
Absolutely! But it will take a few months, I have a bunch of other topics planned first. Thank you for the compliment and the suggestion! 🙏
Well done. Very good video. And thank you for posting the code in GitHub.
This is a rare channel, and I love the atmosphere your in.
Appreciate it! I like shooting outside because we are inside enough as developers haha
very very thanks
You're welcome! 🙏
Functional Programming oof, thanks surely, am subscribing!
Thank you! 🙏
dope style & crazy gold nuggets bro !
I have the privilege of working with the best when it comes to style 😉 Thanks!
wow ..Best explanation ..
Thanks so much!
Just one question: where you in the movie Split by M. Night Shyamalan?
A few of me were, yes 😉
In your curry function you copy memory four times just for the sake of immutability, which is already guaranteed by just doing 1 + 1. You'll have awful performance and you're using it for a simple addition? At least use a good example. I also really do not agree that this code is any more or less testable than OOP code. The problem is always state and keeping it correct at all times. That is usually not due to any one function being incorrect, it is due to developers making simple logic mistakes. Most bugs I've found in production are impossible to find with unit testing, because that's not where the bug is. Most of all, I just think JavaScript is a candidate for FP due to performance reasons. You don't really have to do much in order to get JavaScript to absolutely chug and lock down the browser, and on the server there's just so many more performant options. Even Java is more performant, then there's Kotlin even in the JVM world which tends to be more performant. C#, C++, Rust, Go, all of them are more performant. That's for the languages not even specifically for FP.
Absolutely agree. I said at the end of the video that the examples in this video are contrived and optimized to be understandable. I disagree that OOP coder is easier to test because by default class inheritance is the tightest form of coupling and frequently requires mocking. But if you have good examples for OOP code that is easier to test than pure functions, please kindly point me to it 🙏 And regarding performance, IMO you should favour readability over performance UNTIL performance becomes a bottleneck. I can't speak to those other languages you mentioned because I'm specialized in JavaScript.
@@JanHesters Easily testable OOP code honestly follows the same guidelines. Given the same input, you should get the same output. The thing that tends to get people thrown off is that with OOP and stateful classes, you'll have adjusted one of the inputs if you run the same method twice. In order to replicate the same thing you also need to replicate the class instance. Just with a really basic class (pure garbage I'd never write normally, so sorry about it being a bad example): class Addition { value; constructor(initial) { this.value = initial; } execute(value) { this.value += value; return this; } } assert(new Addition(2).execute(2).value, 4) would be 4, every single time you run it; same as FP. If you chain it like new Addition(2).execute(2).execute(2).value then you've fundamentally changed what it does, just like FP. Same principle, different execution. The class example is extremely stupid though, wouldn't write code like that normally, state is best stored in DB regardless. One of the benefits to using classes in JavaScript is that while it looks as if the objects all have their own methods, they are all only allocated once, which is a major benefit to anonymous functions added to objects which need to be allocated every time. This is not as important now with imports and exports being a thing, but look into how stupidly much memory is used in a regular application due to all of the object nonsense JavaScript injects since it needs to treat everything like a nondescript object. That's not the case in Java or C# for example, where they only keep the bare minimum to identify the class. As for why I think a lot about performance, it's because I work with larger datasets frequently, so I have to walk the tightropes of readability and performance a lot. This is true for both backend and frontend things; where updating/inserting 50k DOM elements is hell and takes ages even in a best case scenario, whereas remaking the entire HTML structure as a string and replacing all of it takes a few seconds. However, it only takes a few seconds under the assumption that I reuse memory through not allocating anything extra. This means reusing variables and pre-allocating memory as much as possible. I do enjoy FP though, I reach for it whenever possible, but only when I can afford doing so. I never do anything particularly crazy with it either, but the idea of passing functions to other functions is something I use regardless of FP or OOP. Command pattern is just that. The Addition class I gave as an example would be one of the classes one would pass to something that processes it. Somewhat unreadable, but with enough complexity in the business logic, it's totally worth it. Sorry about the long reply, not sure if you're going to read it either, but I hope my sleep-deprived brain didn't spew out too much nonsense.
@@CottidaeSEA Thanks for the long reply! I for sure read it 🙏 Got it. As you said, the code you gave as an example is different from how you'd write it, but let me still address it because it demonstrates one of the problems I had with testing (and reading / understanding classes) as opposed to FP - even in production codebases with "real" code examples: You need to set up the internal state to run the different functions, and it's hard to understand a method in isolation. For example, if you had another method on that class, that would only do something if `value` was three, you'd need to either call `execute` three times, complicating the test. Or you'd need to manipulate the class directly, which then would obfuscate the test so it resembles the real usage less. With FP and pure functions, they usually map one input to an output, making it trivial to write tests for them and truly test them in isolation. And thank you for clarifying where you come from. Totally makes sense that you think about performance so much! 👍 I've been a fullstack dev for most of my career and over time I learned the best approach to browser performance is "fix it if it breaks, otherwise favor good DX (testability, readibility etc.)". (Most) Browsers are so fast nowadays that it doesn't matter if you take up extra memory. > I reach for it whenever possible, but only when I can afford doing so This pretty much sums it up! 😊 And in my experience, in most JS server and browser codebases, you don't need to optimize for performance so granularly. (Especially on the backend, if performance mattered, the teams switched to Rust or another fast language haha) Thanks again for your thoughtful reply!
0:13 Nope! Using the splat operator = automatic fail. Simply put, you don't understand how expensive that operator is and that it should only ever be used very sparingly. Go write a DSL from scratch in a real programming language and implement the splat operator as part of it to learn how wrong your first 15 seconds of this video is. Splat may be convenient but trash like that it is why my web browser is chugging 10GB RAM half of the time. The rest of your example is what I call "symbol soup." It's unreadable because it uses symbols instead of words. Good coding practices balance words and symbols in a pleasing, easy to read/understand experience.
The examples in this video are NOT meant to be production code, but just to teach the concepts of FP. (I mention it at the end of the video.) But your comment is good advice, I hope more people read it!
I remember struggling with memoization 2 years ago doing related task on my first job. I wish I had this video back then. S-tier content. You deserve more subsribers bro
Thank you for the kind words! 🙏 That's exactly the target audience. So far, this video received less views than my other ones, but I hope people who really need to find it, find it through SEO :)
functional programming is the kind of programming i do at 3am after being awake for 20+ hours. jokes aside, FP is great but just like OOP, going too heavy and far into FP and you just end up in a different web of frankly painful complexity. I get the piping and composing and currying but man I can absolutely see how someone would be utterly lost looking at that, and its not fun to try and understand. FP and OOP compliment each other well, and I've personally found myself writing my "best" or at least "better" code by using FP and OOP together, but never going to far into one or the other. Def a good vid though very succinct, I would prob reco up to about 25:44 for most people
Thank you for the kind words! And I agree, always choose the right tool for the job and take into account what your team knows! 👍
Insane thumbnail
Thank you!🙏
Exposing all the "magic" under the hood. This was very helpful in understanding memoization. Great video!
Thank you and you're welcome! What topic would you like to see covered next?
You wish you looked like that thumbnail 😂
Do not assume that JS GC is always fast and that the new array/object is minor time spent. When it comes to million+ those things matter in terms of speed. I am not saying you should avoid functional programming in most cases, just know your rough max cases when dealing with Map, Set, Array stuff, and functional programming.
Absolutely! Basically: Readability > Cleverness > Performance as long as performance doesn't matter. As soon as it does, the order switches.
Wait, I thought this was Aphex Twin music video ;)
Avril 14th - all day!
FP patterns are the best way to write class methods :D
I see what you did there lol
But at what cost? Clear > Clever. (the video was well done, but I walked away more firmly in the camp of "we should never allow this in a shared codebase")
I mostly agree! But I disagree in certain circumstances. If you cannot train the team for whatever reason, then "yes," you should go with the best solution that everyone understands. Or if functional programming would objectively be the worst solution, then also "yes," you shouldn't use these techniques. But, if you have a team with a culture of mentorship and functional programming is the best solution, you should definitely level the team up and implement the cleanest solution.
@@JanHesters Have you ever tried to level up a team? Just getting basic automatic formatting, linting, and PR reviews implemented for the code that's there already is an absolute war of attrition. Well... I guess those are all boring things. There's probably a bigger market for people trying some new cool thing and feeling special about how smart they've become than doing the essential and tedious work of figuring out why core functions of the application are failing, seemingly at random, and any tiny change to something that changes the timing of database calls creates cascading failures... Of course, a big problem in the code base I'm thinking of is that they did use so much fp - but in all the wrong ways - using reducers to filter and create new objects, using maps to iterate over and mutate objects... most people aren't disciplined enough to use any of it correctly. They would be better of just sticking to for loops rather than creating things that no one else (or even they themselves) can read. You know what would be a really useful video? How to reset VSCode to a default working state after years of use. So many people disable all of the linting and other code tools and then things that should "just work" don't - because they've been disabled. If you're working with really next-level, hyper-intelligent people of a similar mindset I imagine that fp could be really fun and not hinder productivity, but we're at a state in technology where it's too much to expect people to get a contact form to work reliably. The hello worlds are failing. We need the simple for loops so that people can read what they wrote themselves. Most people need fewer tools, that they know how to use correctly, not more tools that they don't understand the nuance of. When I was young and all of that was being added to JavaScript, I used to think all those things were so cool and even used some of it correctly. Now... htmx is starting to look better all the time.
What tools do you have for leveling up a team? How do you approach it? How do you get people interested in quality and correctness over coolness and "if it fits it ships"ness?
@@coolaj86 > What tools do you have for levelling up a team? In my opinion, one-to-many and one-on-one mentorship is the most important tool for any dev team. > How do you approach it? Make sure that you have regular mentorship sessions with your team. Lead by example. > How do you get people interested in quality and correctness over coolness and "if it fits it ships"ness? Show them your arguments. If they agree, your arguments are good. If they disagree, that might be because you have a blind-spot. To answer all of these questions, might take its own proper video. I'll put in my backlog. Thanks for the idea! But I hope this somewhat answered your questions. If you have follow up questions, let me know. And if you disagree, I'd also be interested in your view! 🤓
Thank you for your amazing content! I've found it incredibly helpful and was wondering if you could assist me with some topics related to arity.
Sure! If you want, you can drop your question here, or DM me on X: x.com/janhesters
Now I want currywurst
Don't forget the Sauerkraut! 😄
Is this video going to help me to learn React?
Implicitly yes, absolutely! A good understanding of the language helps you understand any JS framework better. And for React specifically, it can help you clean up your code in general. It'll also help you to understand higher-order components, selectors in Redux, and why thinks are rendering (closure).
@@JanHestersThank you.
Thank you Jan
Let's go 🔥
I know that you wanted to show functional programming, but the example at the very beginning of the movie requires a lot of cognitive load so I would not say that we should write code like this. I've seen some projects where functional programming was in use and unfortunately I have to say that some parts of the project were too advanced in terms of the way how function currying was used. Thumbs up anyway.
Thank you for your feedback! I agree and this is one of the last points of the video at the end 👍 Many of the examples are contrived to be as easy as possible. The goal of this video is to learn FP as opposed to real world use cases.
Great presentation! But please everyone, be mindful when you're working in a team. It'll be rare that others in your team have studied and understood fp as much as you did. "Real" senior developers understand the value of easy-to-read, easy-to-maintain code. Junior devs create simple code for everyone on the team. Mid-level devs create opinionated, seemingly "so efficient", "so elegant" code. Senior devs create simple code again. I'll always remember how everyone on a team hated that one guy who added Ramda to the codebase and now they all had to work with it after he left. He was clearly smart and knew what he was doing, but he wasn't mindful of the team or of anyone coming after him. If in doubt, don't be that one guy who adds Ramda.
I totally agree! Code readability and maintainability should always be a top priority. It's a balancing act between writing efficient code and ensuring that everyone on the team can understand and maintain it long-term. 1.) Sometimes, you want to use the best patterns AND teach the people who don't know them those patterns. (Especially in a mentorship-culture.) 2.) In other cases, you want to reach for the best tool that everyone knows. ("When in Rome, do as the Romans do.") My mentor taught me both.
This is the best Javascript Video I've ever seen. (And I've been coding in JS since 8 years). Big kudos!
Thank you for the kind words! 🙏
Thanks for the explanation, left a like!
Thank you so much!
I feel attacked the way he put 'senior' in quotes. Where can I go to get a better understanding, I was kinda lost towards the end. Great video, I learned a lot though
Thank you! What is unclear? Maybe I can help you after the fact! 🙏
@@JanHesters Maybe I just need to write a few examples and fail abit :D Thank you!
@@kaicooper9421 Let's go 🔥
This is sweet
Bro your videos are just top notch. Much love from france ♥
Thank you! Really appreciate it. Did you learn something fun new?
I like your content and your outfit bro continue
Thank you! 🙏 Trying out things differently.
good post. would be nice to see more positive examples rather than things not to do, or better yet, how to change your design/test thinking to fulfil the desideratum. appreciate that it's a lot of content to cover tho, nicely done
Will create many future videos with testing best practices. Stay tuned!
Nice energy and setup! 🔥
Thanks!
The number of times he said "Higher Order Component" is: 81 Which makes ~4,6 "Higher Order Component" / minute
Reminds of Daft Punk saying "Around The World" 144 times lol
Is this the same thing as 'currying'. you might want to start a course or something to btw
A detailed video on functional programming including currying is coming soon 👍
ngl, i was waiting for a music video and a magic trick
one could argue that hocs are kind of magic haha
😂😂😂
@@Leon_Andersen True!
Dropping soon 🔜
so good to have the test desiderate "translated" to JavaScript!
Thank you! 🙏
came here from your blog I don't understand why it printed "y: 2012", should it be "y: 2014" (the value in parameter was 2012 + 2) or "y: 42" (as this was the result of y from previous call)
Let me explain to you the output of the given code step by step: 1. Initialization of the generator: When `moreNumbers(40)` is called, the generator function is initialized with `x = 40`, but no code runs yet. 2. First `next()` call: This starts the execution of the generator until the first `yield`. It prints `'x', 40` and then yields `40 + 2` (i.e., 42). The output is: { value: 42, done: false } 3. Second `next(2012)` call: This resumes the generator, passing `2012` back to it. This value is assigned to `y`. It then prints `'y', 2012` and yields `40 + 2012` (i.e., 2052). The output is: { value: 2052, done: false } 4. Third `next()` call: This resumes the generator again, but since no value is passed, `z` is `undefined`. It prints `'z', undefined` and as there are no more `yield` statements, the generator finishes. The output is: { value: undefined, done: true } The sequence of console logs from your code would look like this: - `'x', 40` - `{ value: 42, done: false }` - `'y', 2012` - `{ value: 2052, done: false }` - `'z', undefined` - `{ value: undefined, done: true }` The formatting here on YT might be weird, but you can copy paste it in a markdown file. Hope this helps!
@@JanHesters ahh thanks 🤟, so basically when we call next(value) it doesn't re-initialize the value of x, but assign this value to the variable that was assign to the last yield. and doing this const y = yield x + 2; // x = 40 doesn't assign the result (42) to y
Cool video. Not sure what a saga is though.
Hope you found this video helpful! What topic would you like to learn next? Drop it in the comments below and I might make a video about it Also, visit www.reactsquad.io/ now and hire your next senior React developer today!
Generators are super interesting, I am curious about the Saga video!
Thank you! Coming soon 🔥
Very helpful, thanks!
You're welcome!
thanks!!!!
You're welcome!
a react dev here, do you recommend learning react native ? just to be more valuable so any startup will choose me over the one who know only web
Unless you want to apply to a specific company that uses React Native, I would recommend to focus your efforts on getting very good at Vanilla React, Redux and Next.js because those are the most sought after.
@@JanHesters thanks, but i'm good at nextjs, i'm freelencing with it but i want to get a full time job at a company
Great video! Thanks!
Glad you liked it!
Wow, i have been watching react videos three years now, and this is the first time someone explain how things actually work in the right terms and words, I learned a lot of things from this video other than useCallback and useMemo (will watch the video few times just to memorize everything). please please always be like that, we don't need other youtuber who only reads obvious examples.
Thank you very much! Stay tuned for a future video about higher-order components, which breaks them down in detail. And if you have any topic that interests you, kindly let me know 🙏