TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How and why Lyft rewrote its app in Swift

42 pointsby technologizerover 9 years ago

8 comments

lordnachoover 9 years ago
My latest project is written in Swift. It was honestly a no-brainer to switch.<p>ObjC seems a bit cobbled together, and a lot of things look a bit more verbose that they need to be. And there&#x27;s some type safety issues lurking in various places, too. And then there&#x27;s the whole having .h and .m files, an inconvenient way to organise things in this day and age. Sure, I was used to it from c++, but that isn&#x27;t the fastest language to code in, either.<p>One needs to get over the trepidation of a new language. I was talking to another CTO about this, a guy who&#x27;s been coding for 30 years. Once you understand the domain and you can solve the problem, language is not a big deal. Of course you need a language that contains the abstractions of the solution, but generally any OO language will be able to do it. What&#x27;s left then is whether the language lends itself to coding tools, terseness, library availability, and the level of granularity you need.<p>As a language that&#x27;s focused on building nice apps, Swift strikes a good balance. If I&#x27;m going to be doing UI stuff, I can assume I won&#x27;t need the fine-tuning that something like c++ gives me. I generally don&#x27;t want to be bothered by the memory management, and I don&#x27;t expect performance to be a big deal (people can wait dozens of ms for something, they won&#x27;t notice). If anything takes a long time, I can use GCD just like in ObjC. I care that things are easy to find in the code, and there aren&#x27;t many contortions (eg pull out something as an id and cast it. Concat a string by using a ludicrously long function with an unobvious name). There&#x27;s library compatibility, so I can pretty quickly glue together an app from the same pieces as ObjC, with less glue.
评论 #10197134 未加载
评论 #10202764 未加载
jafitcover 9 years ago
One more reason: to get featured inside the App Store.<p>Apple loves to feature apps showcasing their latest technologies.<p>They show such apps as a good example for other developers to follow.
bkoover 9 years ago
&gt; Over the years, the original version of Lyft had ballooned to 75,000 lines of code. By the time the company was done recreating it in Swift, they had something that performed the same tasks in less than a third of that.<p>I recently read a tutorial on how to make an Uber app on Swift that was fairly short (although not complete yet) [0]. 75k lines of code seems like a lot, even if it&#x27;s down to a third of that. From personal experience, I know that code grows very fast when you start adding features but I can&#x27;t point to any one reason why it should have to.<p>[0] <a href="http:&#x2F;&#x2F;shrikar.com&#x2F;build-your-own-uber-app-in-swift&#x2F;" rel="nofollow">http:&#x2F;&#x2F;shrikar.com&#x2F;build-your-own-uber-app-in-swift&#x2F;</a>
评论 #10201714 未加载
ghiculescuover 9 years ago
Meanwhile, on the cover of Fast Company: <a href="http:&#x2F;&#x2F;www.fastcompany.com&#x2F;3050250&#x2F;what-makes-uber-run" rel="nofollow">http:&#x2F;&#x2F;www.fastcompany.com&#x2F;3050250&#x2F;what-makes-uber-run</a><p>Lyft just can&#x27;t beat Uber at PR.
评论 #10196862 未加载
评论 #10197053 未加载
评论 #10196934 未加载
chatmastaover 9 years ago
Has anyone analyzed hacker news datasets for vote&#x2F;comment manipulation? I am specifically referring to uber. It seems HN will go days without any uber-related content, but every now and then, 15-20% of the articles on the front couple pages will be uber related, with comment sections filled with aggressively pro-uber rhetoric. I highly doubt it&#x27;s organic.<p>HN has a very manipulable hive mind. It doesn&#x27;t take much to convince the audience here of an agenda. Uber certainly has the resources to operate a &quot;grassroots propaganda&quot; campaign. I&#x27;ll bet it&#x27;s a central tenant of their PR strategy. I&#x27;ll also bet that a subset of that strategy is convincing the tech community to agree with the uber agenda. Two plus two equals four and uber is definitely manipulating HN.<p>Someone should crunch the numbers. I doubt uber would be the only anomaly to show up in an analysis, either.
epxover 9 years ago
I began to port a small project to Swift and at a certain point Xcode crashed because of a copy-paste on a swift file. Postponed it until Xcode 7...
评论 #10199158 未加载
CmonDevover 9 years ago
TL;DR: to gain maintainability at a cost to performance.
评论 #10197041 未加载
joningover 9 years ago
TL;DR: we had nothing better to do than to rewrite our entire app in Swift while the competition continues to destroy us.
评论 #10197009 未加载