TRANSCRIÇÃOEnglish

I Built the Same App with 6 Different Frameworks

19m 28s3,568 palavras319 segmentsEnglish

TRANSCRIÇÃO COMPLETA

0:00

The world of mobile app development is complex and expansive.

0:03

If you're starting a new project, you likely feel overwhelmed by all the options.

0:07

So you decide to do some research to figure out what's the best tool for you.

0:11

According to Google's AI overview,

0:13

Flutter is best for "high-performance" apps,

0:16

whereas React Native is best for "near-native performance".

0:20

Kotlin Multiplatform and SwiftUI,

0:22

despite actually being native frameworks,

0:25

include no mention of performance at all.

0:27

And if you want to know which framework is the best,

0:30

it's all of them.

0:31

If you're skeptical about these claims,

0:33

you can do some deep research using real human opinions from real human developers on Reddit.

0:39

"Is Flutter slowly dying?"

0:42

"Is React Native really that bad?"

0:44

"Jetpack Compose is a great idea, but poor implementation."

0:48

"Why is NativeScript so dead?"

0:51

"Is SwiftUI really the future?"

0:53

Hell, I've even contributed to the pool of collective knowledge.

0:56

If you watched my video about React Native,

0:59

you may have noticed that I was very careful not to endorse any particular mobile app framework.

1:04

That's because I legitimately don't know which one is the best.

1:07

But today I'm going to fix that.

1:08

In this video, I'm going to build the same app with six different frameworks

1:12

and give my opinion on which framework you should be using for your projects.

1:17

The app I'm going to be building is a simplified version of the Reddit app.

1:21

It'll only display the top posts for each subreddit in the past 24 hours.

1:25

This way, I won't be tempted to waste time scrolling endlessly looking for more news.

1:30

If you didn't know,

1:31

you can add ".json" to the end of a Reddit URL to get the posts in JSON form.

1:37

I assume there's some rate limit when doing this,

1:39

but since I'm fetching about 50 posts total,

1:41

I'm going to fall well below the rate limiting threshold.

1:44

I kept it extremely simple because I am going to build this six separate times.

1:49

I'm going to evaluate each framework based on installation complexity,

1:53

debugging experience,

1:54

state management,

1:56

and any roadblocks that come up during the development process.

1:59

So let's get started.

2:01

SwiftUI was created in 2019 by Apple to replace their existing UIKit framework.

2:07

So you could say SwiftUI is the "new native" framework for iPhones.

2:11

It took me about 1 hour and 50 minutes to build my app,

2:15

which isn't very fast,

2:16

but keep in mind that this is the first framework I used.

2:19

The binary size is 1.8 MB,

2:21

and the startup time is 0.683 seconds.

2:25

I would take these startup time measurements with a grain of salt

2:28

since I'm only using a sample size of one app launch.

2:31

Here are the good parts about SwiftUI.

2:33

SwiftUI is native code for iPhone,

2:36

so that avoids all of the problems that come with foreign function interfaces and interfacing between something like

2:42

Dart or JavaScript and the actual native code.

2:45

The SwiftUI preview system is pretty sophisticated.

2:48

So you can see here this `#Preview` macro

2:50

that allows you to specify what you want shown in the preview on the side.

2:54

For demo purposes I'm showing the preview in the iPhone simulator,

2:57

but you can also have it work live on your actual phone.

3:00

And this preview isn't just a static preview.

3:02

You can click on things and actually have them send requests and store state and that sort of thing.

3:08

So if you want to teleport to some state in your app,

3:11

you can set up your preview in such a way that you don't have to click through your user interface

3:15

to get to the state that you want to test.

3:18

Another cool thing are these "Canvas Device Settings",

3:20

where you can set the color theme to light or dark,

3:24

or change from portrait to landscape mode,

3:26

or make the text bigger or smaller,

3:28

which is very important for accessibility

3:32

because a lot of people with vision problems will make the text bigger on the operating system level.

3:36

The way SwiftUI does state management is awesome

3:39

because you don't need any third-party package to actually make it work.

3:43

And it's basically using a lot of compiler magic

3:44

to give you all of the safety guarantees and to make everything clean and simple.

3:48

It's kind of hard to explain if you haven't seen how it's done worse,

3:52

but we're going to see that later.

3:54

So you put this `@Observable` property wrapper on your class,

3:57

and this essentially marks all the fields on that class as being state.

4:00

And SwiftUI tracks which state on your observable that you actually use,

4:05

so it'll only re-render the view when that specific field that you're using changes.

4:10

So it's kind of idiot-proof, like you can't really mess it up.

4:12

