Coder dojo Limerick - introduction to programming languages
-
Upload
consult-mark -
Category
Technology
-
view
2.587 -
download
0
description
Transcript of Coder dojo Limerick - introduction to programming languages
Programming LanguagesCoder Dojo - Limerick
Mark Cahill – MBA, BEng
Problem: I need to cross a river
Bridge
Bridge
Possible solutions?
Possible solutions
• Rocks• Swim• Boat• Bridge
Rocks
Rocks
• The River is too deep
Bridge
Swim
• There are Piranhas in the river• The current is too strong
Bridge
Bridge
Bridge
Bridge
Boat
• I don’t know how to build a boat• I need to get a car across• The current is too strong & there is a
dangerous waterfall.
Bridge
Helicopter
• I don’t know how to build a helicopter• Where do I get the materials?• How long will it take to build?• How much will it cost?
Bridge
Bridge
Bridge
What kind of Bridge do I need?
• What material?• How big?• How strong?• How wide?• How many times will be used?• How much will it cost to build?• Will I toll the bridge?
What kind of Bridge do I need?
• How long will it take to build?• Does it need to be lift to let boats by?• What happens is the water rises?• Does it need maintenance?• Has someone built one that fits my needs?• What volume of traffic will pass over it?• How many people will be using it?
Q: Where is software used?
Q: Where is software used?A: Everywhere
Where I started
• Commodore 64 at the age of 9
Language was called BASICNEW1 REM NUMBER GUESSING GAME2 PRINT "(CLR/HOME)"5 INPUT "ENTER UPPER LIMIT FOR GUESS "; LI10 NM = INT(LIRND(1))+115 CN = 020 PRINT "I'VE GOT THE NUMBER.": PRINT30 INPUT "WHAT'S YOUR GUESS "; GU35 CN = CN + 140 IF GU > NM THEN PRINT "MY NUMBER IS LOWER." : PRINT : GOTO 3050 IF GU < NM THEN PRINT "MY NUMBER IS HIGHER.": PRINT : GOTO 3060 IF GU = NM THEN PRINT "GREAT! YOU GOT MY NUMBER"65 PRINT "IN ONLY"; CN ;"GUESSES." : PRINT70 PRINT "DO YOU WANT TO TRY ANOTHER (Y/N)?"80 GET AN$ : IF AN$ = "" THEN 8090 IF AN$ = "Y" THEN 2100 IF AN$ <> "N" THEN 70110 END
• Why do we need programming languages?
Think like a computer
Think like a computer
• Computers are from Venus, Humans are from Mars
• Computers “think” in a very different way to Humans.
• Computers are stupid, Humans are intelligent.
Think like a computer
• Computers will do exactly as you tell them to do.
• Computers are very good at executing instructions over and over again, and will not get bored.
Think like a computer
• Computers think in Binary.• People think about ‘things’ and how they
relate to each other
Think like a computer
• Computers view of Website address– 173.194.37.104
• Human view of Website address– Google.ie
Computer view of a photo
Human view of a photo
Think like a computer
• Computers view of Location
• Human view of Location– Next door to Starbucks, by the Luas, you can’t
miss it.
High and Low Level Languages
• High Level languages – easy for a human to read. Examples are C++, Python, Java.
• Low level Languages – are designed to be easy for a computer to execute; also called machine language or assembly language
High Level Languages
Low Level Languages
Hello World – C++
Hello World – C#
Hello World – 8051 assembler
Hello World - Java
Hello World -JavaScript
Hello World - PHP
Hello World – POV-Ray
Hello World -Python
Web
• PHP• Python• Java• Perl• HTML• Ruby on Rails• Javascript• Flash
Desktop
• C• C++• Python• Perl• Java
Games
• C• C++• Python• Perl• Java
Artificial intelligence
• Lisp• Prolog
Smart Phones
• iPhone, iPad, iPod -> Objective C• Android -> C, C++• Nokia -> Java ME, C++, Ruby• Window 7 -> C#
Low level hardware
• C• Assembly
Programming languages
Different languages solve different problems in different ways
List of programming languages
• http://en.wikipedia.org/wiki/List_of_programming_languages
What kind of Software Solution do I need?
• What material?• How big?• How strong?• How wide?• How many times will be used?• How much will it cost to build?• Will I toll the bridge?
What kind of Software solution do I need?
• How long will it take to build?• Does it need to be lift to let boats by?• What happens is the water rises?• Does it need maintenance?• Has someone built one that fits my needs?• What volume of traffic will pass over it?• How many people will be using it?
How do I cross a river?
• There are many ways to solve a problem.• Every problem is different.• Ask the right questions.• Break the problem into smaller pieces• You choose the best Tool for the Job !