3 ms·
Pretty happy the Firefox for iOS team made the decision to go fully Swift about 14 months ago :-) Almost 60,000 lines later, no regrets. It is awesome.
by st3fan 11y ago
Pretty happy the Firefox for iOS team made the decision to go fully Swift about 14 months ago :-) Almost 60,000 lines later, no regrets. It is awesome.
- shawn-butler 11y ago> git clone https://github.com/mozilla/firefox-ios.git https://github.com/mozilla/firefox-ios.git FireFox-ios > cloc FireFox-ios/ 1068 text files. 928 unique files. 303 files ignored. C 1 files 10606 blank 51150 comment 94618 code Swift 332 files 9660 blank 5808 comment 43474 code EDIT: I give up trying to format the output correctly
- deathanatos 11y agoThe single .c file, I'm guessing is: https://github.com/mozilla/firefox-ios/blob/master/ThirdParty/sqlcipher/sqlite3.c https://github.com/mozilla/firefox-ios/blob/master/ThirdPart... It appears to be the source for sqlite3, all concatenated together, which is why it's absurdly long. And it's third party, so its not really their code, but of course the tooling can't tell that.
- Someone 11y agoI haven't checked, but chances are it is the SQLite amalgamation or a tweaked version of it. https://www.sqlite.org/amalgamation.html https://www.sqlite.org/amalgamation.html: "The standard makefiles for SQLite have a target for building an object we call the "amalgamation". The amalgamation is a single C code file, named "sqlite3.c", that contains all C code for the core SQLite library and the FTS3, FTS5, RTREE, DBSTAT, JSON1, and RBU extensions. This file contains about 184K lines of code (113K if you omit blank lines and comments) and is over 6.4 megabytes in size".
- brendanlim 11y agoLyft for iOS is probably one of the largest Swift apps http://m.fastcompany.com/3050266/tech-forecast/lyft-goes-swift-how-and-why-it-rewrote-its-app-from-scratch-in-apples-new-lang http://m.fastcompany.com/3050266/tech-forecast/lyft-goes-swi...
- ogmo 11y agoRough estimate is the Outlook app has over 70k lines of Swift, which is just over 50% of our codebase (the rest is Objective-C). That doesn't include external libraries. One of our devs starting adding Swift code to the project about a year and a half ago. After that proved successful, the rest of the dev team then started getting up to speed. For the last 8 months, all development has been done in Swift. We don't arbitrarily rewrite existing source, but if we're making changes to an existing Objective-C file, we evaluate if it would be worthwhile to rewrite in Swift. Often the answer is yes. From our perspective, Swift is absolutely ready for primetime. For a large codebase like ours, it takes some time before you see direct benefits, but if you keep with it, I'm sure you won't regret it. I should mention the downsides: the migration to Swift 2 took time, but it wasn't awful. I'm sure we'll have similar issues moving to Swift 3. Also our compilation times are quite a bit slower than with purely Objective-C.