I'm sure someone in the comments will tell me how they messed it up,

4:15

but it's easily the simplest state management I've seen in a front-end framework.

4:18

A really cool thing about Swift as a programming language is the way it does exception handling.

4:23

So you can see here that I have this compiler error saying:

4:26

"Call can throw, but it is not marked with 'try' and the error is not handled".

4:30

So the compiler tells you which lines of code can actually throw exceptions.

4:34

So in my code, I catch the exception and set the error message.

4:37

But let's say you didn't want to do that.

4:39

Maybe there's nothing you can do with the exception.

4:41

So instead, you can put `try?`, which is kind of like "try or null",

4:45

and then you can see here we get another compiler error.

4:47

That's because now `redditResponse` is an optional type, right? It's a nullable type, it could be null.

4:52

So this makes way more sense than if you look at something like TypeScript or Dart or C# or

4:57

most other programming languages.

4:59

Here are the bad parts about using SwiftUI.

5:01

There's no way of taking your SwiftUI app and making it run on Android devices.

5:06

So you're going to need to use a different framework for Android.

5:09

You're also not going to be using Swift for your backend if you have a backend for your app.

5:14

The Xcode AI integration doesn't have access to your file system.

5:18

So if you want something like Claude Code to search through all of your files or run command line tools,

5:23

and Xcode comes with certain command line tools that you can use to build and deploy your app.

5:28

So you don't have access to those within Xcode itself.

5:31

And I would say in general, there's a lot of things about Xcode that are not the best.

5:36

Like a really obvious one is in the AI integration.

5:39

I can highlight the code in the response, but I can't highlight the code in the prompt.

5:44

And so if I want to go back and re-prompt it with a slightly different prompt,

5:48

I have to type everything out again, which is really stupid.

5:51

And there's things like that all over Xcode.

5:53

It's not the best editor experience.

5:55

And the only reason I'm not bashing it more is the fact that we do have AI integration,

5:59

so you have the option of mostly talking into a text box rather than actually having to deal with Xcode.

6:05

But overall, my feeling on SwiftUI, I give it a thumbs up.

6:09

Jetpack Compose was created in 2021 by Google to replace their existing "native code" for Android.

6:16

JetBrains, the company that develops Android Studio,

6:19

decided to release their own version of Jetpack Compose, called Compose Multiplatform,

6:24

that can also build apps for iPhone.

6:26

For my app, I'm going to use Compose Multiplatform

6:29

to see whether it's viable for building iPhone apps.

6:32

It took me 2 hours to build my app,

6:34

which was a little bit longer than it took me to build with SwiftUI.

6:38

The binary size is 36.9 MB,

6:41

and the startup time is 0.483 seconds.

6:45

Here are the good things about Compose Multiplatform.

6:48

Jetpack Compose is native code for Android,

6:51

which has the same benefits that SwiftUI has for iPhone.

6:54

However, Compose Multiplatform isn't native to iOS,

6:58

so I'm not actually getting those benefits here.

7:00

Compose Multiplatform has previews similar to SwiftUI.

7:04

The features are somewhat different, but I would say that overall they're still very useful.

7:09

The state management is built into the framework itself,

7:12

so there's no need for a third-party solution.

7:14

I wouldn't say it's super intuitive, though.

7:16

Like this `remember` of a `derivedStateOf`

7:19

that listens to a `mutableStateListOf`

7:22

which triggers a recomposition

7:24

when one of its `data class` entries

7:26

is replaced with a `.copy` of itself.

7:28

Despite how much of a mouthful that is to say out loud,

7:31

I do think it's a sensible way of doing state management.

7:34

I also like that they have data classes built into the language,

7:37

as well as this object keyword for creating singletons without defining entire classes.

7:42

Here are the bad things about Compose Multiplatform.

7:45

There are six non-Git-ignored build-related files

7:49

at the top level of my project,

7:51

but my actual code is seven levels deep into the folder structure.

7:55

And I know this is petty,

7:56

but the naming of this thing is awful.

7:59

Kotlin is made by JETBrains,

8:02

whereas JETpack Compose is made by Google.

8:06

Kotlin Multiplatform is not a UI framework.

8:09

It's literally running Kotlin code on multiple platforms.

8:13

And Compose Multiplatform is a generalization

8:17

of Jetpack Compose that runs on iOS.

8:20

Remember that Google AI overview I showed you at the beginning of the video?

8:23

These terms are so conflated that even the AI gets them wrong.

8:27

Finally, since Compose Multiplatform is relatively new,

8:31

the ecosystem for packages is relatively small.

8:34

