SlideShare una empresa de Scribd logo
1 de 8
Descargar para leer sin conexión
INTRO TO SERVER SIDE DEVELOPMENT
Week Eight

Thursday, October 24, 13
Concept Review

Functions
Conditionals
Loops

Thursday, October 24, 13
Keywords
A keyword is a word or identifier that has a particular
meaning in a programming language
In many languages keywords are reserved words that
identify a syntactic form.They cannot be used as the
names of variables or functions.
Words used in control flow, like if/then/else are keywords.
Operators: + - == <= and or
Conditionals: if elseif else
Looping:

while do for foreach as

Functions: function return

Thursday, October 24, 13
Keyword Examples
/**
* Reduce any integer to an arbitrary number between 1 and 5
* @param integer $argument greater than 0
* @return integer between 1 and 5
*/
function reduce( $argument ) {
if ( $argument >= 0 and $argument < 5 )
return $argument + 1;
if ( $argument > 5 and $argument <= 10 )
return $argument - 5;
if ( $argument == 5 )
return $argument;
}

Thursday, October 24, 13

return reduce( (integer) $argument / 2 );
Rules of the Code Dojo
Pair Programming:
Pilot-Copilot
One person is the pilot and does the typing
One person is the copilot and tries to talk the solution out
Everyone else is passengers (quiet while flying!)

Timed for X minutes, then:
The pilot becomes a passenger, the copilot becomes the pilot, a
passenger becomes the new copilot

Repeat until the problem is solved, everyone has been pilot and
copilot, or we run out of time

Thursday, October 24, 13
Rules of the Dojo cont.
Test Driven Development:
Red-Green-Refactor
Red: the pilot cannot write any production code until there is at
least one failing test
Green: the pilot should only write production code that attempts
to satisfy the current failing tests, save and rerun frequently
Refactor: Once all tests are passing, look for opportunities to
simplify or improve readability before moving on

Don't talk while Red:
Only the pair can talk while the timer is running
Allow the pair time to figure out the next steps on their own

Thursday, October 24, 13
Dojo Assignment
Write a set of functions that all accept exactly two
parameters and provide the functionality of a basic
calculator: addition, subtraction, multiplication and
division. Use simple assertion tests to develop in a test
driven manner:
assert( 'add(1,1) == 2' );
assert( 'sub(4,2) == 2' );
Ensure that your test covers positive and negative
numbers for all operations and multiplication or division
by zero. The program should never produce a Fatal Error,
so handle error conditions internally

Thursday, October 24, 13
Retrospective

What did we do well that we should try to do again?
What did we do poorly that we should try to correct?
Did we achieve our goals and why or why not?

Thursday, October 24, 13

Más contenido relacionado

La actualidad más candente

Functional Programming in Python
Functional Programming in PythonFunctional Programming in Python
Functional Programming in PythonHaim Michael
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programmingMalikaJoya
 
Functions in c
Functions in cFunctions in c
Functions in creshmy12
 
Domain specific languages - progressive f sharp tutorials nyc 2012
Domain specific languages - progressive f sharp tutorials nyc 2012Domain specific languages - progressive f sharp tutorials nyc 2012
Domain specific languages - progressive f sharp tutorials nyc 2012Phillip Trelford
 
Refactoring 101
Refactoring 101Refactoring 101
Refactoring 101Adam Culp
 
Refactoring PHP
Refactoring PHPRefactoring PHP
Refactoring PHPAdam Culp
 
Programming Global variable
Programming Global variableProgramming Global variable
Programming Global variableimtiazalijoono
 
Internal domain-specific languages
Internal domain-specific languagesInternal domain-specific languages
Internal domain-specific languagesMikhail Barash
 
Basic structure of C++ program
Basic structure of C++ programBasic structure of C++ program
Basic structure of C++ programmatiur rahman
 
Functional Alchemy
Functional AlchemyFunctional Alchemy
Functional AlchemyMark Rendle
 
Algorithm and c language
Algorithm and c languageAlgorithm and c language
Algorithm and c languagekamalbeydoun
 

La actualidad más candente (19)

C++
C++C++
C++
 
A tutorial on C++ Programming
A tutorial on C++ ProgrammingA tutorial on C++ Programming
A tutorial on C++ Programming
 
C++ ppt
C++ pptC++ ppt
C++ ppt
 
Functional Programming in Python
Functional Programming in PythonFunctional Programming in Python
Functional Programming in Python
 
scope of python
scope of pythonscope of python
scope of python
 
Scope of variables
Scope of variablesScope of variables
Scope of variables
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
 
Python algorithm
Python algorithmPython algorithm
Python algorithm
 
Functions in c
Functions in cFunctions in c
Functions in c
 
