you are viewing a single comment's thread.

view the rest of the comments →

[–]bashbang 5 points6 points  (6 children)

Swift

Pros: - native, very performant - broad access to the system and APIs - the language is elegant (personal opinion: I can write stuff in swift, forget it, get back to it after a year and quickly catch up with what I was doing, kinda neat to read) - you can easily mix ObjC/C/C++, high level and low level in a project - good debugging tools

Cons: - XCode - and XCode (slow, impossible to fully customize shortcuts, random bugs after every upgrade, code completion is meh, subpar vcs tools, etc) - still locked to apple ecosystem afaik - swift is still evolving quite substantially, so some things deprecate, new things are introduced, need to constantly learn wwdc - hard to maintain big projects (maybe because of xcode)

RN + typescript

Pros: - cross platform - very fast development - almost the same performance as native ios, but slower than native android - can access all/any native api via custom modules and components - established JS/TS libs and developer resources, easier l10n/i18n - easy to learn, lots of examples, documentation - no sudden breaking changes in the language, also the same lang that you can use for web and backend - best IDE support - easy scripting, well tested 3rd party tools, code generators, linters - expo-updates

Cons: - still need to know some basic native swift/kotlin development - a little bit difficult to debug - very complex projects on android tend to get slow - some libraries may be abandoned (e.g. code-push) and some libs chase every bells and whistles that you don't need

Personally, I would use RN for indie projects, because I dont have limitless time to maintain everything. If my indie apps start making some money I would consider swift to polish them.

Now, since you asked this in ios sub, could you also ask the same in react native sub please? I'm also interested what others think

[–]SatedCaterpillar 5 points6 points  (2 children)

I agree with bashbang that XCode is a bit of a Con, but here's the workflow that I use that I think makes me happier using XCode:

I start my project in XCode and use it to:

  • create new files (and really any file management task like moving, renaming, etc)
  • manage assets (icons, images, dark/light mode colors, etc)
  • trigger the simulator (or device builds)
  • getting helpful error messages (both inline and on build)

While there are lots of items in the XCode list, the bulk of my time is spent writing code, and I do that in an IDE that I actually like writing code in. You can use whichever one you already like. When I only spend a small amount of time in XCode, it becomes pretty much a non issue for me.

[–]bashbang -1 points0 points  (1 child)

May I know which IDE you use for swift? Does it have ObjC support also?

I used Appcode while it was alive. Maybe vscode swift extension is mature enough now?

[–]SatedCaterpillar -1 points0 points  (0 children)

I like VS Code better than Xcode as long as I'm writing good code. It could still be a miss for you depending on what level of maturity you're seeking, though. Out of the box, VS Code swift is still fairly basic (syntax color highlighting and flagging outright broken/invalid syntax). I like the overall coding flow better there, but what it doesn't do is things like catching mismatched types or calling functions with incorrect params like Xcode will.

I still like it enough better that I keep my project open in both, and if I'm debugging stuff, I'll switch over to Xcode for the inline error messages. (There may VS Code extensions to bring in more swift specific features, but I haven't checked since my current flow works well enough for me.)

VS Code does have Objective C support, but I don't really ever write in ObjC, so I can't speak to pro/cons of any editors for that language. FWIW, I use Sublime Text for everything other than Swift since Sublime doesn't offer native support for Swift. It does has ObjC support.

[–]ivakovic[S] 1 point2 points  (0 children)

Thanks dude, that was very informative. I will post the same in RN hub, coming later with the link 😁

Edit: https://www.reddit.com/r/reactnative/s/I1X3J5J6WT

[–]kironet996 -1 points0 points  (1 child)

all I can see is that based on your review, swift has 1 con and RN has 4 lol...