I like Swift and my overall answer is still yes that it is easier to learn than Objective C and that having to deal with types is worthwh...
I like Swift and my overall answer is still yes that it is easier to learn than Objective C and that having to deal with types is worthwhile for the safety it brings and increased chance that it will do the right thing when it does run but it is still a barrier to a limited degree. I remember initially struggling with the stuff in ML in the first year at university, I got it but I and many others had an initial struggle. I think that at least for beginners and maybe those coming from runtime duck typed languages Python, PHP, Ruby etc. it will be more of a barrier than you think. For #1 in Objective C you inherit from NSObject (or a subclass thereof) for every class anyway so it is in all the examples and it isn't something that you need to do especially for a protocol. For #2 yes of course you can have an array of a generic type but firstly you need to understand enough about the type system to create your array in that form and secondly what you get out will <AnyType> objects rather than <id>'s which get automatically cast to whatever you assign them to. But I do like the idiom for downcasting using as? : if let movie = item as? Movie { println("Movie: '\(movie.name)', dir. \(movie.director)") } else if let song = item as? Song { println("Song: '\(song.name)', by \(song.artist)") } [0] Excerpt From: Apple Inc. “The Swift Programming Language.” iBooks. https://itun.es/gb/jEUH0.l
Posted by josephlord on Jun 4, 2014, 8:37 AM
Tags
Related issues
- I mean that's the problem though.
- I've always believed the opposite: get conditionals deep in your code so that the higher level control flow is regular.
- The biggest problem with AI isn't being able to do things.
- I am a 3D printing maker type nerd (I make my own tools for other creative tasks, rather than as their own outcomes) and I saw an incredi...
- Of course not, those are clearly scams.
- Claude makes more detailed plans that seem better if you just skim them, but when analyzed, has a lot of errors, usually.
Raise real-world problems, find people facing the same issue, and discuss solutions.9,500 issues0 comments
hackernews (EdTech)
I mean that's the problem though.
I've always believed the opposite: get conditionals deep in your code so that the higher level control flow is regular.
The biggest problem with AI isn't being able to do things.
I am a 3D printing maker type nerd (I make my own tools for other creative tasks, rather than as their own outcomes) and I saw an incredi...
Of course not, those are clearly scams.
Claude makes more detailed plans that seem better if you just skim them, but when analyzed, has a lot of errors, usually.
Effectively everyone is building the same tools with zero quantitative benchmarks or evidence behind the why / ideas … this entire s...
> creating and operating a small company in Germany is a nightmare To be fair, I think the problem operating in Germany is its federated...
I like Swift and my overall answer is still yes that it is easier to learn than Objective C and that having to deal with types is worthwh...
I like Swift and my overall answer is still yes that it is easier to learn than Objective C and that having to deal with types is worthwhile for the safety it brings and increased chance that it will do the right thing when it does run but it is still a barrier to a limited degree. I remember initially struggling with the stuff in ML in the first year at university, I got it but I and many others had an initial struggle. I think that at least for beginners and maybe those coming from runtime duck typed languages Python, PHP, Ruby etc. it will be more of a barrier than you think. For #1 in Objective C you inherit from NSObject (or a subclass thereof) for every class anyway so it is in all the examples and it isn't something that you need to do especially for a protocol. For #2 yes of course you can have an array of a generic type but firstly you need to understand enough about the type system to create your array in that form and secondly what you get out will <AnyType> objects rather than <id>'s which get automatically cast to whatever you assign them to. But I do like the idiom for downcasting using as? : if let movie = item as? Movie { println("Movie: '\(movie.name)', dir. \(movie.director)") } else if let song = item as? Song { println("Song: '\(song.name)', by \(song.artist)") } [0] Excerpt From: Apple Inc. “The Swift Programming Language.” iBooks. https://itun.es/gb/jEUH0.l
Comments (0)
No comments yet. Start the discussion.