Тёмный
No video :(

Frontend Devs Still Need Algorithms & Data Structures 

Tom Is Loading
Подписаться 22 тыс.
Просмотров 2,8 тыс.
50% 1

Опубликовано:

 

5 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 27   
@IamFrancoisDillinger
@IamFrancoisDillinger 7 месяцев назад
I think algorithms specifically for frontend would be an interesting series of videos to make.
@tomisloading
@tomisloading 7 месяцев назад
If this does well I’ll certainly think about that 👀
@holypizza1
@holypizza1 6 месяцев назад
Excellent video on using binary search for text fitting! It really highlights the power of algorithms in front-end development. However, I was curious about your decision to use binary search instead of the clamp() function in CSS. Considering clamp() can define minimum and maximum values along with a dynamic "ideal" value using viewport units, wouldn't this be a more performant and less code-intensive approach?
@nlp3834
@nlp3834 7 месяцев назад
This is very interesting. When working on larger projects, optimization is important and one such ways is to implement efficient algorithms. Will you turn this into a series?
@tomisloading
@tomisloading 7 месяцев назад
I will absolutely consider it!! Already have a couple of other ideas 😀
@Yeyppe
@Yeyppe 7 месяцев назад
tom im being honest, this was very interesting. hope for more videos like this on algorithms regarding frontend.
@tomisloading
@tomisloading 7 месяцев назад
Awesome, you're the 4th person to comment this, super surprising for me!! Will start putting together some more ideas :)
@v.demchenko
@v.demchenko 7 месяцев назад
Ok, this is great example. But i would rather use css for that kind of stuff. Since JS work in 1 thread, you can accidentally block it and text will not resize anymore.
@tomisloading
@tomisloading 7 месяцев назад
Totally fair! In most cases I’d do the same thing, using this more as an exercise of “what IF you had to do it within these constraints” :)
@user-vd3ph6zh8q
@user-vd3ph6zh8q 6 месяцев назад
Wouldn’t clamp do the same thing?
@kiaralee3818
@kiaralee3818 7 месяцев назад
Can we get more videos like this?
@tomisloading
@tomisloading 7 месяцев назад
Third person to ask, so the ABSOLUTELY! :)
@txofii9218
@txofii9218 6 месяцев назад
Only 77k subscribers?! This content is gold, love it!
@OmarElmasry1
@OmarElmasry1 7 месяцев назад
this is a true high quality content, would love to see more.
@godofwar8262
@godofwar8262 7 месяцев назад
How you create your website can your provide the tech stack or can you create a video on how to render this component on live preview and having code snippet parallel to it using frontend only framework like react js
@tomisloading
@tomisloading 7 месяцев назад
Haha I’ve had making a video similar to this on my todo list for a while so I’ll definitely get to it eventually!
@godofwar8262
@godofwar8262 7 месяцев назад
@@tomisloading thank 👍
@muddycalendar3292
@muddycalendar3292 7 месяцев назад
There’s no doubt binary search scales better, but how much faster is it? What if you replaced it with an O(n) algorithm, would it cause noticeable slowdown?
@tomisloading
@tomisloading 7 месяцев назад
Well I haven't tested much, but I'd bet with a large enough viewport & small enough string! If we're talking a couple hundred loops vs 10-12 loops though, most probably won't see much of a difference. Would be fun to test where that limit is!
@tomisloading
@tomisloading 7 месяцев назад
Okay I got curious and timed it haha. At 1440px container width & a goal font size of 117px, linear option was averaging ~7-10ms on my machine, log (technically O(1)) was 0-1ms. With a goal font size of 352px, linear was taking ~18ms. Log remains the same. 18ms still pretty dang fast all thing considered, but you can see how this scales poorly as we get to larger viewports etc
@jacobasper
@jacobasper 7 месяцев назад
​ @tomisloading I love that you benchmarked it! I'm definitely in favor of knowing some DSA generally, but I wouldn't say this use case specifically convinces me that you *need* it. I think use cases like caching, sets, and maps are more convincing, but to be fair most map and set usage doesn't get me much beyond ergonomics when I have benchmarked. Most of the slowdown I've dealt with on the front end has been back ends I can't control giving a lot of data. Then the data isn't cached or sorting happens before a filter. Another niche case was showing most recently used items on the client (we used a Binary search tree there) I think those could be a good continuation if you decide to make more of these videos :) Post Script: Probably getting a bit in the weeds here, but I can think of lots of cases where libraries need to use DSA. One example coming to mind is angular using Bloom Filters to efficiently search the component tree github.com/angular/angular/blob/c213a4e15a594ff141cf312ad301128e7ed4127c/packages/core/src/render3/di.ts#L103-L140
@jacobasper
@jacobasper 7 месяцев назад
​@tomisloading I love that you benchmarked it! I'm definitely in favor of knowing some DSA generally, but I wouldn't say this use case specifically convinces me that you *need* it. I think use cases like caching, sets, and maps are more convincing, but to be fair most map and set usage doesn't get me much beyond ergonomics when I have benchmarked. Most of the slowdown I've dealt with on the front end has been back ends I can't control giving a lot of data. Then the data isn't cached or sorting happens before a filter. Another niche case was showing most recently used items on the client (we used a Binary search tree there) I think those could be a good continuation if you decide to make more of these videos :) Post Script: Probably getting a bit in the weeds here, but I can think of lots of cases where libraries need to use DSA. One example coming to mind is angular using Bloom Filters to efficiently search the component tree github.com/angular/angular/blob/c213a4e15a594ff141cf312ad301128e7ed4127c/packages/core/src/render3/di.ts#L103-L140
@SanthoshKumar-dev
@SanthoshKumar-dev 7 месяцев назад
You have motivated me to start my own tech channel on my native language ❤
@tomisloading
@tomisloading 7 месяцев назад
THATS AWESOME!! I'm sure you'll do great!! Others could give you much deeper advice, but if I've learned anything so far, it's all just persistence 😀
@itsdrvgo
@itsdrvgo 7 месяцев назад
Bluwulubu... XD
@tomisloading
@tomisloading 7 месяцев назад
I appreciate your support on my stupid intros 😂
@freddiewalters4001
@freddiewalters4001 7 месяцев назад
🤦 "Promo SM"
Далее
Why Signals Are Better Than React Hooks
16:30
Просмотров 473 тыс.
Паук
01:01
Просмотров 2,8 млн
The Most Legendary Programmers Of All Time
11:49
Просмотров 556 тыс.
How To Build Web Apps using V0 + Claude AI + Cursor AI
13:32
The Most Overlooked Framer Motion Hook is DOPE
9:55
Просмотров 3,9 тыс.
When RESTful architecture isn't enough...
21:02
Просмотров 275 тыс.
LEETCODE IS MID AT BEST
2:07
Просмотров 94 тыс.
Beautiful Animated Nav Bar with React & Framer Motion
11:39