Live data from Hacker News

The Decade of Swift

swiftbysundell.com

31–40 of 145 posts

Re: The Decade of Swift

#31

Swift doesn't seem to be a bad language, but during my brief adventures with it I encountered a major drawback: differences between versions are so great, that searching the web for examples is problematic and you end up with many fruitless attempts and compiler errors. Apple's documentation isn't nearly as useful and readable as that of the Go team.

This was definitely true in the past, and might still be true now, I'm not sure, but XCode does a good job of catching Swift errors now and can fix several of them for you, and for those that don't, there mostly seems to be useful StackOverflow answers for the error messages online now.

I took a long break from working with Swift and just started diving into it again, and even though there was two major versions since I last messed with it, it was pretty easy to settle into it, and I've only had to look up how to do things on a case by case basis periodically. Maybe that's just my experience, though, and others have a harder time with it.

Re: The Decade of Swift

#32

> That’s why Swift’s expressive and very lightweight syntax And a few paragraphs later: extension Array { func sorted ( by keyPath: KeyPath ) -> Self { sorted { $0[keyPath: keyPath] I can't say this is lightweight any longer. My greatest gripe with Swift comes not from Swift itself but from its standard library. When most new languages start with their own standard libraries that are usually interfaces towards C APIs…

The directory thing is more due to sandboxing than anything else. They don't want someone to be able to write an app that can read anything anywhere on your phone, so it has specific directories that have different levels of access and temporality (i.e. one is a temp folder that gets flushed each time you quit the app, if I remember correctly). It's not that complicated once you look it up, and like most of this stuf…

> They don't want someone to be able to write an app that can read anything anywhere on your phone,

And that's the main problem with Foundation which hurts Swift as a language: it was made for iPhone apps, and hardly anything else. I was trying to make a CLI app on the desktop. I gave up and used something else.

> It's not that complicated once you look it up, and like most of this stuff

Yeah, I tried to look it up. It's extremely complicated, and it doesn't help that the documentation tends to spread all the knowledge across dozens of pages with very terse documentation and next to zero examples.

> I've opened many a file in Python scripts, but I'd have to look up buffering, encoding, errors, closefd, and opener right now if I wanted to use them

My example doesn't have any buffering, or encoding, or anything. It's just reading a file. There's no chance in hell you can deduce those lines from the documnentation, or find out where to put the files to read from, or find out that it's not the file's job to read/write data, but String type's (wat?) etc.

It doesn't help that the only real example of reading and writing files isn't in the docs, but in a StackOverflow answer (most other examples are either outdated, or use calls to Obj-C libs etc.)

Re: The Decade of Swift

#33
post #14
post #10

I hate to say this, but Swift is to Objective-c, what Scala is to Java.... It was very exiting and promising at first, but it became bogged down due to its sheer run-away complexity and over-academic approach to programming.... To an outsider, or iOS new comer, Swift looks much better than Objective-c, (due to Objective-c weird syntax), but to many insiders, Swift seems like a huge missed opportunity... The use of Sw…

I think Rust supersedes it in most aspects, especially in not being Apple driven.

I would kill for a language with Swift's productivity and usibility and Rust's tooling and ecosystem.

Re: The Decade of Swift

#34
post #14
post #10

I hate to say this, but Swift is to Objective-c, what Scala is to Java.... It was very exiting and promising at first, but it became bogged down due to its sheer run-away complexity and over-academic approach to programming.... To an outsider, or iOS new comer, Swift looks much better than Objective-c, (due to Objective-c weird syntax), but to many insiders, Swift seems like a huge missed opportunity... The use of Sw…

I think Rust supersedes it in most aspects, especially in not being Apple driven.

[deleted]

Re: The Decade of Swift

#35
post #14
post #10

I hate to say this, but Swift is to Objective-c, what Scala is to Java.... It was very exiting and promising at first, but it became bogged down due to its sheer run-away complexity and over-academic approach to programming.... To an outsider, or iOS new comer, Swift looks much better than Objective-c, (due to Objective-c weird syntax), but to many insiders, Swift seems like a huge missed opportunity... The use of Sw…

I think Rust supersedes it in most aspects, especially in not being Apple driven.

So we’ll refuse go, typescript and react?

Apple has the best engineering talent of all tech companies.

Re: The Decade of Swift

#36
post #18

Earlier quoted context omitted.

This seems very unlikely to me. They would need it to interoperate with their existing stack. They chose Kotlin where they reasonably could have chosen Swift and then worked to extend it to work with their existing stack. Judging by what I would argue has been a lukewarm reception to Swift for Tensorflow, I think it would a very hard sell to convince people within Google to support Swift as a first-class language in…

Just to clarify Google's choice of Kotlin -- the maker of their IDE invented and did all of the heavy lifting with Kotlin, including building the JVM targeting compiler, and the IDE to develop it in (which is the foundation of Android Studio). Adopting Kotlin was very close to free for Android, and was really just rubber stamping what a lot of developers were doing regardless.

From what I remember Kotlin came to Android before Google embraced Jetbrains and Android Studio.

Re: The Decade of Swift

#37
post #10

I hate to say this, but Swift is to Objective-c, what Scala is to Java.... It was very exiting and promising at first, but it became bogged down due to its sheer run-away complexity and over-academic approach to programming.... To an outsider, or iOS new comer, Swift looks much better than Objective-c, (due to Objective-c weird syntax), but to many insiders, Swift seems like a huge missed opportunity... The use of Sw…

Can you go into any specifics? Personally I've found Swift to be incredibly easy to read and write, and that it largely delivers in terms of rolling out complexity through progressive disclosure. Most of the complexity is only there if you need it in my experience.

Re: The Decade of Swift

#38
post #28
post #18

Earlier quoted context omitted.

This seems very unlikely to me. They would need it to interoperate with their existing stack. They chose Kotlin where they reasonably could have chosen Swift and then worked to extend it to work with their existing stack. Judging by what I would argue has been a lukewarm reception to Swift for Tensorflow, I think it would a very hard sell to convince people within Google to support Swift as a first-class language in…

I'm pretty sure they went with Kotlin before Swift was open sourced, but I agree with you that the likelihood of them doing it is very low. Swift for Tensorflow hasn't gotten much traction because the overlap between programmers who know swift and machine learning engineers is super tiny. Making the core language differentiable sounds very promising though .

Swift was released before kotlin

Re: The Decade of Swift

#39
post #14

Earlier quoted context omitted.

I think Rust supersedes it in most aspects, especially in not being Apple driven.

So we’ll refuse go, typescript and react? Apple has the best engineering talent of all tech companies.

Off course, that's why they keep having security issue after security issue (macOS root exploit to iPhone issue reported by project zero).

Re: The Decade of Swift

#40
post #29

Swift has come a long way. I remember first trying it and XCode acting like it couldn't figure anything out in Swift, and you could almost never bring up an autocomplete or search for references or jump to definitions or any nice feature in an IDE that worked just fine with Objective-C. I decided to give it another shot years later, and I'm working on a simple game in Swift right now, and it's been a much, much smoot…

Most of these all sound like improvements to XCode, not Swift?

I guess I should say "My experience in working with Swift has come a long way", because XCode being so crap with it made it a pain in the ass to code in Swift back then, for me, especially considering how rock solid Visual Studio is in comparison.

To be more specific about Swift, though, there used to be a ton of things you had to bridge to Objective-C in order to do back then, and now it seems like there's almost nothing you have to bridge to Objective-C to do unless you want to work with your legacy code (all of their libraries now have Swift support, at least those that I use), and there's now a cool new SwiftUI framework that is very easy to use and very powerful.

Post reply on HN