قالب وردپرس درنا توس
Home / Apple / Michael Tsai – Blog – When to adopt Swift

Michael Tsai – Blog – When to adopt Swift



Marco Arment :

Add up all the time you've spent learning Swift from scratch, cater to the rigor, fight their buggy tools, migrate your code through language changes and re-learn APIs and conventions they've changed the last 5 years.

I've spent zero time on it.

I jump in when it is so old, boring and slow that no one is bothering to tell people to move to Swift because they are busy giving geek out and fusing over a newer language.

[…]

I know the basics. I've written a few thousand lines of Swift, including a whole simple app. I just choose not to write it over the vast majority of the time.

I think migration is no longer a problem. The tool is still buggy, but it gets much better. However, it is certainly a cost of time and you have to think about what you are trying to do. Is it worth changing if you are going to write the Objective-C style code in Swift? One can argue that it is the worst of both worlds. Learning to really take advantage of Swift is rewarding, but takes time. And you are limited in how Swifty you can be if you have an existing Objective-C codebase. For a new app or a great rewrite, I think most developers should bite the bullet. In other situations, it is less obvious. We do not yet know if Apple will redesign its Swift APIs, although the Mojave Network Framework is an interesting example of functionality available in both languages, but in second class in Objective-C.

Craig Hockenberry :

Another thing I've noticed: the type of security slows down the prototyping step where you just want it to work, not be perfect. Fast and dirty leads to good experiences.

(I've also turned back to Obj-C.)

I think it really depends on the type of code. In some cases, especially on the model and with algorithms, I feel that I am moving much faster with Swift. There is less boilerplate, the default library offers much that the Foundation does, and the strong writing helps with both thinking and refactoring. But other times, especially when it interacts a lot with cocoa, it may feel like it is getting in the way. There are impedance defects and dead streets. Some of this can be smoothed over with more code.

Ken Kocienda :

💯. I believe that the most undervalued productivity measurement in programming is the time it takes to create an iteration. I work hard to keep this cycle short and cheap. Several iterations give better results.

Craig Hockenberry :

I had high hopes that playgrounds would speed up the iteration. There has been a bust: either inexplicable errors or slower than just collecting some test codes.

Unfortunately, this has been my experience as well.

Ken Kocienda :

Learning Swift taught me nothing new about how to think about my programs. It didn't expand my mind. Also, type security prevents some of the ad hoc flexibility that helps when writing the types of user interfaces I usually type.

In other languages, Swift does not help me with what is really hard to write code: think through exactly what I want to do. Knowing that, writing the code is mostly a matter of idioms, conventions, tools, and wealth, and the availability of good libraries.

I did not find the Swift mind that grows in the theoretical sense, as it mostly brings together ideas that had already appeared in other languages. But it is quite practical because it makes these tools available for real world code, written in a platform's blessed language. It also forwards them in ways that make them more approximate.

Jeff Johnson :

It feels like a cult. Swifters cannot leave themselves alone enough. They are morally repelled if you do not use Swift and they must turn on your door and convert you to faith.

Rory Prior :

Marco reasons are absolutely valid for him, but they really apply only to indie developers or people who will call the language used for projects. It is a Swift refusenik who is career suicide otherwise.

Colin Cornaby :

Set confused by the amount of fuss over Marco's tweet about Swift. No one interrupts Swift just because Marco doesn't use it. He loves to adopt Swift does not threaten anyone else. He only does what he thinks most responsible for his product.

[…]

Also:

"Swift is super easy to learn easier than Obj-C so easy that kids learn it on their iPads"

"But if you don't learn now, you're going to be forever behind and never useful as a developer again "

Learning the basics is relatively easy, but it takes a long time to master. In a sense, everyone is always behind those who began to learn some language before them. But learning is not linear, and there are also some other things to learn in addition to a particular language. No one is in front of everything. The question is what is most important for you to learn now .

Brian Webster :

Swift:

  (lldb) expr -l Swift - - import PowerPhotos
(lldb) expr -l Swift - la $ view = unsafeBitCast (0x600003b132c0, PowerPhotos.IPPhotoSelectionView.self)
(lldb) expr -l Swift-print ($ view.description) 

ObjC:

  (Lldb) po [0x600003b132c0 description]

Dave DeLong :

Add this to ~ /. lldbinit :

  command regex objc & # 39; s / ^ (. +) $ / expr -O -l objc ++ -% 1 / & # 39; 

Now you can do:

  (lldb) objc [0x600003b132c0 description]

] Dave Lee :

Another option is overload po to provide custom behavior for memory addresses:

  command regex po
s / (0x [[:xdigit:]] +) $ / expr -lobjc -0 -% 1 /
s /(.+)/ expr -O -% 1 / 

This makes po treat 0x76543210 treat it as objc. Any other expression becomes standard [behavior].

Formerly: On my misalignment With Apple's love affair with Swift.

Cocoa iOS iOS 12 LLDB Mac macOS 10.14 Mojave Objective-C Programming Swift Programming Language Xcode [19659046] Stay updated by subscribing to the RSS feed for this post.




Source link