SlideShare a Scribd company logo
1 of 34
Download to read offline
Introduction to
 Programming
  “How to win friends
and influence computers”
A Brief History of Computers
 General purpose minions
   Orders


 Human calculators
 Mechanical calculators
 Electronic calculators

 General purpose machines
   Programs
What Is Programming
Programming is just telling a computer to do
  something,

                      BUT
Computers know very little and have no common
  sense what-so-ever, so your instructions have to
  be broken down to small, simple parts,

                     AND
Computers will do exactly what you tell them.
Basic Programming
Programming at it’s core is about two things:
  defining problems, and solving problems.

These two aspects are tightly integrated
• To solve a problem you first must clearly know
  what it is
• Clearly and completely defining a problem
  gets you a long ways towards a solution
Four Tools To Get Started
Just getting started is often the hardest part of
  the project. Before diving in to the code, do
  the design document. Four tools to help are
  –Action/Event List
  –Flow Chart
  –Data Model
  –Iterative Refinement
Action List
This is a good tool to use in applications that have
  user interaction.
Write down each action the user can take.
Add a bit of detail info to each action
• Circumstances in which the user may take the
  action (1-3 sentences, and/or list)
• What happens when they do the action (1-3
  sentences)
• What other actions this one allows and denies
  (list format)
Flow Charts
Flow charts are a very useful tool to clarify and
  define programming problems
• They delineate key points in your program
• They’re especially good for state-based
  programs, such as web applications

Don’t get too bogged down in details when
 creating a flow chart – stay high level
Data Model
A data model is a detailed description of the
  information that the application will
  manipulate.

Start with a general idea/concept, then break it
  down into smaller parts, and repeat.

Aim for having each part be a string, a number,
  or a list or collection thereof.
Iterative Refinement - the Ur-Program
The process of iterative refinement

2. Say what you want the computer to do

3. If it’s all in terms the computer will understand,
   then stop, you’re done

4. Otherwise, break each part into simpler steps

5. Go to step 2

NOTE: works for small children as well as computers
The Real World
These are important concepts, and when done right
   you end up documenting your code as you go.

                    HOWEVER…
Real-world programming often doesn’t explicitly
   involve these techniques except at high levels in the
   design document. You should definitely use them
   there, and for actual coding keep them in mind as
   fallback strategies if your stuck on a problem.
What Computers Can Do Well
What Computers Can Do Well
Doing the same things over and over
Remembering things
Mathematics, ‘regular’ and true / false
Changing actions based on conditions
Taking in information
Sending out information
What Computers Can Do Well
Doing the same things over and and Subroutines
                        Loops over
Remembering things Variables and Assignment
Mathematics, ‘regular’ and true / falseOperators
Statements
Changing actions based on conditions
                                  Conditionals


and Blocks
Taking in information
Sending out information
                                          Input
                                        Output
Statements, and Blocks
A statement is a basic instruction for the computer

Statements are executed in order, from first to last

One or more statements may be grouped together
 into a block

A block is marked by curly braces
   { and }
Loops
A loop is a special kind of statement that tells a computer
   to repeat a given set of instructions

A for-loop repeats a given number of times
   e.g. say “hi” five times:
   for (1..5) { say “hi” }

A while-loop repeats as long as a certain condition is true
   e.g. go somewhere :
   while (not arrived) { take step }
Subroutines
A subroutine, function or procedure is a block of statements
   that’s been given a name and which is executed when ever
   that name is used. Essentially, it’s a miniature sub-program
   that you can use in your larger program.

Once a function finishes, the execution returns to the place
  from which it was called.

Functions can take parameters, or arguments, which allow
  values to be sent into the block of code

Functions can return values.
Variables
A variable has a name, or identifier, and may have a
  value associated.
Associate a given value with a given variable by making
  an assignment.
Variables can be declared, which creates them without
  any value. Some languages require this.
Variable Names
MUST:
Start with a letter
Contain letters or numbers or underscores

SHOULD:
Be meaningful (often 10+ characters)
Be readable (use _ or mixCase to mark words)
Follow convention (start lower case, i, x, y)
Basic Values
Literal values:
   Numbers
       0, -3, 8.223419783
   Strings (a series of characters)
       “zero”, ”0”, “cheddar cheese”
