際際滷

際際滷Share a Scribd company logo
Objective C vs Swift
Objective C
 Object-oriented programming language
 Developed in the early 1980s (NeXTSTEP)
 Files have .h and .mm file extensions, C header files
 Created primarily by Brad Cox
 Messages,Interface,Implementation,Instantiation
 2014, Apple announced plans to replace Objective-C
new Swift language
Worst things about Objective-C
 Bulky syntax,Squared brackets,Memory
management
 No Generics,No enums,No operator overloading
 Dealloc won't be called automatically
 More Complex object sort
 Publishing an Apple app is a nightmare
 No Generics
Swift
 Father is Chris Latter(july 2010)
 Functional,Fast,Funny,Happy
 Variable name,Tuples, No pointers
 Function with multiple return values
 Apple Swift has clean syntax
Similarities to Objective-C
 Curly braces are used to group statements.
 A new identity operator, ===, is provided to check if two data
elements refer to the same object.
 Square brackets are used with arrays, both to declare them and
to get a value at a given index in one of them.
 Control statements are similar.
 Class methods are inherited, just like instance methods; self in
class methods is the class the method was called on.
Differences from Objective-C
 No semicolon, Header files, Exception
handling
 Strong typing,Type inference
 Fallthrough for switch case
Differences from Objective-C
 No semicolon, Header files, Exception
handling
 Strong typing,Type inference
 Fallthrough for switch case

More Related Content

What's hot (20)

