Deciding between a computed property and a function in Swift

  Рет қаралды 576

donny wals

donny wals

2 ай бұрын

In this video we explore Swift's computed properties and I talk about the different things I consider when deciding which type of property I should use.
This video is a companion video for: www.donnywals.com/deciding-be...
Level up your Swift Concurrency skills with my course: donnyplus.com/p/practical-swi...

Пікірлер: 8
@srzurka
@srzurka 2 ай бұрын
Thanks for the video. I concur. I would only add that, computed properties feel Swifty to me so I start with a bias towards using them, then change to a function when there's one of the situations that you've identified. (needs arguments, it's not lightweight, potential side-effects, etc)
@nigelgee3576
@nigelgee3576 2 ай бұрын
I know that you are using person name as an example code. But it should said that when dealing with with names that should use PersonNameComponentsFormatter as this will put the correct format for user locale
@user-qg8nc5bk4p
@user-qg8nc5bk4p 2 ай бұрын
Sound became better :) Could you please share your thoughts on usage of extensions, e.g. extending models with some methods, formatting methods etc. When an object that does something is better than extension of some model that handles the model certain way and returns the data I need, the only think that comes to my mind is inability to use DI in extension, so testability is limited for these functionality
@DonnyWalsdev
@DonnyWalsdev 2 ай бұрын
I've added it to my (long) list of potential topics!
@tiagoalexbastos
@tiagoalexbastos 2 ай бұрын
your videos are so good man, top tier content! Keep it up :)
@DonnyWalsdev
@DonnyWalsdev 2 ай бұрын
Thanks!!!
@alexandr8328
@alexandr8328 2 ай бұрын
Hello! When is your Swift Concurrency course released? It says it is still in progress. Thx
@DonnyWalsdev
@DonnyWalsdev 2 ай бұрын
Hey! The course should be finished in the next week or two. Plan was to have it fully done this week but I'm currently at a conference so that seems a little too ambitious. Almost all sections are finished except for the final one on TaskGroup and async let.
Using Closures as Dependencies
15:18
donny wals
Рет қаралды 1,1 М.
Why Everyone Is OBSESSED With Arc Browser
10:26
Enrico Tartarotti
Рет қаралды 259 М.
Why Is He Unhappy…?
00:26
Alan Chikin Chow
Рет қаралды 26 МЛН
НЫСАНА КОНЦЕРТ 2024
2:26:34
Нысана театры
Рет қаралды 1 МЛН
The moment we stopped understanding AI [AlexNet]
17:38
Welch Labs
Рет қаралды 808 М.
Rust Data Modelling Without Classes
11:25
No Boilerplate
Рет қаралды 167 М.
Actor Reentrancy in Swift explained
20:18
donny wals
Рет қаралды 1,4 М.
Linus Torvalds: Speaks on Hype and the Future of AI
9:02
SavvyNik
Рет қаралды 94 М.
25 Nooby Pandas Coding Mistakes You Should NEVER make.
11:30
Rob Mulla
Рет қаралды 264 М.
Coding a Web Server in 25 Lines - Computerphile
17:49
Computerphile
Рет қаралды 330 М.
Nature's Incredible ROTATING MOTOR (It’s Electric!) - Smarter Every Day 300
29:37
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Sahil & Sarra
Рет қаралды 629 М.
@preconcurrency usage in swift explained
7:52
donny wals
Рет қаралды 488
Groundbreaking New Solar Energy System - Too Good to be True?
7:07
Sabine Hossenfelder
Рет қаралды 403 М.
ГЕНИАЛЬНОЕ РЕШЕНИЕ (@fusterdeltiktok - TikTok)
0:18
В ТРЕНДЕ
Рет қаралды 3,7 МЛН
😳 Это ПРЕВРАЩАЕТ всё в ПИЦЦУ !
0:28
Настя, это где?
Рет қаралды 1,7 МЛН
#kikakim
0:31
Kika Kim
Рет қаралды 10 МЛН
RINTANGAN AIR #waterpark #summer #waterslide #fun #gadgets
0:19
ABANG FAAREZ
Рет қаралды 56 МЛН