Expressions:
   One or more values, expressions, or variables combined by operators
                              8.3 * 4.291
                                    2
                        “smoked” . “ “ . “cheddar”
   A variable used in a expression is replaced by its value
                            ingredient_count + 3
Operators
There are all the standard math operators
   + - * / % ()

The string concatenation operator combines two or more strings into
  one
   Depends on the language (often . or +)

There are many other operators too
   Boolean math
   Comparisons
   Specialized

Operators combine values and expressions into larger expressions
Conditionals
A conditional, or branch, statement executes a
  block of other statements based on whether a
  given condition is true or false

Conditions are evaluated using boolean
  operators, as well as comparisons and other
  things that are true or false
General Conditional Statement
if (condition)
   Block executed if condition is true
else if (other condition)
   Block executed if other condition is true
else
   Block executed if all conditions are false
Input and Output
Special statements get data into and out of a
  program.
  Details vary by language


Data can come from:
  keyboard, web page, mouse, file, other


Data can go to:
  screen, file, the internet, other
Comments
Comments are a way to put text in the program
  code which does not get executed. This is very
  useful for leaving notes / descriptions /
  explanations, and for testing.
Comments are usually denoted by
  # or // to comment to the end of the line
  /* to comment out multiple lines
     */
Best Practices
Always make backups of original working code before
  messing with it
Use comments to mark what you change, how, and
  when, and to keep copies of original statements
Test early, test often
Work together – more eyes means fewer bugs
Read the manual – there are great references online
Look at examples
mr.islamelhosary@gmail.com

More Related Content

What's hot

Algorithm - Introduction
Algorithm - IntroductionAlgorithm - Introduction
Algorithm - IntroductionMadhu Bala
 
Problem solving using Computer
Problem solving using ComputerProblem solving using Computer
Problem solving using ComputerDavid Livingston J
 
Jeremiah Yancy - Objectives for Software design and testing
Jeremiah Yancy - Objectives for Software design and testingJeremiah Yancy - Objectives for Software design and testing
Jeremiah Yancy - Objectives for Software design and testingJeremiah Yancy
 
FIT-Unit3 chapter 1 -computer program
FIT-Unit3 chapter 1 -computer programFIT-Unit3 chapter 1 -computer program
FIT-Unit3 chapter 1 -computer programraksharao
 
AVB201.2 Microsoft Access VBA Module 2
AVB201.2 Microsoft Access VBA Module 2AVB201.2 Microsoft Access VBA Module 2
AVB201.2 Microsoft Access VBA Module 2Dan D'Urso
 
Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2Raja Hamid
 
problem solving and design By ZAK
problem solving and design By ZAKproblem solving and design By ZAK
problem solving and design By ZAKTabsheer Hasan
 
AVB201.1 MS Access VBA Module 1
AVB201.1 MS Access VBA Module 1AVB201.1 MS Access VBA Module 1
AVB201.1 MS Access VBA Module 1guest38bf
 
Error Correction Techniques
Error Correction TechniquesError Correction Techniques
Error Correction TechniquesKelly Bauer
 
2.3 Apply the different types of algorithm to solve problem
2.3 Apply the different types of algorithm to solve problem2.3 Apply the different types of algorithm to solve problem
2.3 Apply the different types of algorithm to solve problemFrankie Jones
 
Program design and problem solving techniques
Program design and problem solving techniquesProgram design and problem solving techniques
Program design and problem solving techniquesDokka Srinivasu
 
Csc 130 class 2 problem analysis and flow charts(2)
Csc 130 class 2   problem analysis and flow charts(2)Csc 130 class 2   problem analysis and flow charts(2)
Csc 130 class 2 problem analysis and flow charts(2)Puneet narula
 

What's hot (20)

Algorithm - Introduction
Algorithm - IntroductionAlgorithm - Introduction
Algorithm - Introduction
 
Problem solving using Computer
Problem solving using ComputerProblem solving using Computer
Problem solving using Computer
 
Pseudocode
PseudocodePseudocode
Pseudocode
 
Jeremiah Yancy - Objectives for Software design and testing
Jeremiah Yancy - Objectives for Software design and testingJeremiah Yancy - Objectives for Software design and testing
Jeremiah Yancy - Objectives for Software design and testing
 
Pseudo code
Pseudo codePseudo code
Pseudo code
 
