From iOS to Web developer, the challenges

I learn how to code in Swift at the beginning of last year, and it was great!, I had little-to-no experience in software development, but eventually I became an iOS developer and was intrigued by the web development world, so I gave it a shot. I’ll tell you my experience on learning web development being a iOS developer, and the challenges I faced, so you can a have a smoother experience.

Swift was a great first language to learn, I was immediately introduced to type-safety, although I didn’t know it was a big deal; optionals, though didn’t know their true power, and other goodies Swift offers.

I took me three months to learn the basics of the language, and how to do iOS app development using Storyboards and UIKit, I knew I was ready to start developing my own app, I opened Xcode and created a new project!

It’s said that you don’t truly know how to develop software until you start your own project, and oh boy! is that true. The problem-solving challenges I faced were immense, but I was resilient and “solve” them. I specially struggled with Dates, the weird, irregular way we keep track of time, it was messy; I even built my own “little date framework”, well isn’t that just developer rookie 101?, after a few months of “solving” issues, I found that pretty much all modern frameworks and languages have a strong Date system behind them, I wish I knew better.

I then started to use SwiftUI and loved it!, I loved it so much that I scraped my month-old project and rewrote it using SwiftUI and found Storyboard to be clunky, unintuitive and hard to maintain.

So the app ended up taking 6 months to develop, but with all the changes I made, and all the reimplementation of code I worked on, it really took only 3 months of effective work.

Anyways, I know am building my second app, and I think I have way more experience in iOS development, and I’m now following the best practices and making better decisions.

Now let’s get to the juicy part, my experience learning web development as an iOS developer.

  1. The Right Framework

In iOS land you have to make few framework decisions, right?, SwiftUI vs UIKit, CoreData vs third party, Alamofire vs your own code, those decisions are not that hard to make, the differences are clear and you can spend more time and effort developing.

Well in web land, you have to make plenty of decisions, and I mean plenty.

The first decision you have to make as a web development freshman is to learn Frontend, Backend or both?, if you don’t know, Frontend is the code that lives in the user’s browser, it handles UI and user’s actions, while backend code lives on the server and handles modeling and databases.

Then, you have to choose a framework to work on, for example, for frontend you have React.js, Vue.js, etc., while for your backend you can use Node.js, Express.js or Django, or many many others, the options are truly endless. You can watch many great resources on Youtube on the advantages and disadvantages of the different frameworks, but in my experience, don’t overthink it, choice one of the three most popular frameworks, stick with it and don’t look back.

Why is that a challenge? Because there’s no clear road map, and when you’re learning you don’t know how a framework will make your life easier or harder, and you will spend time getting to know that framework and language, so changing it while learning is a big no no, if you want to change, wait until you truly understand the framework you’ve chosen, and see if it was the right fit.

Whatever choice you make, I found similar learning challenges that you’re going to face as an iOS developer, and they are all related to the languages and how they impact the development process, I will talk about the languages I’ve chosen.

I learned Python and used Django as my backend framework, and JavaScript with React for my frontend, see those languages are pretty different to Swift, sure the syntax may look similar, they are all object-oriented, but their ideologies are very different.

2. Compile vs Runtime debugging.

The true challenge on using Python and JavaScript coming from Swift, is all about a fundamental difference in design, Swift’s ideology is about compile-time debugging, while Python and JavaScript are runtime debugging languages, meaning that many errors or bugs found by the Swift compiler are never shown in Web languages until you build and run your code.

Sure it can be frustrating to hit Build in Swift and get errors, but those are errors you won’t need to worry about when you’ve successfully compiled your code; JavaScript and Python only fail to compile in a few cases, such as not adding parenthesis in a if statement in JavaScript, but that’s it, very basic syntax errors.

3. Type safety

There’s another fundamental difference between the languages, Swift is a safe language, meaning that types must always match, hence you can’t add 3 + true, since `Int` is different from `Bool`, well JavaScript and Python are languages with weak types, so you can add 3 + true, and it will give you… “4”. Sure this may look harmless, but now consider the fact that there’re no optional in those languages, so anytime you get a value, if you are not careful it could be `undefined`, meaning `nil`, or something totally unexpected.

So even if writing Python or JavaScript code is faster than in Swift, that time saved is spent debugging why your code is not working, so the endless `console.log` in JavaScript or `print` in Python nightmare begins, it often turns out to be a type bug, bugs that Swift will always scream at you about.

4. API Discoverability

The next major challenge was API discoverability, I was used to Swift’s autocomplete brilliance, so when implementing logic that dealt with a framework’s API, it was super easy to know what to call, when to call and the arguments it expected. Well in web development it’s the polar opposite, even with text editor’s extensions, most APIs have to be read and search for in the web, and not directly in your text editor, although is a good practice to read the Docs, it’s often hard to implement those APIs.

To add to the complexity you have to import everything in JavaScript or Python, there’s no such thing as a `global scope`; while in Swift you can design your User model in a .swift file far from your views, and just call it; in JavaScript and Python you have to individually import your User object, while that may help you stay organized, it’s often a pain to do, specially when you forget to do it.

Conclusion

If you already know iOS development and want to learn web development, go ahead! it’s amazing, and you can add a lot of experience to your resume or portfolio, but do keep in mind that you will face challenges, just like you did when learning Swift, but I hope this article helps you know those challenges, and save you a lot of time.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store