SlideShare a Scribd company logo
1 of 18
The Practice of Programming -
Portability
Author : Juggernaut Liu
Date : 2014/04/18
Outline
• Introduction
• Language
• Headers and Libraries
• Program Organization
• Isolation
• Data Exchange
• Byte Order
• Portability and Upgrade
• Internationalization
Robert Venturi, Complexity and Contradiction in Architecture
Finally, standardization, like convention, can be another
manifestation of the strong order. But unlike convention it
has been accepted in Modern architecture as an enriching
product of our technology, yet dreaded for its potential
domination and brutality.
Introduction
Why do we worry about portability?
• Less maintenance and more utility
• Environments change
• A portable program is a better designed program
Language (1)
• Stick to the standard
• Program in the mainstream
• Sizes of data types
o sizeof (char) <= sizeof (short) <= sizeof (int) <= sizeof (long)
o sizeof (float) <= sizeof (double)
• Order of evaluation
o n = (getchar() <<8) | getchar()
Language (2)
• Signedness of char
Language (3)
• Alignment of structure and class members
o sizeof (struct X) bytes,
o not sizeof (char) + sizeof(int)
• Try several compilers
Headers and Libraries
• Use standard libraries
• Problems
o Headers tend to be cluttered
o Header files also can "pollute" the namespace by
declaring a function with the same name
• Solutions
o Use a different header for each compiler or environment
o Redefining the name
Program Organization
• Union vs Intersection
o Conditional compilation
o Include a header which defines all
• Suggestion
o Use only features available everywhere
o Avoid conditional compilation
Avoid conditional compilation(1)
VS
Avoid conditional compilation(2)
VS
Log4XXX can do it too.
Isolation
• Localize system dependencies in separate files
• Hide system dependencies behind interfaces
o Abstraction
o The I/O libraries are good samples
• Java is a good sample
Data Exchange
• Use Text for data exchange
Byte Order(1)
• Binary Data is more compact and faster
• little-endian vs big-endian
Byte Order(2)
• Use a fixed byte order for data exchange
• Sender and receiver agree on the byte order in
transmission
Portability and Upgrade
• Change the name if you change the specification
• Maintain compatibility with existing programs
and data
Internationalization
• Do not assume ASCII
o Unicode
o UTF-8
o Wide Characters (C/C++)
• Do not assume English
o L10N
o UI
Summary
• Portable code is an ideal that is well worth striving for, since
so much time is wasted making changes to move a program
from one system to another or to keep it running as it evolves
and the systems it runs on changes.
• The intersection approach is better than the union one.
o Loss of efficiency and features
o Z>B

More Related Content

What's hot

Allocation methods continuous method.47
Allocation methods continuous method.47 Allocation methods continuous method.47
Allocation methods continuous method.47 myrajendra
 
Presentation ASLIB 2014_Ghoula
Presentation ASLIB 2014_GhoulaPresentation ASLIB 2014_Ghoula
Presentation ASLIB 2014_GhoulaNizar Ghoula
 
STAT Requirement Analysis
STAT Requirement AnalysisSTAT Requirement Analysis
STAT Requirement Analysisstat
 
20 basic computer mcqs
20 basic computer mcqs20 basic computer mcqs
20 basic computer mcqsshah ali
 
Disk allocation methods
Disk allocation methodsDisk allocation methods
Disk allocation methodsajeela mushtaq
 
Microsoft power point chapter 5 file edited
Microsoft power point   chapter 5 file editedMicrosoft power point   chapter 5 file edited
Microsoft power point chapter 5 file editedLinga Lgs
 
Code Search Based on Deep Neural Network and Code Mutation
Code Search Based on Deep Neural Network and Code MutationCode Search Based on Deep Neural Network and Code Mutation
Code Search Based on Deep Neural Network and Code MutationNorihiro Yoshida
 
Linked Open Data: A simple how-to
Linked Open Data: A simple how-toLinked Open Data: A simple how-to
Linked Open Data: A simple how-tonvitucci
 