Extensible Operators and Literals for JavaScript
Extensible Operators and Literals for JavaScriptExtensible Operators and Literals for JavaScript
Extensible Operators and Literals for JavaScript
Brendan Eich
Thinking in Functions
Thinking in FunctionsThinking in Functions
Thinking in Functions
Alexandru Bolboaca
Cilk - An Efficient Multithreaded Runtime System
Cilk - An Efficient Multithreaded Runtime SystemCilk - An Efficient Multithreaded Runtime System
Cilk - An Efficient Multithreaded Runtime System
Shareek Ahamed
Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Value Objects, Full Throttle (to be updated for spring TC39 meetings)Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Brendan Eich
Getting Swifty in an Objective-C World
Getting Swifty in an Objective-C WorldGetting Swifty in an Objective-C World
Getting Swifty in an Objective-C World
Jason Grandelli
D programming language
D programming languageD programming language
D programming language
Jordan Open Source Association
The D Programming Language - Why I love it!
The D Programming Language - Why I love it!The D Programming Language - Why I love it!
The D Programming Language - Why I love it!
ryutenchi
Objective c
Objective cObjective c
Objective c
Stijn
Dynamic in C# 4.0
Dynamic in C# 4.0Dynamic in C# 4.0
Dynamic in C# 4.0
morrisBahrami
Exploring C# DSLs: LINQ, Fluent Interfaces and Expression Trees
Exploring C# DSLs: LINQ, Fluent Interfaces and Expression TreesExploring C# DSLs: LINQ, Fluent Interfaces and Expression Trees
Exploring C# DSLs: LINQ, Fluent Interfaces and Expression Trees
rasmuskl
Programming Languages: some news for the last N years
Programming Languages: some news for the last N yearsProgramming Languages: some news for the last N years
Programming Languages: some news for the last N years
Ruslan Shevchenko
To Lombok or not to Lombok | J-Fall 2019
To Lombok or not to Lombok | J-Fall 2019To Lombok or not to Lombok | J-Fall 2019
To Lombok or not to Lombok | J-Fall 2019
Kaya Weers
Categories for the Working C++ Programmer
Categories for the Working C++ ProgrammerCategories for the Working C++ Programmer
Categories for the Working C++ Programmer
Platonov Sergey
Dynamic languages for .NET CLR
Dynamic languages for .NET CLRDynamic languages for .NET CLR
Dynamic languages for .NET CLR
py_sunil
Kotlin Crash Course
Kotlin Crash CourseKotlin Crash Course
Kotlin Crash Course
Haim Michael
Elixir + GraphQL = Absinthe 2019.04.10
Elixir + GraphQL = Absinthe 2019.04.10Elixir + GraphQL = Absinthe 2019.04.10
Elixir + GraphQL = Absinthe 2019.04.10
Alexander Knowles
Codemotion 2015 - Akka vol坦 sobre el nido del future
Codemotion 2015 - Akka vol坦 sobre el nido del futureCodemotion 2015 - Akka vol坦 sobre el nido del future
Codemotion 2015 - Akka vol坦 sobre el nido del future
scalerablog
Code for kombol - Objects and Functions in JS and NodeJS
Code for kombol - Objects and Functions in JS and NodeJSCode for kombol - Objects and Functions in JS and NodeJS
Code for kombol - Objects and Functions in JS and NodeJS
Riyadh Al Nur
Elliptic Curve Cryptography Message Exchange
Elliptic Curve Cryptography Message ExchangeElliptic Curve Cryptography Message Exchange
Elliptic Curve Cryptography Message Exchange
JacopoMariaValtorta
Serving models from AWS Lambda
Serving models from AWS LambdaServing models from AWS Lambda
Serving models from AWS Lambda
Alexey Grigorev
Extensible Operators and Literals for JavaScript
Extensible Operators and Literals for JavaScriptExtensible Operators and Literals for JavaScript
Extensible Operators and Literals for JavaScript
Brendan Eich
Cilk - An Efficient Multithreaded Runtime System
Cilk - An Efficient Multithreaded Runtime SystemCilk - An Efficient Multithreaded Runtime System
Cilk - An Efficient Multithreaded Runtime System
Shareek Ahamed
Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Value Objects, Full Throttle (to be updated for spring TC39 meetings)Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Brendan Eich
Getting Swifty in an Objective-C World
Getting Swifty in an Objective-C WorldGetting Swifty in an Objective-C World
Getting Swifty in an Objective-C World
Jason Grandelli
The D Programming Language - Why I love it!
The D Programming Language - Why I love it!The D Programming Language - Why I love it!
The D Programming Language - Why I love it!
ryutenchi
Objective c
Objective cObjective c
Objective c
Stijn
Dynamic in C# 4.0
Dynamic in C# 4.0Dynamic in C# 4.0
Dynamic in C# 4.0
morrisBahrami
Exploring C# DSLs: LINQ, Fluent Interfaces and Expression Trees
Exploring C# DSLs: LINQ, Fluent Interfaces and Expression TreesExploring C# DSLs: LINQ, Fluent Interfaces and Expression Trees
Exploring C# DSLs: LINQ, Fluent Interfaces and Expression Trees
rasmuskl
Programming Languages: some news for the last N years
Programming Languages: some news for the last N yearsProgramming Languages: some news for the last N years
Programming Languages: some news for the last N years
Ruslan Shevchenko
To Lombok or not to Lombok | J-Fall 2019
To Lombok or not to Lombok | J-Fall 2019To Lombok or not to Lombok | J-Fall 2019
To Lombok or not to Lombok | J-Fall 2019
Kaya Weers
Categories for the Working C++ Programmer
Categories for the Working C++ ProgrammerCategories for the Working C++ Programmer
Categories for the Working C++ Programmer
Platonov Sergey
Dynamic languages for .NET CLR
Dynamic languages for .NET CLRDynamic languages for .NET CLR
Dynamic languages for .NET CLR
py_sunil
Kotlin Crash Course
Kotlin Crash CourseKotlin Crash Course
Kotlin Crash Course
Haim Michael
Elixir + GraphQL = Absinthe 2019.04.10
Elixir + GraphQL = Absinthe 2019.04.10Elixir + GraphQL = Absinthe 2019.04.10
Elixir + GraphQL = Absinthe 2019.04.10
Alexander Knowles
Codemotion 2015 - Akka vol坦 sobre el nido del future
Codemotion 2015 - Akka vol坦 sobre el nido del futureCodemotion 2015 - Akka vol坦 sobre el nido del future
Codemotion 2015 - Akka vol坦 sobre el nido del future
scalerablog
Code for kombol - Objects and Functions in JS and NodeJS
Code for kombol - Objects and Functions in JS and NodeJSCode for kombol - Objects and Functions in JS and NodeJS
Code for kombol - Objects and Functions in JS and NodeJS
Riyadh Al Nur
Elliptic Curve Cryptography Message Exchange
Elliptic Curve Cryptography Message ExchangeElliptic Curve Cryptography Message Exchange
Elliptic Curve Cryptography Message Exchange
JacopoMariaValtorta
Serving models from AWS Lambda
Serving models from AWS LambdaServing models from AWS Lambda
Serving models from AWS Lambda
Alexey Grigorev

Similar to Objectivec vs swift (20)