You'll probably need to implement some Swift or Objective-C on your own to get things done.

8:39

Overall, I think Compose Multiplatform is a good choice for building Android apps,

8:44

but it definitely wouldn't be my first choice for building an iPhone app.

8:47

I guess if you already know and use Kotlin elsewhere,

8:50

you'll find it pleasant to work with.

8:51

.NET MAUI, or the Multi-platform App UI,

8:55

was created in 2022 by Microsoft as a new coat of paint on top of Xamarin.Forms,

9:01

which in turn was created all the way back in 2014.

9:04

From what I can tell, the original intention of Xamarin.Forms

9:08

was to help developers port their apps to Windows Phone.

9:11

It took me only 1 hour and 20 minutes to build my app, which I found extremely surprising.

9:17

The binary size is 47.6 MB, and the startup time is 0.667 seconds.

9:24

Here are the good parts about .NET MAUI.

9:28

Here are the bad parts about .NET MAUI.

9:30

Upon successfully installing MAUI, VS Code gave me this pop-up telling me that MAUI was not found.

9:37

When I tried to run my app, I got an error that told me I needed to downgrade Xcode,

9:42

even though I'm pretty sure I get locked out of Xcode if I don't upgrade.

9:46

The original file names I used for the subreddit icons were invalid because they contained uppercase letters.

9:53

MAUI uses XML files to specify the UI, then binds the stuff from the XML files into C# code.

10:00

This is horrible because the XML and C# files can get out of sync very easily if you rename variables.

10:07

Now I'm sure there's some Microsoft employee somewhere about to jump out of his seat

10:11

to tell me you can use pure C# without any XML in MAUI.

10:15

To that employee, please update the `dotnet new maui` command that you proudly display on your home page,

10:22

because that's where the XML came from.

10:24

Also please add a `.gitignore` file to your starter project.

10:27

At least state management is straightforward.

10:29

(I'm not typing this out lol)

10:47

Overall, I have no real complaints about .NET MAUI

10:49

because I don't have to use it.

10:51

React Native was created in 2015 by Facebook to make cross-platform app development easier.

10:58

From nearly the very beginning, another company called Expo developed a meta-framework,

11:03

also known as Expo, as a batteries-included way of developing React Native apps.

11:08

It took me only 40 minutes to build my app, which is at least twice as fast as anything I've tried so far.

11:14

The binary size is 32.1 MB, and the startup time is 0.483 seconds.

11:22

Here are the good parts about React Native.

11:24

If you're a web developer, you'll find it relatively easy to get started with React Native.

11:29

TypeScript has a massive ecosystem of packages, many of which are unrelated to mobile development,

11:34

but are nevertheless useful for things like sending network requests,

11:37

interfacing with on-device SQL databases, and more.

11:41

With React Native, the AI is noticeably more accurate when following instructions,

11:46

which saves a ton of time not needing to tell the AI to fix its mistakes.

11:50

Expo provides a way for you to deploy apps to your iPhone without using a MacBook.

11:56

Basically, they created this app called Expo Go that loads your JavaScript into their app.

12:01

It has some limitations related to native code,

DESBLOQUEAR MAIS

Registe-se gratuitamente para aceder a funcionalidades premium

VISUALIZADOR INTERATIVO

Assista ao vídeo com legendas sincronizadas, sobreposição ajustável e controlo total da reprodução.

REGISTE-SE GRATUITAMENTE PARA DESBLOQUEAR

RESUMO DE IA

Obtenha um resumo instantâneo gerado por IA do conteúdo do vídeo, pontos-chave e conclusões.

REGISTE-SE GRATUITAMENTE PARA DESBLOQUEAR

TRADUZIR

Traduza a transcrição para mais de 100 idiomas com um clique. Baixe em qualquer formato.

REGISTE-SE GRATUITAMENTE PARA DESBLOQUEAR

MAPA MENTAL

Visualize a transcrição como um mapa mental interativo. Entenda a estrutura rapidamente.

REGISTE-SE GRATUITAMENTE PARA DESBLOQUEAR

CONVERSAR COM A TRANSCRIÇÃO

Faça perguntas sobre o conteúdo do vídeo. Obtenha respostas com tecnologia de IA diretamente da transcrição.

REGISTE-SE GRATUITAMENTE PARA DESBLOQUEAR

APROVEITE MAIS DE SUAS TRANSCRIÇÕES

Inscreva-se gratuitamente e desbloqueie o visualizador interativo, resumos de IA, traduções, mapas mentais e muito mais. Não é necessário cartão de crédito.

    I Built the Same… - Transcrição Completa | YouTubeTranscript.dev