LDP-DL: A language to define the design of Linked Data Platforms
LDP-DL: A language to define the design of Linked Data PlatformsLDP-DL: A language to define the design of Linked Data Platforms
LDP-DL: A language to define the design of Linked Data PlatformsMohammad Noorani Bakerally
 
The eXtensible Catalog Drupal Toolkit
The eXtensible Catalog Drupal ToolkitThe eXtensible Catalog Drupal Toolkit
The eXtensible Catalog Drupal ToolkitPéter Király
 
File access methods.54
File access methods.54File access methods.54
File access methods.54myrajendra
 

What's hot (12)

Allocation methods continuous method.47
Allocation methods continuous method.47 Allocation methods continuous method.47
Allocation methods continuous method.47
 
Presentation ASLIB 2014_Ghoula
Presentation ASLIB 2014_GhoulaPresentation ASLIB 2014_Ghoula
Presentation ASLIB 2014_Ghoula
 
STAT Requirement Analysis
STAT Requirement AnalysisSTAT Requirement Analysis
STAT Requirement Analysis
 
20 basic computer mcqs
20 basic computer mcqs20 basic computer mcqs
20 basic computer mcqs
 
Disk allocation methods
Disk allocation methodsDisk allocation methods
Disk allocation methods
 
Microsoft power point chapter 5 file edited
Microsoft power point   chapter 5 file editedMicrosoft power point   chapter 5 file edited
Microsoft power point chapter 5 file edited
 
A few words about Search
A few words about SearchA few words about Search
A few words about Search
 
Code Search Based on Deep Neural Network and Code Mutation
Code Search Based on Deep Neural Network and Code MutationCode Search Based on Deep Neural Network and Code Mutation
Code Search Based on Deep Neural Network and Code Mutation
 
Linked Open Data: A simple how-to
Linked Open Data: A simple how-toLinked Open Data: A simple how-to
Linked Open Data: A simple how-to
 
LDP-DL: A language to define the design of Linked Data Platforms
LDP-DL: A language to define the design of Linked Data PlatformsLDP-DL: A language to define the design of Linked Data Platforms
LDP-DL: A language to define the design of Linked Data Platforms
 
The eXtensible Catalog Drupal Toolkit
The eXtensible Catalog Drupal ToolkitThe eXtensible Catalog Drupal Toolkit
The eXtensible Catalog Drupal Toolkit
 
File access methods.54
File access methods.54File access methods.54
File access methods.54
 

Viewers also liked

Unit test demo for calculatechinesenamenumber
Unit test demo for calculatechinesenamenumberUnit test demo for calculatechinesenamenumber
Unit test demo for calculatechinesenamenumberJuggernaut Liu
 
需求怎麼估 20150424新竹scrum社群分享
需求怎麼估 20150424新竹scrum社群分享需求怎麼估 20150424新竹scrum社群分享
需求怎麼估 20150424新竹scrum社群分享Juggernaut Liu
 
The Practice of Programming - Notation
The Practice of Programming - NotationThe Practice of Programming - Notation
The Practice of Programming - NotationJuggernaut Liu
 
快快樂樂打造自動化開發環境
快快樂樂打造自動化開發環境快快樂樂打造自動化開發環境
快快樂樂打造自動化開發環境Chen Cheng-Wei
 
別用KPI折磨團隊 - 敏捷團隊的績效評量
別用KPI折磨團隊 - 敏捷團隊的績效評量別用KPI折磨團隊 - 敏捷團隊的績效評量
別用KPI折磨團隊 - 敏捷團隊的績效評量Yves Lin
 
Scrum 路上的血與淚
Scrum 路上的血與淚Scrum 路上的血與淚
Scrum 路上的血與淚Yves Lin
 