Algorithm and psuedocode
Algorithm and psuedocodeAlgorithm and psuedocode
Algorithm and psuedocode
 
Domain specific languages - progressive f sharp tutorials nyc 2012
Domain specific languages - progressive f sharp tutorials nyc 2012Domain specific languages - progressive f sharp tutorials nyc 2012
Domain specific languages - progressive f sharp tutorials nyc 2012
 
Refactoring 101
Refactoring 101Refactoring 101
Refactoring 101
 
Refactoring PHP
Refactoring PHPRefactoring PHP
Refactoring PHP
 
Learn C
Learn CLearn C
Learn C
 
Programming Global variable
Programming Global variableProgramming Global variable
Programming Global variable
 
Internal domain-specific languages
Internal domain-specific languagesInternal domain-specific languages
Internal domain-specific languages
 
Basic structure of C++ program
Basic structure of C++ programBasic structure of C++ program
Basic structure of C++ program
 
Functional Alchemy
Functional AlchemyFunctional Alchemy
Functional Alchemy
 
Algorithm and c language
Algorithm and c languageAlgorithm and c language
Algorithm and c language
 

Destacado (9)

Dig1108 c lesson1
Dig1108 c lesson1Dig1108 c lesson1
Dig1108 c lesson1
 
DIG1108 Lesson 5
DIG1108 Lesson 5DIG1108 Lesson 5
DIG1108 Lesson 5
 
Spanish verbs friends
Spanish verbs friendsSpanish verbs friends
Spanish verbs friends
 
DIG1108 Lesson 4
DIG1108 Lesson 4DIG1108 Lesson 4
DIG1108 Lesson 4
 
DIG1108 Lesson 6
DIG1108 Lesson 6DIG1108 Lesson 6
DIG1108 Lesson 6
 
Dig1108 Lesson 3
Dig1108 Lesson 3Dig1108 Lesson 3
Dig1108 Lesson 3
 
Separata protoracionalismo
Separata protoracionalismoSeparata protoracionalismo
Separata protoracionalismo
 
Live virtual machine migration based on future prediction of resource require...
Live virtual machine migration based on future prediction of resource require...Live virtual machine migration based on future prediction of resource require...
Live virtual machine migration based on future prediction of resource require...
 
Dig1108C Lesson 2
Dig1108C Lesson 2Dig1108C Lesson 2
Dig1108C Lesson 2
 

Similar a DIG1108 Lesson 8

Building high productivity applications
Building high productivity applicationsBuilding high productivity applications
Building high productivity applicationsHutomo Sugianto
 
Testing practicies not only in scala
Testing practicies not only in scalaTesting practicies not only in scala
Testing practicies not only in scalaPaweł Panasewicz
 
Webinar: Whats New in Java 8 with Develop Intelligence
Webinar: Whats New in Java 8 with Develop IntelligenceWebinar: Whats New in Java 8 with Develop Intelligence
Webinar: Whats New in Java 8 with Develop IntelligenceAMD Developer Central
 
4. programing 101
4. programing 1014. programing 101
4. programing 101IEEE MIU SB
 
Agile development with Ruby
Agile development with RubyAgile development with Ruby
Agile development with Rubykhelll
 
Introduction to functional programming
Introduction to functional programmingIntroduction to functional programming
Introduction to functional programmingThang Mai
 
Software development slides
Software development slidesSoftware development slides
Software development slidesiarthur
 
Complete C++ programming Language Course
Complete C++ programming Language CourseComplete C++ programming Language Course
Complete C++ programming Language CourseVivek chan
 
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...jaxLondonConference
 
A Z Introduction To Ruby On Rails
A Z Introduction To Ruby On RailsA Z Introduction To Ruby On Rails
A Z Introduction To Ruby On Railsrailsconf
 
Continuous Security Testing
Continuous Security TestingContinuous Security Testing
Continuous Security TestingSteven Mak
 
As Level Computer Science Book -2
As Level Computer Science  Book -2As Level Computer Science  Book -2
As Level Computer Science Book -2DIGDARSHAN KUNWAR
 
Cs 568 Spring 10 Lecture 5 Estimation
Cs 568 Spring 10  Lecture 5 EstimationCs 568 Spring 10  Lecture 5 Estimation
Cs 568 Spring 10 Lecture 5 EstimationLawrence Bernstein
 

Similar a DIG1108 Lesson 8 (20)

DIG1108 Lesson 7
DIG1108 Lesson 7DIG1108 Lesson 7
DIG1108 Lesson 7
 
Dutch PHP Conference 2013: Distilled
Dutch PHP Conference 2013: DistilledDutch PHP Conference 2013: Distilled
Dutch PHP Conference 2013: Distilled
 
