Swift 4.0 官方文档中文翻译 -- Welcome to Swift

该文章翻译自apple官方文档:The Swift Programming Language(Swift 4.1)

Swift 4.0 版本相对于前面几个版本来说,已经比较稳定,也终于可以利用下班时间关注和学习它了,鉴于官方文档是英文的,自己翻译过后也需要记录下来,那就一起分享吧,一定有理解不充分和不足的部分,请斧正!

既然不知从哪里开始合适,那就一页页来吧~

About Swift

Swift is a fantastic way to write software, whether it’s for phones, desktops, servers, or anything else that runs code. It’s a safe, fast, and interactive programming language that combines the best in modern language thinking with wisdom from the wider Apple engineering culture and the diverse contributions from its open-source community. The compiler is optimized for performance and the language is optimized for development, without compromising on either.

Swift is friendly to new programmers. It’s an industrial-quality programming language that’s as expressive and enjoyable as a scripting language. Writing Swift code in a playground lets you experiment with code and see the results immediately, without the overhead of building and running an app.

Swift defines away large classes of common programming errors by adopting modern programming patterns:

  • Variables are always initialized before use.

  • Array indices are checked for out-of-bounds errors.

  • Integers are checked for overflow.

  • Optionals ensure that nil values are handled explicitly.

  • Memory is managed automatically.

  • Error handling allows controlled recovery from unexpected failures.

Swift code is compiled and optimized to get the most out of modern hardware. The syntax and standard library have been designed based on the guiding principle that the obvious way to write your code should also perform the best. Its combination of safety and speed make Swift an excellent choice for everything from “Hello, world!” to an entire operating system.

Swift combines powerful type inference and pattern matching with a modern, lightweight syntax, allowing complex ideas to be expressed in a clear and concise manner. As a result, code is not just easier to write, but easier to read and maintain as well.

Swift has been years in the making, and it continues to evolve with new features and capabilities. Our goals for Swift are ambitious. We can’t wait to see what you create with it.


Swift 是一门写软件很好用的语言,不管是对于手机端,前端,后台还是任何一个可以运行代码的平台,它都是一门安全,快速,能相互影响的编程语言,它结合了最好的现代化语言思维和来自更广的苹果工程文化的智慧以及来自开源社区的多种多样的贡献。这编译器在性能方面做了优化,并且这语言在开发上做了优化,不妥协。

Swift 对于初学者是很友好的,是一门既满足工业标准又脚本语言一样充满表现力趣味编程语言

Swift通过接受现代化编程模式定义了大量的常用的编程错误的类

         变量在用之前要被初始化

         检查数组时候越界

         检查整数是否溢出

         确保nil 明确地被处理过

         自动管理内存

         错误处理允许从异常失败中控制恢复。

Swift 代码充分利用现代硬件编译和优化。它的语法和标准库是基于‘写代码很显然的方式也应该运行的最好’的指导原则设计的。

安全和快速的结合使得Swift 无论从最简单的‘hello world’还是对于开发整个操作系统,都成为一个杰出的选择

Swift 结合了强大的类型推断和模式匹配与现代的,轻量级的语法,使复杂的想法,以明确和简明的方式表达。因此,代码不仅容易编写,而且更易于阅读和维护。

Swift 已经发展多年,并且在继续发展新的特点和功能。我们的目标远大,我们已经迫不及待地想看看你能用它创造出什么了。




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值