ScrumMaster 的吃飯傢伙 – 引導出個夢幻團隊 Building a Dream Team with Facilitation
ScrumMaster 的吃飯傢伙 – 引導出個夢幻團隊 Building a Dream Team with FacilitationScrumMaster 的吃飯傢伙 – 引導出個夢幻團隊 Building a Dream Team with Facilitation
ScrumMaster 的吃飯傢伙 – 引導出個夢幻團隊 Building a Dream Team with FacilitationYves Lin
 
空手、緊握、到放手 – 敏捷路上學到的5件事
空手、緊握、到放手 – 敏捷路上學到的5件事 空手、緊握、到放手 – 敏捷路上學到的5件事
空手、緊握、到放手 – 敏捷路上學到的5件事 Yves Lin
 
提到 DevOps 到底在
談些什麼玩意兒?(@ Agile Tour Taichung 2017)
提到 DevOps 到底在
談些什麼玩意兒?(@ Agile Tour Taichung 2017)提到 DevOps 到底在
談些什麼玩意兒?(@ Agile Tour Taichung 2017)
提到 DevOps 到底在
談些什麼玩意兒?(@ Agile Tour Taichung 2017)Chen Cheng-Wei
 
Design Patterns這樣學就會了:入門班 Day1 教材
Design Patterns這樣學就會了:入門班 Day1 教材Design Patterns這樣學就會了:入門班 Day1 教材
Design Patterns這樣學就會了:入門班 Day1 教材teddysoft
 
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲ChinaNetCloud
 
ORID焦點討論法 - 白話入門篇
ORID焦點討論法 - 白話入門篇ORID焦點討論法 - 白話入門篇
ORID焦點討論法 - 白話入門篇Chuang Shu-Ting
 
從廢柴到成材 - 那 20 個 sprints 教會我們的事 C.C Agile #40
從廢柴到成材 - 那 20 個 sprints 教會我們的事 C.C Agile #40從廢柴到成材 - 那 20 個 sprints 教會我們的事 C.C Agile #40
從廢柴到成材 - 那 20 個 sprints 教會我們的事 C.C Agile #40diro fan
 

Viewers also liked (13)

Unit test demo for calculatechinesenamenumber
Unit test demo for calculatechinesenamenumberUnit test demo for calculatechinesenamenumber
Unit test demo for calculatechinesenamenumber
 
需求怎麼估 20150424新竹scrum社群分享
需求怎麼估 20150424新竹scrum社群分享需求怎麼估 20150424新竹scrum社群分享
需求怎麼估 20150424新竹scrum社群分享
 
The Practice of Programming - Notation
The Practice of Programming - NotationThe Practice of Programming - Notation
The Practice of Programming - Notation
 
快快樂樂打造自動化開發環境
快快樂樂打造自動化開發環境快快樂樂打造自動化開發環境
快快樂樂打造自動化開發環境
 
別用KPI折磨團隊 - 敏捷團隊的績效評量
別用KPI折磨團隊 - 敏捷團隊的績效評量別用KPI折磨團隊 - 敏捷團隊的績效評量
別用KPI折磨團隊 - 敏捷團隊的績效評量
 
Scrum 路上的血與淚
Scrum 路上的血與淚Scrum 路上的血與淚
Scrum 路上的血與淚
 
ScrumMaster 的吃飯傢伙 – 引導出個夢幻團隊 Building a Dream Team with Facilitation
ScrumMaster 的吃飯傢伙 – 引導出個夢幻團隊 Building a Dream Team with FacilitationScrumMaster 的吃飯傢伙 – 引導出個夢幻團隊 Building a Dream Team with Facilitation
ScrumMaster 的吃飯傢伙 – 引導出個夢幻團隊 Building a Dream Team with Facilitation
 
空手、緊握、到放手 – 敏捷路上學到的5件事
空手、緊握、到放手 – 敏捷路上學到的5件事 空手、緊握、到放手 – 敏捷路上學到的5件事
空手、緊握、到放手 – 敏捷路上學到的5件事
 