Building high productivity applications
Building high productivity applicationsBuilding high productivity applications
Building high productivity applications
 
Effective PHP. Part 5
Effective PHP. Part 5Effective PHP. Part 5
Effective PHP. Part 5
 
Testing practicies not only in scala
Testing practicies not only in scalaTesting practicies not only in scala
Testing practicies not only in scala
 
Web tech: lecture 5
Web tech: lecture 5Web tech: lecture 5
Web tech: lecture 5
 
Webinar: Whats New in Java 8 with Develop Intelligence
Webinar: Whats New in Java 8 with Develop IntelligenceWebinar: Whats New in Java 8 with Develop Intelligence
Webinar: Whats New in Java 8 with Develop Intelligence
 
4. programing 101
4. programing 1014. programing 101
4. programing 101
 
PHPUnit
PHPUnitPHPUnit
PHPUnit
 
Agile development with Ruby
Agile development with RubyAgile development with Ruby
Agile development with Ruby
 
Introduction to functional programming
Introduction to functional programmingIntroduction to functional programming
Introduction to functional programming
 
Software development slides
Software development slidesSoftware development slides
Software development slides
 
Complete C++ programming Language Course
Complete C++ programming Language CourseComplete C++ programming Language Course
Complete C++ programming Language Course
 
Verilog Tasks and functions
Verilog Tasks and functionsVerilog Tasks and functions
Verilog Tasks and functions
 
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
 
A Z Introduction To Ruby On Rails
A Z Introduction To Ruby On RailsA Z Introduction To Ruby On Rails
A Z Introduction To Ruby On Rails
 
A-Z Intro To Rails
A-Z Intro To RailsA-Z Intro To Rails
A-Z Intro To Rails
 
Continuous Security Testing
Continuous Security TestingContinuous Security Testing
Continuous Security Testing
 
As Level Computer Science Book -2
As Level Computer Science  Book -2As Level Computer Science  Book -2
As Level Computer Science Book -2
 
Cs 568 Spring 10 Lecture 5 Estimation
Cs 568 Spring 10  Lecture 5 EstimationCs 568 Spring 10  Lecture 5 Estimation
Cs 568 Spring 10 Lecture 5 Estimation
 

Último

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 

Último (20)

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 

DIG1108 Lesson 8

  • 1. INTRO TO SERVER SIDE DEVELOPMENT Week Eight Thursday, October 24, 13
  • 3. Keywords A keyword is a word or identifier that has a particular meaning in a programming language In many languages keywords are reserved words that identify a syntactic form.They cannot be used as the names of variables or functions. Words used in control flow, like if/then/else are keywords. Operators: + - == <= and or Conditionals: if elseif else Looping: while do for foreach as Functions: function return Thursday, October 24, 13
  • 4. Keyword Examples /** * Reduce any integer to an arbitrary number between 1 and 5 * @param integer $argument greater than 0 * @return integer between 1 and 5 */ function reduce( $argument ) { if ( $argument >= 0 and $argument < 5 ) return $argument + 1; if ( $argument > 5 and $argument <= 10 ) return $argument - 5; if ( $argument == 5 ) return $argument; } Thursday, October 24, 13 return reduce( (integer) $argument / 2 );
  • 5. Rules of the Code Dojo Pair Programming: Pilot-Copilot One person is the pilot and does the typing One person is the copilot and tries to talk the solution out Everyone else is passengers (quiet while flying!) Timed for X minutes, then: The pilot becomes a passenger, the copilot becomes the pilot, a passenger becomes the new copilot Repeat until the problem is solved, everyone has been pilot and copilot, or we run out of time Thursday, October 24, 13
  • 6. Rules of the Dojo cont. Test Driven Development: Red-Green-Refactor Red: the pilot cannot write any production code until there is at least one failing test Green: the pilot should only write production code that attempts to satisfy the current failing tests, save and rerun frequently Refactor: Once all tests are passing, look for opportunities to simplify or improve readability before moving on Don't talk while Red: Only the pair can talk while the timer is running Allow the pair time to figure out the next steps on their own Thursday, October 24, 13
  • 7. Dojo Assignment Write a set of functions that all accept exactly two parameters and provide the functionality of a basic calculator: addition, subtraction, multiplication and division. Use simple assertion tests to develop in a test driven manner: assert( 'add(1,1) == 2' ); assert( 'sub(4,2) == 2' ); Ensure that your test covers positive and negative numbers for all operations and multiplication or division by zero. The program should never produce a Fatal Error, so handle error conditions internally Thursday, October 24, 13
  • 8. Retrospective What did we do well that we should try to do again? What did we do poorly that we should try to correct? Did we achieve our goals and why or why not? Thursday, October 24, 13