Swift programming language
Swift programming languageSwift programming language
Swift programming language
Nijo Job
Ayush oops
Ayush oopsAyush oops
Ayush oops
Ayush Pandey
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
SadhanaParameswaran
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTREC & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
jatin batra
8844632.ppt
8844632.ppt8844632.ppt
8844632.ppt
SushmaG48
358 33 powerpoint-slides_1-introduction-c_chapter-1
358 33 powerpoint-slides_1-introduction-c_chapter-1358 33 powerpoint-slides_1-introduction-c_chapter-1
358 33 powerpoint-slides_1-introduction-c_chapter-1
sumitbardhan
OODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsOODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objects
Shanmuganathan C
1 puc programming using c++
1 puc programming using c++1 puc programming using c++
1 puc programming using c++
Prof. Dr. K. Adisesha
BSSML16 L10. Summary Day 2 Sessions
BSSML16 L10. Summary Day 2 SessionsBSSML16 L10. Summary Day 2 Sessions
BSSML16 L10. Summary Day 2 Sessions
BigML, Inc
App Trainers
App TrainersApp Trainers
App Trainers
Hani Abu Arab
Smalltalk, the dynamic language
Smalltalk, the dynamic languageSmalltalk, the dynamic language
Smalltalk, the dynamic language
mohamedsamyali
C-sharping.docx
C-sharping.docxC-sharping.docx
C-sharping.docx
LenchoMamudeBaro
Objc
ObjcObjc
Objc
Pragati Singh
VSSML17 Review. Summary Day 2 Sessions
VSSML17 Review. Summary Day 2 SessionsVSSML17 Review. Summary Day 2 Sessions
VSSML17 Review. Summary Day 2 Sessions
BigML, Inc
Object Oriented Programming using C++ - OOPS concepts using C++ programming l...
Object Oriented Programming using C++ - OOPS concepts using C++ programming l...Object Oriented Programming using C++ - OOPS concepts using C++ programming l...
Object Oriented Programming using C++ - OOPS concepts using C++ programming l...
PreethaV16
Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?
Micha Konarski
PL Lecture 01 - preliminaries
PL Lecture 01 - preliminariesPL Lecture 01 - preliminaries
PL Lecture 01 - preliminaries
Schwannden Kuo
C++ l 1
C++ l 1C++ l 1
C++ l 1
vineet_singh
Unit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxUnit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptx
shashiden1
c++session 1.pptx
c++session 1.pptxc++session 1.pptx
c++session 1.pptx
PadmaN24
Swift programming language
Swift programming languageSwift programming language
Swift programming language
Nijo Job
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTREC & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
jatin batra
8844632.ppt
8844632.ppt8844632.ppt
8844632.ppt
SushmaG48
358 33 powerpoint-slides_1-introduction-c_chapter-1
358 33 powerpoint-slides_1-introduction-c_chapter-1358 33 powerpoint-slides_1-introduction-c_chapter-1
358 33 powerpoint-slides_1-introduction-c_chapter-1
sumitbardhan
OODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsOODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objects
Shanmuganathan C
BSSML16 L10. Summary Day 2 Sessions
BSSML16 L10. Summary Day 2 SessionsBSSML16 L10. Summary Day 2 Sessions
BSSML16 L10. Summary Day 2 Sessions
BigML, Inc
Smalltalk, the dynamic language
Smalltalk, the dynamic languageSmalltalk, the dynamic language
Smalltalk, the dynamic language
mohamedsamyali
VSSML17 Review. Summary Day 2 Sessions
VSSML17 Review. Summary Day 2 SessionsVSSML17 Review. Summary Day 2 Sessions
VSSML17 Review. Summary Day 2 Sessions
BigML, Inc
Object Oriented Programming using C++ - OOPS concepts using C++ programming l...
Object Oriented Programming using C++ - OOPS concepts using C++ programming l...Object Oriented Programming using C++ - OOPS concepts using C++ programming l...
Object Oriented Programming using C++ - OOPS concepts using C++ programming l...
PreethaV16
Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?
Micha Konarski
PL Lecture 01 - preliminaries
PL Lecture 01 - preliminariesPL Lecture 01 - preliminaries
PL Lecture 01 - preliminaries
Schwannden Kuo
Unit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxUnit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptx
shashiden1
c++session 1.pptx
c++session 1.pptxc++session 1.pptx
c++session 1.pptx
PadmaN24

Objectivec vs swift

  • 2. Objective C Object-oriented programming language Developed in the early 1980s (NeXTSTEP) Files have .h and .mm file extensions, C header files Created primarily by Brad Cox Messages,Interface,Implementation,Instantiation 2014, Apple announced plans to replace Objective-C new Swift language
  • 3. Worst things about Objective-C Bulky syntax,Squared brackets,Memory management No Generics,No enums,No operator overloading Dealloc won't be called automatically More Complex object sort Publishing an Apple app is a nightmare No Generics
  • 4. Swift Father is Chris Latter(july 2010) Functional,Fast,Funny,Happy Variable name,Tuples, No pointers Function with multiple return values Apple Swift has clean syntax
  • 5. Similarities to Objective-C Curly braces are used to group statements. A new identity operator, ===, is provided to check if two data elements refer to the same object. Square brackets are used with arrays, both to declare them and to get a value at a given index in one of them. Control statements are similar. Class methods are inherited, just like instance methods; self in class methods is the class the method was called on.
  • 6. Differences from Objective-C No semicolon, Header files, Exception handling Strong typing,Type inference Fallthrough for switch case
  • 7. Differences from Objective-C No semicolon, Header files, Exception handling Strong typing,Type inference Fallthrough for switch case