提到 DevOps 到底在
談些什麼玩意兒?(@ Agile Tour Taichung 2017)
提到 DevOps 到底在
談些什麼玩意兒?(@ Agile Tour Taichung 2017)提到 DevOps 到底在
談些什麼玩意兒?(@ Agile Tour Taichung 2017)
提到 DevOps 到底在
談些什麼玩意兒?(@ Agile Tour Taichung 2017)
 
Design Patterns這樣學就會了:入門班 Day1 教材
Design Patterns這樣學就會了:入門班 Day1 教材Design Patterns這樣學就會了:入門班 Day1 教材
Design Patterns這樣學就會了:入門班 Day1 教材
 
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
 
ORID焦點討論法 - 白話入門篇
ORID焦點討論法 - 白話入門篇ORID焦點討論法 - 白話入門篇
ORID焦點討論法 - 白話入門篇
 
從廢柴到成材 - 那 20 個 sprints 教會我們的事 C.C Agile #40
從廢柴到成材 - 那 20 個 sprints 教會我們的事 C.C Agile #40從廢柴到成材 - 那 20 個 sprints 教會我們的事 C.C Agile #40
從廢柴到成材 - 那 20 個 sprints 教會我們的事 C.C Agile #40
 

Similar to Portability

Open Source SQL Databases
Open Source SQL DatabasesOpen Source SQL Databases
Open Source SQL DatabasesEmanuel Calvo
 
Data Diffing Based Software Architecture Patterns
Data Diffing Based Software Architecture PatternsData Diffing Based Software Architecture Patterns
Data Diffing Based Software Architecture PatternsHuahai Yang
 
Data Serialization in Python JSON vs. Pickle
Data Serialization in Python JSON vs. PickleData Serialization in Python JSON vs. Pickle
Data Serialization in Python JSON vs. PickleInexture Solutions
 
Reading Notes : the practice of programming
Reading Notes : the practice of programmingReading Notes : the practice of programming
Reading Notes : the practice of programmingJuggernaut Liu
 
Realizing the promise of portable data processing with Apache Beam
Realizing the promise of portable data processing with Apache BeamRealizing the promise of portable data processing with Apache Beam
Realizing the promise of portable data processing with Apache BeamDataWorks Summit
 
ROS - an open-source Robot Operating System
ROS - an open-source Robot Operating SystemROS - an open-source Robot Operating System
ROS - an open-source Robot Operating Systemabirpahlwan
 
Portable Lucene Index Format & Applications - Andrzej Bialecki
Portable Lucene Index Format & Applications - Andrzej BialeckiPortable Lucene Index Format & Applications - Andrzej Bialecki
Portable Lucene Index Format & Applications - Andrzej Bialeckilucenerevolution
 
Linked Open Data Cloud
Linked Open Data CloudLinked Open Data Cloud
Linked Open Data CloudPretaLLOD
 
05 Lecture - PARALLEL Programming in C ++.pdf
05 Lecture - PARALLEL Programming in C ++.pdf05 Lecture - PARALLEL Programming in C ++.pdf
05 Lecture - PARALLEL Programming in C ++.pdfalivaisi1
 
Growing an ecosystem on the JVM
Growing an ecosystem on the JVMGrowing an ecosystem on the JVM
Growing an ecosystem on the JVMIulian Dragos
 
Unit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxUnit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxshashiden1
 
Distributed Logging Architecture in the Container Era
Distributed Logging Architecture in the Container EraDistributed Logging Architecture in the Container Era
Distributed Logging Architecture in the Container EraGlenn Davis
 
Distributed Logging Architecture in Container Era
Distributed Logging Architecture in Container EraDistributed Logging Architecture in Container Era
Distributed Logging Architecture in Container EraSATOSHI TAGOMORI
 
Big Data (NJ SQL Server User Group)
Big Data (NJ SQL Server User Group)Big Data (NJ SQL Server User Group)
Big Data (NJ SQL Server User Group)Don Demcsak
 
Source-to-source transformations: Supporting tools and infrastructure
Source-to-source transformations: Supporting tools and infrastructureSource-to-source transformations: Supporting tools and infrastructure
Source-to-source transformations: Supporting tools and infrastructurekaveirious
 