FIT-Unit3 chapter 1 -computer program
FIT-Unit3 chapter 1 -computer programFIT-Unit3 chapter 1 -computer program
FIT-Unit3 chapter 1 -computer program
 
AVB201.2 Microsoft Access VBA Module 2
AVB201.2 Microsoft Access VBA Module 2AVB201.2 Microsoft Access VBA Module 2
AVB201.2 Microsoft Access VBA Module 2
 
Visual Logic Project - 1
Visual Logic Project - 1Visual Logic Project - 1
Visual Logic Project - 1
 
Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2
 
Introduction to problem solving in C
Introduction to problem solving in CIntroduction to problem solving in C
Introduction to problem solving in C
 
problem solving and design By ZAK
problem solving and design By ZAKproblem solving and design By ZAK
problem solving and design By ZAK
 
AVB201.1 MS Access VBA Module 1
AVB201.1 MS Access VBA Module 1AVB201.1 MS Access VBA Module 1
AVB201.1 MS Access VBA Module 1
 
The Programming Process
The Programming ProcessThe Programming Process
The Programming Process
 
Error Correction Techniques
Error Correction TechniquesError Correction Techniques
Error Correction Techniques
 
2.3 Apply the different types of algorithm to solve problem
2.3 Apply the different types of algorithm to solve problem2.3 Apply the different types of algorithm to solve problem
2.3 Apply the different types of algorithm to solve problem
 
Program design and problem solving techniques
Program design and problem solving techniquesProgram design and problem solving techniques
Program design and problem solving techniques
 
Flowcharting and Algorithm
Flowcharting and Algorithm Flowcharting and Algorithm
Flowcharting and Algorithm
 
Csc 130 class 2 problem analysis and flow charts(2)
Csc 130 class 2   problem analysis and flow charts(2)Csc 130 class 2   problem analysis and flow charts(2)
Csc 130 class 2 problem analysis and flow charts(2)
 
Visual Logic User Guide
Visual Logic User GuideVisual Logic User Guide
Visual Logic User Guide
 
Ppt lesson 06
Ppt lesson 06Ppt lesson 06
Ppt lesson 06
 

Viewers also liked

Branding In a Troubled Economy
Branding In a Troubled EconomyBranding In a Troubled Economy
Branding In a Troubled Economyguest1929d4
 
2010 Multi Media Marketing Proposal Hfmus No Pricing
2010 Multi Media Marketing Proposal Hfmus No Pricing2010 Multi Media Marketing Proposal Hfmus No Pricing
2010 Multi Media Marketing Proposal Hfmus No PricingMike Zarcone
 
Who is Generation Z
Who is Generation ZWho is Generation Z
Who is Generation ZSimone Pratt
 
Customer acquisition and retention project on virgin mobile
Customer acquisition and retention project on virgin mobileCustomer acquisition and retention project on virgin mobile
Customer acquisition and retention project on virgin mobileProjects Kart
 
Garis panduanppg
Garis panduanppgGaris panduanppg
Garis panduanppgZulnas Mpmk
 
A study on progress and investors perception towerds dematerialization of sha...
A study on progress and investors perception towerds dematerialization of sha...A study on progress and investors perception towerds dematerialization of sha...
A study on progress and investors perception towerds dematerialization of sha...Projects Kart
 
Alvin Ailey Presentation for Kids (PreK)
Alvin Ailey Presentation for Kids (PreK)Alvin Ailey Presentation for Kids (PreK)
Alvin Ailey Presentation for Kids (PreK)Simone Pratt
 
Who are Millennials
Who are MillennialsWho are Millennials
Who are MillennialsSimone Pratt
 
Mutual funds is the better investments plan
Mutual funds is the better investments planMutual funds is the better investments plan
Mutual funds is the better investments planProjects Kart
 
Project on customer satisfaction with special reference to mahindra bolero
Project on customer satisfaction with special reference to mahindra boleroProject on customer satisfaction with special reference to mahindra bolero
Project on customer satisfaction with special reference to mahindra boleroProjects Kart
 
Project on mutual funds as an investment avenue
Project on mutual funds as an investment avenueProject on mutual funds as an investment avenue
Project on mutual funds as an investment avenueProjects Kart
 
