Python vs. Swift



Hacker News, Reddit, Stack Overflow Stats

  • 3.4K
  • 20.9K
  • 1.09M
  • -
  • 7.48K
  • 219K

GitHub Stats

Description

What is Python?

Python is a general purpose programming language created by Guido Van Rossum. Python is most praised for its elegant syntax and readable code, if you are just beginning your programming career python suits you best.

What is Swift?

Writing code is interactive and fun, the syntax is concise yet expressive, and apps run lightning-fast. Swift is ready for your next iOS and OS X project — or for addition into your current app — because Swift code works side-by-side with Objective-C.

Want advice about which of these to choose?Ask the StackShare community!

Pros

Why do developers choose Python?
Why do you like Python?

Why do developers choose Swift?
Why do you like Swift?

Cons

What are the cons of using Python?
Downsides of Python?

What are the cons of using Swift?
Downsides of Swift?

Companies

What companies use Python?
3221 companies on StackShare use Python
What companies use Swift?
1091 companies on StackShare use Swift

Integrations

What tools integrate with Python?
85 tools on StackShare integrate with Python
What tools integrate with Swift?
13 tools on StackShare integrate with Swift

What are some alternatives to Python and Swift?

  • JavaScript - Lightweight, interpreted, object-oriented language with first-class functions
  • PHP - A popular general-purpose scripting language that is especially suited to web development
  • HTML5 - 5th major revision of the core language of the World Wide Web
  • Java - A concurrent, class-based, object-oriented, language specifically designed to have as few implementation dependencies as possible

See all alternatives to Python

Latest News

Python Exception Handling – UnboundLocalError
Get Started Quickly With Python Logging
Python 3.7.0b1 is now available for testing
Swift Playgrounds 2.0 Now Available
Swift Playgrounds 2.0 Now Available
How to send Push Notifications to your iOS app with ...
Related Stack Decisions
Conor Myhrvold
Conor Myhrvold
Tech Brand Mgr, Office of CTO at Uber · | 1 upvotes · 5945 views
atUber Technologies
RIBs
Swift
Objective-C

Excerpts from how we developed (and subsequently open sourced) Uber's cross-platform mobile architecture framework, RIBs , going from Objective-C to Swift in the process for iOS: https://github.com/uber/RIBs

Uber’s new application architecture (RIBs) extensively uses protocols to keep its various components decoupled and testable. We used this architecture for the first time in our new rider application and moved our primary language from Objective-C to Swift. Since Swift is a very static language, unit testing became problematic. Dynamic languages have good frameworks to build test mocks, stubs, or stand-ins by dynamically creating or modifying existing concrete classes.

Needless to say, we were not very excited about the additional complexity of manually writing and maintaining mock implementations for each of our thousands of protocols.

The information required to generate mock classes already exists in the Swift protocol. For Uber’s use case, we set out to create tooling that would let engineers automatically generate test mocks for any protocol they wanted by simply annotating them.

The iOS codebase for our rider application alone incorporates around 1,500 of these generated mocks. Without our code generation tool, all of these would have to be written and maintained by hand, which would have made testing much more time-intensive. Auto-generated mocks have contributed a lot to the unit test coverage that we have today.

We built these code generation tools ourselves for a number of reasons, including that there weren’t many open source tools available at the time we started our effort. Today, there are some great open source tools to generate resource accessors, like SwiftGen. And Sourcery can help you with generic code generation needs:

https://eng.uber.com/code-generation/ https://eng.uber.com/driver-app-ribs-architecture/

(GitHub : https://github.com/uber/RIBs )

See more
Nitzan Shapira
Nitzan Shapira
at Epsagon · | 3 upvotes · 2437 views
atEpsagon
AWS Lambda
GitHub
Java
Go
Node.js
npm
Serverless
Python

At Epsagon, we use hundreds of AWS Lambda functions, most of them are written in Python, and the Serverless Framework to pack and deploy them. One of the issues we've encountered is the difficulty to package external libraries into the Lambda environment using the Serverless Framework. This limitation is probably by design since the external code your Lambda needs can be usually included with a package manager.

In order to overcome this issue, we've developed a tool, which we also published as open-source (see link below), which automatically packs these libraries using a simple npm package and a YAML configuration file. Support for Node.js, Go, and Java will be available soon.

The GitHub respoitory: https://github.com/epsagon/serverless-package-external

See more
Tim Abbott
Tim Abbott
Founder at Zulip · | 3 upvotes · 1020 views
atZulip
Go
Python

We've been a big fan of Python ever since we adopted it for my first startup, Ksplice. But it's been an absolutely ideal tool for Zulip, which is now one of the leading alternatives to Slack. Zulip is 100% open source software, with ~10K stars on GItHub. And being written in idiomatic Python has been really helpful for our open source project, because it's such an accessible language: Any programmer can learn Python quickly. And that means we're not restricted to e.g. "folks who are excited about contributing to Zulip and ALSO know Go".

I've linked to a blog post I wrote on Python's awesome new static type system, which fixes the main complaint one might have about using Python for a large codebase, which has a lot more perspective, as well as some commentary on our Python 3 migration.

See more


Interest Over Time