Introduction to OpenSees by Frank McKenna
Introduction to OpenSees by Frank McKennaIntroduction to OpenSees by Frank McKenna
Introduction to OpenSees by Frank McKennaopenseesdays
 
The Oxford Common File Layout
The Oxford Common File LayoutThe Oxford Common File Layout
The Oxford Common File LayoutStefano Cossu
 
Django in enterprise world
Django in enterprise worldDjango in enterprise world
Django in enterprise worldSimone Federici
 

Similar to Portability (20)

Open Source SQL Databases
Open Source SQL DatabasesOpen Source SQL Databases
Open Source SQL Databases
 
Data Diffing Based Software Architecture Patterns
Data Diffing Based Software Architecture PatternsData Diffing Based Software Architecture Patterns
Data Diffing Based Software Architecture Patterns
 
Protobuff and gRPC
Protobuff and gRPCProtobuff and gRPC
Protobuff and gRPC
 
2018 12-kube con-ballerinacon
2018 12-kube con-ballerinacon2018 12-kube con-ballerinacon
2018 12-kube con-ballerinacon
 
Data Serialization in Python JSON vs. Pickle
Data Serialization in Python JSON vs. PickleData Serialization in Python JSON vs. Pickle
Data Serialization in Python JSON vs. Pickle
 
Reading Notes : the practice of programming
Reading Notes : the practice of programmingReading Notes : the practice of programming
Reading Notes : the practice of programming
 
Realizing the promise of portable data processing with Apache Beam
Realizing the promise of portable data processing with Apache BeamRealizing the promise of portable data processing with Apache Beam
Realizing the promise of portable data processing with Apache Beam
 
ROS - an open-source Robot Operating System
ROS - an open-source Robot Operating SystemROS - an open-source Robot Operating System
ROS - an open-source Robot Operating System
 
Portable Lucene Index Format & Applications - Andrzej Bialecki
Portable Lucene Index Format & Applications - Andrzej BialeckiPortable Lucene Index Format & Applications - Andrzej Bialecki
Portable Lucene Index Format & Applications - Andrzej Bialecki
 
Linked Open Data Cloud
Linked Open Data CloudLinked Open Data Cloud
Linked Open Data Cloud
 
05 Lecture - PARALLEL Programming in C ++.pdf
05 Lecture - PARALLEL Programming in C ++.pdf05 Lecture - PARALLEL Programming in C ++.pdf
05 Lecture - PARALLEL Programming in C ++.pdf
 
Growing an ecosystem on the JVM
Growing an ecosystem on the JVMGrowing an ecosystem on the JVM
Growing an ecosystem on the JVM
 
Unit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxUnit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptx
 
Distributed Logging Architecture in the Container Era
Distributed Logging Architecture in the Container EraDistributed Logging Architecture in the Container Era
Distributed Logging Architecture in the Container Era
 
Distributed Logging Architecture in Container Era
Distributed Logging Architecture in Container EraDistributed Logging Architecture in Container Era
Distributed Logging Architecture in Container Era
 
Big Data (NJ SQL Server User Group)
Big Data (NJ SQL Server User Group)Big Data (NJ SQL Server User Group)
Big Data (NJ SQL Server User Group)
 
Source-to-source transformations: Supporting tools and infrastructure
Source-to-source transformations: Supporting tools and infrastructureSource-to-source transformations: Supporting tools and infrastructure
Source-to-source transformations: Supporting tools and infrastructure
 
Introduction to OpenSees by Frank McKenna
Introduction to OpenSees by Frank McKennaIntroduction to OpenSees by Frank McKenna
Introduction to OpenSees by Frank McKenna
 
The Oxford Common File Layout
The Oxford Common File LayoutThe Oxford Common File Layout
The Oxford Common File Layout
 
Django in enterprise world
Django in enterprise worldDjango in enterprise world
Django in enterprise world
 

More from Juggernaut Liu