A study of job satisfaction and conflict resolution modes in the minda group
A study of job satisfaction and conflict resolution modes in the minda groupA study of job satisfaction and conflict resolution modes in the minda group
A study of job satisfaction and conflict resolution modes in the minda groupProjects Kart
 
Project report on competancy mapping
Project report on competancy mappingProject report on competancy mapping
Project report on competancy mappingProjects Kart
 
Project on mutual funds is the better investments plan
Project on mutual funds is the better investments planProject on mutual funds is the better investments plan
Project on mutual funds is the better investments planProjects Kart
 
A project report on survey of retailer’s and consumer of soft drinks
A project report on survey of retailer’s and consumer of soft drinksA project report on survey of retailer’s and consumer of soft drinks
A project report on survey of retailer’s and consumer of soft drinksProjects Kart
 

Viewers also liked (18)

Branding In a Troubled Economy
Branding In a Troubled EconomyBranding In a Troubled Economy
Branding In a Troubled Economy
 
2010 Multi Media Marketing Proposal Hfmus No Pricing
2010 Multi Media Marketing Proposal Hfmus No Pricing2010 Multi Media Marketing Proposal Hfmus No Pricing
2010 Multi Media Marketing Proposal Hfmus No Pricing
 
Who is Generation Z
Who is Generation ZWho is Generation Z
Who is Generation Z
 
Customer acquisition and retention project on virgin mobile
Customer acquisition and retention project on virgin mobileCustomer acquisition and retention project on virgin mobile
Customer acquisition and retention project on virgin mobile
 
#BrandBlackface
#BrandBlackface#BrandBlackface
#BrandBlackface
 
Garis panduanppg
Garis panduanppgGaris panduanppg
Garis panduanppg
 
Curriculum
CurriculumCurriculum
Curriculum
 
A study on progress and investors perception towerds dematerialization of sha...
A study on progress and investors perception towerds dematerialization of sha...A study on progress and investors perception towerds dematerialization of sha...
A study on progress and investors perception towerds dematerialization of sha...
 
Alvin Ailey Presentation for Kids (PreK)
Alvin Ailey Presentation for Kids (PreK)Alvin Ailey Presentation for Kids (PreK)
Alvin Ailey Presentation for Kids (PreK)
 
EL MÉTODO CIENTÍFICO: JENNER Y LA VACUNA
EL MÉTODO CIENTÍFICO: JENNER Y LA VACUNAEL MÉTODO CIENTÍFICO: JENNER Y LA VACUNA
EL MÉTODO CIENTÍFICO: JENNER Y LA VACUNA
 
Who are Millennials
Who are MillennialsWho are Millennials
Who are Millennials
 
Mutual funds is the better investments plan
Mutual funds is the better investments planMutual funds is the better investments plan
Mutual funds is the better investments plan
 
Project on customer satisfaction with special reference to mahindra bolero
Project on customer satisfaction with special reference to mahindra boleroProject on customer satisfaction with special reference to mahindra bolero
Project on customer satisfaction with special reference to mahindra bolero
 
Project on mutual funds as an investment avenue
Project on mutual funds as an investment avenueProject on mutual funds as an investment avenue
Project on mutual funds as an investment avenue
 
A study of job satisfaction and conflict resolution modes in the minda group
A study of job satisfaction and conflict resolution modes in the minda groupA study of job satisfaction and conflict resolution modes in the minda group
A study of job satisfaction and conflict resolution modes in the minda group
 
Project report on competancy mapping
Project report on competancy mappingProject report on competancy mapping
Project report on competancy mapping
 
Project on mutual funds is the better investments plan
Project on mutual funds is the better investments planProject on mutual funds is the better investments plan
Project on mutual funds is the better investments plan
 
A project report on survey of retailer’s and consumer of soft drinks
A project report on survey of retailer’s and consumer of soft drinksA project report on survey of retailer’s and consumer of soft drinks
A project report on survey of retailer’s and consumer of soft drinks
 

Similar to Programming Basics

Program logic and design
Program logic and designProgram logic and design
Program logic and designChaffey College
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving TechniquesAshesh R
 
Chapter 5( programming) answer
Chapter 5( programming) answerChapter 5( programming) answer
Chapter 5( programming) answersmkengkilili2011
 
Complete C++ programming Language Course
Complete C++ programming Language CourseComplete C++ programming Language Course
Complete C++ programming Language CourseVivek chan
 
