Top Banner
DIFERENCIAS Y FUTURO SWIFT Y OBJECTIVE-C
26

Mobile Day - Swift y Objective-C

Apr 12, 2017

Download

Software

Software Guru
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Mobile Day - Swift y Objective-C

DIFERENCIAS Y FUTURO

SWIFT Y OBJECTIVE-C

Page 2: Mobile Day - Swift y Objective-C

— Un programador

¡OBJECTIVE-C ESTÁ MUERTO!

Page 3: Mobile Day - Swift y Objective-C

— El mismo programador

¡LARGA VIDA A SWIFT!

Page 4: Mobile Day - Swift y Objective-C

— Otro programador

LA PROGRAMACIÓN ORIENTADA A OBJETOS FUE

UN ERROR.

Page 5: Mobile Day - Swift y Objective-C

— El mismo programador

LA PROGRAMACIÓN FUNCIONAL ES MEJOR QUE LA ORIENTADA A OBJETOS.

Page 6: Mobile Day - Swift y Objective-C

— Apple

¡LA PROGRAMACIÓN ORIENTADA A PROTOCOLOS

VA A CAMBIAR TODO!

Page 7: Mobile Day - Swift y Objective-C

— Apple

EVITEN USAR CLASES, HERENCIA Y VALORES POR

REFERENCIAS

Page 8: Mobile Day - Swift y Objective-C

¿ES CORRECTO ESTO?

Page 9: Mobile Day - Swift y Objective-C

SWIFT VS OBJECTIVE-C

Page 10: Mobile Day - Swift y Objective-C

INMUTABILIDAD VS MUTABILIDAD

TIPOS POR VALOR VS TIPOS POR REFERENCIA

PROTOCOLS VS HERENCIA

DECLARATIVA VS IMPERATIVA

DINÁMICO VS ESTÁTICO

FUNCIONAL VS ORIENTADA A OBJETOS

Page 11: Mobile Day - Swift y Objective-C

MUTABILIDAD VS INMUTABILIDAD

Objective-C Swift

Mutabilidad Casi Todo :-) (mutableCopy) var

InmutabilidadTipos primitivos/NSArray/NSDictionary/NSString/

NSSet/constset

Page 12: Mobile Day - Swift y Objective-C

TIPOS POR VALOR VS POR REFERENCIA

Objective-C Swift

Por Referencia Casi Todo (Defensive Copying) Clases

Por Valor Tipos primitivos struct/enum/array/string/tuple/dictionary

Page 13: Mobile Day - Swift y Objective-C

Pase por Referencia

Pase por Valor

Mutable Peligro Seguro

Inmutable Seguro NA

TIPOS POR VALOR VS POR REFERENCIACONCURRENCIA

Page 14: Mobile Day - Swift y Objective-C

PROTOCOLOS VS HERENCIA

Objective-C Swift

Protocolos Si (común: Delegation Pattern) Si (Lo recomendado)

Herencia Si Si (Sólo cuando interactúa con Cocoa)

Page 15: Mobile Day - Swift y Objective-C

DECLARATIVA VS IMPERATIVA

Objective-C Swift

DeclarativaEs común en colecciones (filteredArrayUsingPredic

ate)Si

Imperativa Si Si

Page 16: Mobile Day - Swift y Objective-C

DINÁMICO VS ESTÁTICO

Objective-C Swift

Dinámico Envío de mensajes Si (aunque más parecido a C++)

Estático Si (Hack) final/private

Page 17: Mobile Day - Swift y Objective-C

DEFINICIÓN

• Funciones que a misma entrada, misma salida

• No efectos colaterales

• Funciones son un tipo de dato

• Funciones pueden recibir y devolver otras funciones

FUNCIONAL VS OOP

Page 18: Mobile Day - Swift y Objective-C

FUNCIONAL VS OOP

Objective-C Swift

Funcional Si Si

OOP Si Si

Page 19: Mobile Day - Swift y Objective-C

OPEN SOURCE

Page 20: Mobile Day - Swift y Objective-C

WEB FRAMEWORK

Page 21: Mobile Day - Swift y Objective-C
Page 22: Mobile Day - Swift y Objective-C

SWIFT

CONCLUSIONES

• Swift es un lenguaje de programación híbrido, al igual que Objective-C

• Riesgo de mezclar/no usar correctamente ningún paradigma

• No importa si es Objetive-C o Swift, lo importante es utilizar los conceptos de inmutabilidad, no efectos colaterales, encapsulamiento y composición.

• Swift es mas complejo que Objective-C

• La sintaxis de Swift es mas familiar y por eso gana sobre Objective-C

• Swift está incorporando elementos dinámicos (hay esperanza)

Page 23: Mobile Day - Swift y Objective-C

PRONÓSTICO

CONCLUSIONES

• Swift va a ser el siguiente Java (por uso)

• Swift va a ser el lenguaje predominante para hacer aplicaciones para Android y iOS

• Swift también va a ser usado para creación de servicios (aunque probablemente no el principal)

• Swift va a ser el lenguaje que se enseñe en las escuelas (para bien o para mal)

• Esperen ver certificaciones en Swift ;-)

Page 24: Mobile Day - Swift y Objective-C

FINALES

CONCLUSIONES

“The crisis of 1995 shows that we took our existing procedural code, observed these benefits of OOP, then carried on writing procedural code while calling it OOP. That, unsurprisingly, isn’t working, and I wouldn’t be surprised if people blame it on OOP with its mutable values, side-effecting functions, and imperative code.”

Graham

Page 25: Mobile Day - Swift y Objective-C

FINALES

CONCLUSIONES

“We’ll look to the benefits some other paradigm, maybe those of functional programming (which are, after all, the same as the benefits of OOP), and declare how it’s the silver bullet just as Brad Cox did. Then we’ll add procedural features to functional programming languages, or the other way around, to reduce the “learning curve” and make the new paradigm accessible. Then we’ll all carry on writing C programs, calling them the new paradigm. Then that won’t work, and we’ll declare functional programming (or whatever comes next) as much of a failure as object-oriented programming. As we will with whatever comes after that.”

Graham

Page 26: Mobile Day - Swift y Objective-C

LINKS

REFERENCIAS

• http://www.sicpers.info/2015/05/object-oriented-programming-in-objective-c/Reusability

• https://www.destroyallsoftware.com/talks/boundaries

• https://developer.apple.com/videos/play/wwdc2015/226/

• https://developer.apple.com/videos/play/wwdc2015/414/

• https://developer.apple.com/videos/play/wwdc2015/408/