2020 MOPCON - How to be Agile
2020 MOPCON - How to be Agile2020 MOPCON - How to be Agile
2020 MOPCON - How to be AgileJuggernaut Liu
 
Design Sprint Case in Trend Micro
Design Sprint Case in Trend MicroDesign Sprint Case in Trend Micro
Design Sprint Case in Trend MicroJuggernaut Liu
 
趨勢科技案例分享 - 與專家一起共舞 Design Sprint
趨勢科技案例分享 - 與專家一起共舞 Design Sprint趨勢科技案例分享 - 與專家一起共舞 Design Sprint
趨勢科技案例分享 - 與專家一起共舞 Design SprintJuggernaut Liu
 
RPG Retrospective Workshop in AgileTour Hsinchu 2018
RPG Retrospective Workshop in AgileTour Hsinchu 2018RPG Retrospective Workshop in AgileTour Hsinchu 2018
RPG Retrospective Workshop in AgileTour Hsinchu 2018Juggernaut Liu
 
Scrum drawing game in agile summit 2018
Scrum drawing game in agile summit 2018Scrum drawing game in agile summit 2018
Scrum drawing game in agile summit 2018Juggernaut Liu
 
A dev ops team's practice in trend micro in agile summit 2018
A dev ops team's practice in trend micro in agile summit 2018A dev ops team's practice in trend micro in agile summit 2018
A dev ops team's practice in trend micro in agile summit 2018Juggernaut Liu
 
Scrum Drawing Game 2.0 for Agile Tour 2017
Scrum Drawing Game 2.0 for Agile Tour 2017Scrum Drawing Game 2.0 for Agile Tour 2017
Scrum Drawing Game 2.0 for Agile Tour 2017Juggernaut Liu
 
Scrum Drawing Game for Scrum Gathering Tokyo
Scrum Drawing Game for Scrum Gathering TokyoScrum Drawing Game for Scrum Gathering Tokyo
Scrum Drawing Game for Scrum Gathering TokyoJuggernaut Liu
 
Adapt or Die_devopsdaystaipei_2017
Adapt or Die_devopsdaystaipei_2017Adapt or Die_devopsdaystaipei_2017
Adapt or Die_devopsdaystaipei_2017Juggernaut Liu
 
在瀑布底下玩Scrum
在瀑布底下玩Scrum在瀑布底下玩Scrum
在瀑布底下玩ScrumJuggernaut Liu
 
Jug EIE Menu presentation
Jug EIE Menu presentationJug EIE Menu presentation
Jug EIE Menu presentationJuggernaut Liu
 
Photos in SLC by Juggernaut Liu
Photos in SLC by Juggernaut LiuPhotos in SLC by Juggernaut Liu
Photos in SLC by Juggernaut LiuJuggernaut Liu
 

More from Juggernaut Liu (14)

2020 MOPCON - How to be Agile
2020 MOPCON - How to be Agile2020 MOPCON - How to be Agile
2020 MOPCON - How to be Agile
 
Design Sprint Case in Trend Micro
Design Sprint Case in Trend MicroDesign Sprint Case in Trend Micro
Design Sprint Case in Trend Micro
 
趨勢科技案例分享 - 與專家一起共舞 Design Sprint
趨勢科技案例分享 - 與專家一起共舞 Design Sprint趨勢科技案例分享 - 與專家一起共舞 Design Sprint
趨勢科技案例分享 - 與專家一起共舞 Design Sprint
 
RPG Retrospective Workshop in AgileTour Hsinchu 2018
RPG Retrospective Workshop in AgileTour Hsinchu 2018RPG Retrospective Workshop in AgileTour Hsinchu 2018
RPG Retrospective Workshop in AgileTour Hsinchu 2018
 
Scrum drawing game in agile summit 2018
Scrum drawing game in agile summit 2018Scrum drawing game in agile summit 2018
Scrum drawing game in agile summit 2018
 