C++ Tutorial
C++ TutorialC++ Tutorial
C++ Tutorialfreema48
 
Ch1 principles of software development
Ch1 principles of software developmentCh1 principles of software development
Ch1 principles of software developmentHattori Sidek
 
Software development slides
Software development slidesSoftware development slides
Software development slidesiarthur
 
Programming with C++
Programming with C++Programming with C++
Programming with C++ssuser802d47
 
Basics of Programming - A Review Guide
Basics of Programming - A Review GuideBasics of Programming - A Review Guide
Basics of Programming - A Review GuideBenjamin Kissinger
 
Programming concepts By ZAK
Programming concepts By ZAKProgramming concepts By ZAK
Programming concepts By ZAKTabsheer Hasan
 
classVI_Coding_Teacher_Presentation.pptx
classVI_Coding_Teacher_Presentation.pptxclassVI_Coding_Teacher_Presentation.pptx
classVI_Coding_Teacher_Presentation.pptxssusere336f4
 
INTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGE
INTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGEINTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGE
INTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGERathnaM16
 
Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!olracoatalub
 

Similar to Programming Basics (20)

Program logic and design
Program logic and designProgram logic and design
Program logic and design
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniques
 
Chapter 5( programming) answer
Chapter 5( programming) answerChapter 5( programming) answer
Chapter 5( programming) answer
 
Complete C++ programming Language Course
Complete C++ programming Language CourseComplete C++ programming Language Course
Complete C++ programming Language Course
 
C++ Tutorial
C++ TutorialC++ Tutorial
C++ Tutorial
 
ArduinoWorkshop2.pdf
ArduinoWorkshop2.pdfArduinoWorkshop2.pdf
ArduinoWorkshop2.pdf
 
programming.ppt
programming.pptprogramming.ppt
programming.ppt
 
Ch1 principles of software development
Ch1 principles of software developmentCh1 principles of software development
Ch1 principles of software development
 
Beekman5 std ppt_13
Beekman5 std ppt_13Beekman5 std ppt_13
Beekman5 std ppt_13
 
Software development slides
Software development slidesSoftware development slides
Software development slides
 
Ppt lesson 06
Ppt lesson 06Ppt lesson 06
Ppt lesson 06
 
Ppt lesson 06
Ppt lesson 06Ppt lesson 06
Ppt lesson 06
 
Programming with C++
Programming with C++Programming with C++
Programming with C++
 
Basics of Programming - A Review Guide
Basics of Programming - A Review GuideBasics of Programming - A Review Guide
Basics of Programming - A Review Guide
 
Programming concepts By ZAK
Programming concepts By ZAKProgramming concepts By ZAK
Programming concepts By ZAK
 
classVI_Coding_Teacher_Presentation.pptx
classVI_Coding_Teacher_Presentation.pptxclassVI_Coding_Teacher_Presentation.pptx
classVI_Coding_Teacher_Presentation.pptx
 
INTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGE
INTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGEINTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGE
INTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGE
 
My final requirement
My final requirementMy final requirement
My final requirement
 
Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!
 
Evaluation
EvaluationEvaluation
Evaluation
 

Recently uploaded

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 

