How NOT to learn mobile development
Tags: mobile, swift, reactnative, kotlin
Published: 2024-06-26 14:27:00

## I built the same app 3 times, here is what I learned

After completing a full stack development curriculum, I felt ready to extend my knowledge and go beyond the web. I jumped into what seems like a chaotic entanglement of technologies, with different sources each suggesting alternate tech stacks. I came across three outstanding tech stacks commonly used for mobile development:

- **React Native, TypeScript, Expo**
- **Kotlin, Android Studio**
- **Swift, Xcode**

As an engineer with no prior knowledge of mobile development, React Native comes with versatility and existing knowledge, making it an attractive choice for building cross-platform mobile applications using a single codebase. Kotlin, on the other hand, was highly recommended for Android development due to its modern features and improved syntax. And of course, Swift, the powerful language for iOS development, offers excellent performance and seamless integration with Apple's ecosystem. And so, I did what anyone would do; I jumped headfirst into all three and hoped to come out with a preference.

Learning React Native, Kotlin, and Swift simultaneously is probably not the ideal way to go. That being said, I challenged myself to build the same simple program three times. This would give me a window into the experience of coding in each, including coding in Kotlin for the first time.

What hit me like a brick was how mobile development is stepping into an entirely different dimension compared to the web. The learning experience is like navigating through a dense forest without a map. Even with curriculums that can be found online, they all represent _a_ path, not _the_ path.

I started out in react with expo go, and was able to create a basic version of the game surprisingly fast. It works as follows: Upon launching, players are greeted with a multiplication question, such as "6 X 5 = ?". Beneath the question, four multiple-choice answers are displayed in a 2x2 grid. Players must select the correct answer to continue. The answers are shuffled each time, ensuring that the correct answer appears in a different position.

If the player selects the correct answer, a new multiplication problem immediately replaces the old one, allowing the game to continue seamlessly. This process repeats, with the difficulty gradually increasing as the player progresses, providing an ongoing test of quick thinking and sharp math skills. Following react and JS principles, I created the basic functionality of the game:


![React-Native Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4gi1vj6zifiecidycjlu.png)

I did some object-based inline styling following React CSS fundamentals, and just like that, the first version of the game was done:

![Complete App](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9s9uj0f544lh6o40i631.png)

Writing Swift in Xcode was very straightforward and rewarding. Even though it was my first time using the Apple IDE, I found the UI to be particularly straightforward and comprehensible. Swift is fairly similar to javascript, and with some hacking away I was able to get my basic build done in about two hours. The main challenge I had was when it came to detailed styling and layout design, particularly as a developer accustomed to the CSS-based styling paradigms of web development. One key frustration was the lack of a centralized style sheet; instead, styling properties had to be applied directly to individual components. In general, I feel like this can lead to repetitive code and make it difficult to enforce a consistent look and feel throughout the app without creating custom modifiers or extensive use of view composition. If I had to do this build again I would research packages/external libraries that make styling easier when developing for iOS. I coded like this:


![Swift Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k6a9jtawqijmy4bep267.png)

For my third and final build, I installed Android Studio and completed the [Learn Kotlin: Introduction course](https://www.codecademy.com/learn/learn-kotlin-introduction) on codecademy. The build was cumbersome to say the least. As a first time user, I found the Android Studio UI to be incredibly fiddly and confusing. To put it plainly, using Android Studio after a year of VS code felt like a significant downgrade. Android Studio can be sluggish with constant loading, longer build times, and an overall less responsive IDE experience. Learning Kotlin was also a challenge, and considering how unversatile Android Studio is, I don't think it is recommendable for developers with Web development backgrounds as a starting point for mobile development.

Despite getting the basic functionality working in Kotlin, the styling turned into a total nightmare, refusing to align with my mockup. Each attempt to mirror the sophisticated simplicity I'm used to working with in CSS and tailwind resulted in inconsistencies. I am no Kotlin mogul, so I did my best with learning resources available online. I coded as follows:

![Kotlin Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2dx90jem7iy0h409rpnu.png)

Having a solid understanding of React, I thought React Native would be a walk in the park. React Native promised the comfort of familiar syntax and the promise of "learn once, write anywhere." While React Native allowed me to leverage my existing JavaScript knowledge, the intricacies of it were confusing at first.

Swift, the language for iOS development, was also demanding. Swift's expressive syntax and powerful features made it fun to write, and it felt very close to javascript. I was able to jump into solving leetcodes in Swift within my first hour or two of learning the language. I learned that the iOS development environment demands serious precision and an understanding of Apple's ecosystem. Xcode, Interface Builder, and Auto Layout require a truly meticulous approach. The benefits are a tightly integrated development environment, excellent performance, and a seamless user experience. However, it comes with the closed nature of Apple's ecosystem and the rigidity of the App Store review process. Swift is not particularly versatile compared to the others.

Kotlin presented its own set of dilemmas. Coming from JavaScript, Kotlin's type system, null safety, and concise syntax were cool to learn about. And the Android development environment is… a beast of its own, to say the least. Android Studio, Gradle, and the myriad of Android-specific quirks reminded me of my time studying Talmud. Google's endorsement definitely makes the Kotlin/Android stack somewhat enticing to me, but of the three rebuilds I found this one the most challenging.

Balancing these three technologies involves engaging in a sort of dialectical reasoning process where each detail can be weighed, considered, compared, and understood. As a developer, my key takeaway from this journey was not just the technical knowledge gained but the realization that the path to mastery is paved with curiosity, resilience, and an unwavering commitment to growth. Even though I do not plan on pursuing Kotlin as of now, I value the time I spent experimenting with new technologies, giving me a more well rounded toolset.

After a week of three rewarding builds, I've learned that I am excited to continue with the React Native workflow. After tinkering with other IDE’s, I now see how much I underestimated the straightforward and responsive experience in VS code. Something about using Expo Go to code and see live updates on my iphone inspired childlike joy and excitement in me. Considering my previous experience with tailwind, I find styling with React to be most streamlined. Despite the challenges, I don't regret a single moment spent exploring each technology. Diving into Kotlin, SwiftUI, and React Native has been a profound demonstration— to myself and others of my capacity to learn and adapt. Each line of code, and every styling struggle taught me not only about the limitations and strengths of each platform but also about my own resilience and eagerness to grow as a developer.

I expected to learn about mobile development, but more than anything I learned about the explorative process. Driven by curiosity and a bit of uncertainty about my path, it turned out to be incredibly rewarding. The trial and error, the successes and frustrations—it was all a process of elimination that has unexpectedly ignited a strong motivation within me, particularly towards React Native. This experience also shows how personal the journey through technology can be; what works for one developer might not resonate with another, influenced by individual preferences, prior knowledge, and the specific demands of the project at hand.

As of the latest data, React Native holds a significant share of the cross-platform development market. Its community support and continuous updates from Facebook ensure it remains relevant and powerful. Major companies like Instagram, Bloomberg, and UberEats utilize React Native, which showcases its robust capabilities and trust in the tech industry. The demand for developers skilled in React Native is expected to grow as more companies adopt a mobile-first approach in their business strategies.

For me, React Native stood out as the clear winner due to how it aligns with my way of thinking and my creative workflow. While I recommend React Native for its versatility and developer-friendly environment, I also recognize that every developer's experience will vary. My adventure through these technologies was not just about finding the right tool, but also about discovering more about myself as a developer and what makes me tick. This personalized exploration is something I believe every developer should experience to truly understand what resonates with their unique style and professional goals. So the next time you are unsure of a technology to learn, challenge yourself to try them each. And who knows, you may just end up building the same thing three times!