A dev ops team's practice in trend micro in agile summit 2018
A dev ops team's practice in trend micro in agile summit 2018A dev ops team's practice in trend micro in agile summit 2018
A dev ops team's practice in trend micro in agile summit 2018
 
Scrum Drawing Game 2.0 for Agile Tour 2017
Scrum Drawing Game 2.0 for Agile Tour 2017Scrum Drawing Game 2.0 for Agile Tour 2017
Scrum Drawing Game 2.0 for Agile Tour 2017
 
Scrum Drawing Game for Scrum Gathering Tokyo
Scrum Drawing Game for Scrum Gathering TokyoScrum Drawing Game for Scrum Gathering Tokyo
Scrum Drawing Game for Scrum Gathering Tokyo
 
Adapt or Die_devopsdaystaipei_2017
Adapt or Die_devopsdaystaipei_2017Adapt or Die_devopsdaystaipei_2017
Adapt or Die_devopsdaystaipei_2017
 
Null object pattern
Null object patternNull object pattern
Null object pattern
 
在瀑布底下玩Scrum
在瀑布底下玩Scrum在瀑布底下玩Scrum
在瀑布底下玩Scrum
 
Jug EIE Menu presentation
Jug EIE Menu presentationJug EIE Menu presentation
Jug EIE Menu presentation
 
Think on your feet
Think on your feetThink on your feet
Think on your feet
 
Photos in SLC by Juggernaut Liu
Photos in SLC by Juggernaut LiuPhotos in SLC by Juggernaut Liu
Photos in SLC by Juggernaut Liu
 

Recently uploaded

MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 

Recently uploaded (20)

MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 

Portability

  • 1. The Practice of Programming - Portability Author : Juggernaut Liu Date : 2014/04/18
  • 2. Outline • Introduction • Language • Headers and Libraries • Program Organization • Isolation • Data Exchange • Byte Order • Portability and Upgrade • Internationalization
  • 3. Robert Venturi, Complexity and Contradiction in Architecture Finally, standardization, like convention, can be another manifestation of the strong order. But unlike convention it has been accepted in Modern architecture as an enriching product of our technology, yet dreaded for its potential domination and brutality.
  • 4. Introduction Why do we worry about portability? • Less maintenance and more utility • Environments change • A portable program is a better designed program
  • 5. Language (1) • Stick to the standard • Program in the mainstream • Sizes of data types o sizeof (char) <= sizeof (short) <= sizeof (int) <= sizeof (long) o sizeof (float) <= sizeof (double) • Order of evaluation o n = (getchar() <<8) | getchar()
  • 7. Language (3) • Alignment of structure and class members o sizeof (struct X) bytes, o not sizeof (char) + sizeof(int) • Try several compilers
  • 8. Headers and Libraries • Use standard libraries • Problems o Headers tend to be cluttered o Header files also can "pollute" the namespace by declaring a function with the same name • Solutions o Use a different header for each compiler or environment o Redefining the name
  • 9. Program Organization • Union vs Intersection o Conditional compilation o Include a header which defines all • Suggestion o Use only features available everywhere o Avoid conditional compilation
  • 12. Isolation • Localize system dependencies in separate files • Hide system dependencies behind interfaces o Abstraction o The I/O libraries are good samples • Java is a good sample
  • 13. Data Exchange • Use Text for data exchange
  • 14. Byte Order(1) • Binary Data is more compact and faster • little-endian vs big-endian
  • 15. Byte Order(2) • Use a fixed byte order for data exchange • Sender and receiver agree on the byte order in transmission
  • 16. Portability and Upgrade • Change the name if you change the specification • Maintain compatibility with existing programs and data
  • 17. Internationalization • Do not assume ASCII o Unicode o UTF-8 o Wide Characters (C/C++) • Do not assume English o L10N o UI
  • 18. Summary • Portable code is an ideal that is well worth striving for, since so much time is wasted making changes to move a program from one system to another or to keep it running as it evolves and the systems it runs on changes. • The intersection approach is better than the union one. o Loss of efficiency and features o Z>B