Recently uploaded (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

Programming Basics

  • 1. Introduction to Programming “How to win friends and influence computers”
  • 2.
  • 3.
  • 4. A Brief History of Computers General purpose minions Orders Human calculators Mechanical calculators Electronic calculators General purpose machines Programs
  • 5. What Is Programming Programming is just telling a computer to do something, BUT Computers know very little and have no common sense what-so-ever, so your instructions have to be broken down to small, simple parts, AND Computers will do exactly what you tell them.
  • 6.
  • 7. Basic Programming Programming at it’s core is about two things: defining problems, and solving problems. These two aspects are tightly integrated • To solve a problem you first must clearly know what it is • Clearly and completely defining a problem gets you a long ways towards a solution
  • 8.
  • 9. Four Tools To Get Started Just getting started is often the hardest part of the project. Before diving in to the code, do the design document. Four tools to help are –Action/Event List –Flow Chart –Data Model –Iterative Refinement
  • 10. Action List This is a good tool to use in applications that have user interaction. Write down each action the user can take. Add a bit of detail info to each action • Circumstances in which the user may take the action (1-3 sentences, and/or list) • What happens when they do the action (1-3 sentences) • What other actions this one allows and denies (list format)
  • 11. Flow Charts Flow charts are a very useful tool to clarify and define programming problems • They delineate key points in your program • They’re especially good for state-based programs, such as web applications Don’t get too bogged down in details when creating a flow chart – stay high level
  • 12. Data Model A data model is a detailed description of the information that the application will manipulate. Start with a general idea/concept, then break it down into smaller parts, and repeat. Aim for having each part be a string, a number, or a list or collection thereof.
  • 13. Iterative Refinement - the Ur-Program The process of iterative refinement 2. Say what you want the computer to do 3. If it’s all in terms the computer will understand, then stop, you’re done 4. Otherwise, break each part into simpler steps 5. Go to step 2 NOTE: works for small children as well as computers
  • 14. The Real World These are important concepts, and when done right you end up documenting your code as you go. HOWEVER… Real-world programming often doesn’t explicitly involve these techniques except at high levels in the design document. You should definitely use them there, and for actual coding keep them in mind as fallback strategies if your stuck on a problem.
  • 16. What Computers Can Do Well Doing the same things over and over Remembering things Mathematics, ‘regular’ and true / false Changing actions based on conditions Taking in information Sending out information
  • 17. What Computers Can Do Well Doing the same things over and and Subroutines Loops over Remembering things Variables and Assignment Mathematics, ‘regular’ and true / falseOperators Statements Changing actions based on conditions Conditionals and Blocks Taking in information Sending out information Input Output
  • 18. Statements, and Blocks A statement is a basic instruction for the computer Statements are executed in order, from first to last One or more statements may be grouped together into a block A block is marked by curly braces { and }
  • 19. Loops A loop is a special kind of statement that tells a computer to repeat a given set of instructions A for-loop repeats a given number of times e.g. say “hi” five times: for (1..5) { say “hi” } A while-loop repeats as long as a certain condition is true e.g. go somewhere : while (not arrived) { take step }
  • 20. Subroutines A subroutine, function or procedure is a block of statements that’s been given a name and which is executed when ever that name is used. Essentially, it’s a miniature sub-program that you can use in your larger program. Once a function finishes, the execution returns to the place from which it was called. Functions can take parameters, or arguments, which allow values to be sent into the block of code Functions can return values.
  • 21. Variables A variable has a name, or identifier, and may have a value associated. Associate a given value with a given variable by making an assignment. Variables can be declared, which creates them without any value. Some languages require this.
  • 22. Variable Names MUST: Start with a letter Contain letters or numbers or underscores SHOULD: Be meaningful (often 10+ characters) Be readable (use _ or mixCase to mark words) Follow convention (start lower case, i, x, y)
  • 23. Basic Values Literal values: Numbers 0, -3, 8.223419783 Strings (a series of characters) “zero”, ”0”, “cheddar cheese” Expressions: One or more values, expressions, or variables combined by operators 8.3 * 4.291 2 “smoked” . “ “ . “cheddar” A variable used in a expression is replaced by its value ingredient_count + 3
  • 24. Operators There are all the standard math operators + - * / % () The string concatenation operator combines two or more strings into one Depends on the language (often . or +) There are many other operators too Boolean math Comparisons Specialized Operators combine values and expressions into larger expressions
  • 25. Conditionals A conditional, or branch, statement executes a block of other statements based on whether a given condition is true or false Conditions are evaluated using boolean operators, as well as comparisons and other things that are true or false
  • 26. General Conditional Statement if (condition) Block executed if condition is true else if (other condition) Block executed if other condition is true else Block executed if all conditions are false
  • 27. Input and Output Special statements get data into and out of a program. Details vary by language Data can come from: keyboard, web page, mouse, file, other Data can go to: screen, file, the internet, other
  • 28. Comments Comments are a way to put text in the program code which does not get executed. This is very useful for leaving notes / descriptions / explanations, and for testing. Comments are usually denoted by # or // to comment to the end of the line /* to comment out multiple lines */
  • 29. Best Practices Always make backups of original working code before messing with it Use comments to mark what you change, how, and when, and to keep copies of original statements Test early, test often Work together – more eyes means fewer bugs Read the manual – there are great references online Look at examples
  • 30.
  • 31.
  • 32.
  • 33.