Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decoupling Swift from Cocoa's Foundation #54

Closed
6 tasks done
masters3d opened this issue Aug 13, 2015 · 6 comments
Closed
6 tasks done

Decoupling Swift from Cocoa's Foundation #54

masters3d opened this issue Aug 13, 2015 · 6 comments
Milestone

Comments

@masters3d
Copy link
Contributor

Swift and the Swift standard library are going to be open sourced by the end of 2015.
This got me thinking about the use of Foundation classes ( NSDate, NSMutableArray, NSString etc ) in the problems.

Should we make it a point to decouple the tests and examples to focus on "pure" swift implementations since Foundation is not going to be available for Linux?
In xcode 7 beta 5 there were some changes to NString and String that dealt with paths.
https://forums.developer.apple.com/thread/13688

This is an indication that swift types are becoming more "pure" maybe because of the open source release.

This would mean not importing foundation.
Edit: 9-9-15

Current list of problems that depend on Foundation.

  • /acronym/AcronymExample.swift // No Native Swift for NSExpression
  • /bob/BobExample.swift // No Native Swift for NSExpression
  • /gigasecond/GigasecondExample.swift // No Native Swift for NSDate
  • /meetup/MeetupExample.swift // No Native Swift for NSDate
  • /word-count/WordCountExample.swift //NSStringCompareOptions
  • /wordy/WordyExample.swift //NSStringCompareOptions
@masters3d masters3d changed the title Decoupling Swift from CocoaFoundation Decoupling Swift from Cocoa's Foundation Aug 13, 2015
@nickkjordan
Copy link
Contributor

Yeah, I'm in favor of this. I don't remember many tests actually using Foundation, but I don't know about the examples.

@hankturowski
Copy link
Contributor

This is a good idea. We should always prefer the native Swift types over the Objective-C counterparts.

But, I think we should hold off on this until at least the official release of Swift 2.0. We'll have a lot of work to do updating tests anyway. We should probably start a thread on Swift 2 migration. Some of the changes like @testable will make things easier for us if we handle them correctly. I'm thinking that we provide a starter project along with the first exercise (as suggested in another issue) and provide instructions on how to add new exercises to that project. Then we can control the package name and make the rest of the process smooth.

I'd also like to reorder the exercises. I ran through the first few with a new group the other day and man, doing Bob second was brutal. String process was tedious, and I think we'd be better off having some quicker exercises early.

@masters3d
Copy link
Contributor Author

This brings up another question:
Is there a value on keeping swift 1.2 versions of the problems around?
I can see v3 v4 of swift starting to change a lot but many people could have limitation on what they are working on ( think python 2 vs 3 ) etc.

@hankturowski
Copy link
Contributor

I think we should just ditch the 1.2 stuff when we migrate. Maintaining two sets of exercise will be a real pain, and adoption rates will probably be astronomical like they are with iOS. I think Xcode is an automatic update from the App Store.

This was referenced Aug 13, 2015
@masters3d
Copy link
Contributor Author

Sounds good.

@masters3d masters3d added this to the Swift 2.0 milestone Aug 14, 2015
@masters3d masters3d reopened this Aug 14, 2015
masters3d added a commit to masters3d/xswift that referenced this issue Sep 11, 2015
masters3d added a commit to masters3d/xswift that referenced this issue Sep 13, 2015
@masters3d
Copy link
Contributor Author

Swift really needs an NSDate native also Regular expression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants