SlideShare a Scribd company logo
Sarah Kiniry
cPanel, Inc.
Storytime
Programming Language
About Me
Jason (hubby!)
Backend Perl developer,
extremely patient about being
my in-home tutor, taught me a
whole lot of The Things.
Sarah Kiniry (me!)
Technical Writer, former Stage
Manager and Box Office Manager,
needs-an-intervention level
Trekkie.
technicolorwriter.com

@SarahKiniry
@SarahKiniry
#STC16
If you can learn to read,
you can learn to read code.
Just read the story!
1
2
3
What does the application do?
What text will the user see?
Which files or settings?
@SarahKiniry
#STC16
How do I find the story?
Code Clues
1
2
3
What does the application do?
What text will the user see?
Which files or settings?
Code Comments
Function Names
Variable (Setting) Names
File Locations
Print Functions
Files
Directories
Variables
Code comments, function names,
setting names, and file locations.
Display methods, like print, and
other output functions.
File names, file paths, and other
variables.
@SarahKiniry
#STC16
Comments
Text in code that the computer doesn’t try to run.
Instead, it’s there for the developer’s reference.
Sometimes, it’s also used to temporarily “turn off”
code without deleting it.
Comments
// Single-line comments
// require a comment
// for each line.
do(thing); // comment
/* Multi-line
comments use beginning
and end characters for
multiple lines. */
Single-line comments…
• Can be used on the same line as code (a
trailing comment).
• Comment character at the beginning of the
comment only.
• A line break ends the comment.
Multi-line comments…
• Comment character at the beginning and
end of the comment.
• Generally, these exist on separate lines
from the code.
@SarahKiniry
#STC16
Single Line
// Java, JavaScript, C, C#, PHP
# PHP, Perl, Ruby, Python
@SarahKiniry
#STC16
Multi Line
/* Comment */ Java, JavaScript, C, C#, PHP
// Comment 
Comment
C
=pod
=cut
Perl
=begin
=end
Ruby
""" """ Python
@SarahKiniry
#STC16
Functions
Reusable code that performs one or more actions.
Sometimes, the code that you’re looking at is a
function, while sometimes it uses existing functions.
* This is a lazy use of the term. These actions can be
subroutines, methods, procedures, etc.
Functions
sub do_something {
my $value = @_;
if $value {
return "Yay!";
}
…
do_something($value);
Function definition…
• Includes all of the code that will run
anytime the function is used.
• Creating a function that’s used elsewhere.
• Sets the function name.
Function use…
• Could be a custom-written function, or one
that’s built into the programming language.
• Often, custom functions are defined in
other code, not in the same file.
@SarahKiniry
#STC16
Using Functions
function($value)
function "$value"
@SarahKiniry
#STC16
Creating Functions
// This is the format to define a function.
class type functionname(parameters) {
code
}
*Java uses a “class” structure, so when you see this in code it’s going to be nested in a class.
Java*, C#
@SarahKiniry
#STC16
Creating Functions
// This is the format to define a function.
class type functionname(parameters) {
code
}
// This example defines a function.
public static void printyay() {
System.out.println ("Yay!");
}
*Java uses a “class” structure, so when you see this in code it’s going to be nested in a class.
Java*, C#
@SarahKiniry
#STC16
Creating Functions
// This is the format to define a function.
class type functionname(parameters) {
code
}
// This example defines a function.
public static void printyay() {
System.out.println ("Yay!");
}
*Java uses a “class” structure, so when you see this in code it’s going to be nested in a class.
Java*, C#
@SarahKiniry
#STC16
// This uses the defined function.
printyay();
Creating Functions
// This is the format to define a function.
class type functionname(parameters) {
code
}
// This example defines a function.
public static void printyay() {
System.out.println ("Yay!");
}
*Java uses a “class” structure, so when you see this in code it’s going to be nested in a class.
Java*, C#
@SarahKiniry
#STC16
// This uses the defined function.
printyay();
Yay!
Creating Functions
// This is the format to define a function.
type functionname(parameters) {
code
}
C
@SarahKiniry
#STC16
Creating Functions
// This is the format to define a function.
type functionname(parameters) {
code
}
// This example defines a function.
int printyay() {
printf("Yay!");
}
C
@SarahKiniry
#STC16
Creating Functions
// This is the format to define a function.
type functionname(parameters) {
code
}
// This example defines a function.
int printyay() {
printf("Yay!");
}
C
@SarahKiniry
#STC16
// This uses the defined function.
printyay();
Creating Functions
// This is the format to define a function.
type functionname(parameters) {
code
}
// This example defines a function.
int printyay() {
printf("Yay!");
}
C
@SarahKiniry
#STC16
// This uses the defined function.
printyay();
Yay!
Creating Functions
// This is the format to define a function.
function functionname(parameters) {
code
}
JavaScript, PHP
@SarahKiniry
#STC16
Creating Functions
// This is the format to define a function.
function functionname(parameters) {
code
}
// This example defines a function.
function multiply(a,b) {
return a * b;
}
JavaScript, PHP
@SarahKiniry
#STC16
Creating Functions
// This is the format to define a function.
function functionname(parameters) {
code
}
// This example defines a function.
function multiply(a,b) {
return a * b;
}
JavaScript, PHP
@SarahKiniry
#STC16
// This uses the defined function.
multiply(3,2);
Creating Functions
// This is the format to define a function.
function functionname(parameters) {
code
}
// This example defines a function.
function multiply(a,b) {
return a * b;
}
JavaScript, PHP
@SarahKiniry
#STC16
// This uses the defined function.
multiply(3,2);
6
Creating Functions
# This is the format to define a function.
sub functionname {
code
}
Perl
@SarahKiniry
#STC16
Creating Functions
# This is the format to define a function.
sub functionname {
code
}
# This example defines a function.
sub dothingstovars {
$variables = @_;
do_something($variables);
return $variables;
}
Perl
@SarahKiniry
#STC16
Creating Functions
Perl
@SarahKiniry
#STC16
# This uses the defined function.
dothingstovars(“red”);
# This example defines a function.
sub dothingstovars {
$variables = @_;
do_something($variables);
return $variables;
}
# This is the format to define a function.
sub functionname {
code
}
Creating Functions
Perl
@SarahKiniry
#STC16
# This uses the defined function.
dothingstovars(“red”);
# This example defines a function.
sub dothingstovars {
$variables = @_;
do_something($variables);
return $variables;
}
# This is the format to define a function.
sub functionname {
code
}
blue
Creating Functions
# This is the format to define a function.
def functionname(parameters)
code
end
Ruby
@SarahKiniry
#STC16
Creating Functions
# This is the format to define a function.
def functionname(parameters)
code
end
# This example defines a function.
def Texas(name)
var = "Howdy, " + name
return var
end
Ruby
@SarahKiniry
#STC16
Creating Functions
Ruby
@SarahKiniry
#STC16
# This uses the defined function.
Texas(Bob)
# This is the format to define a function.
def functionname(parameters)
code
end
# This example defines a function.
def Texas(name)
var = "Howdy, " + name
return var
end
Creating Functions
Ruby
@SarahKiniry
#STC16
# This uses the defined function.
Texas(Bob)
# This is the format to define a function.
def functionname(parameters)
code
end
# This example defines a function.
def Texas(name)
var = "Howdy, " + name
return var
end
Howdy,
Bob
Creating Functions
# This is the format to define a function.
def functionname(parameters):
code
return[value]
Python
@SarahKiniry
#STC16
Creating Functions
# This example defines a function.
def print_return(my_words)
print my_words
return[]
Python
@SarahKiniry
#STC16
# This is the format to define a function.
def functionname(parameters):
code
return[value]
Creating Functions
Python
@SarahKiniry
#STC16
# This uses the defined function.
print_return(“Hey everybody!")
# This example defines a function.
def print_return(my_words)
print my_words
return[]
# This is the format to define a function.
def functionname(parameters):
code
return[value]
Creating Functions
Python
@SarahKiniry
#STC16
# This uses the defined function.
print_return(“Hey everybody!")
# This example defines a function.
def print_return(my_words)
print my_words
return[]
# This is the format to define a function.
def functionname(parameters):
code
return[value]
Hey
everybody!
Variables
The names of stored values that code uses to
perform actions. This can mean strings (text),
numbers, or boolean values (true/false).
There are also methods of storing groups of values,
such as arrays or hashes.
Variables
variable_name Java, JavaScript, C, C#, Python
$variable_name PHP, Perl, Ruby
@variable_name Perl, Ruby
%variable_name Perl
(and arrays
and hashes)
@SarahKiniry
#STC16
Important Value Types
Files example.txt, example.jpg, example.php
Directories
Linux: /example/directory or example/directory/
Windows: C:exampledirectory or
..exampledirectory
Settings managed, unmanaged; blue, green, red; 0, 1
@SarahKiniry
#STC16
Variables
my $file = example.txt;
$color = blue;
$do_something = 1;
@SarahKiniry
#STC16
Hello World!
The Hello World Story
1
2
3
What does the application do?
What text will the user see?
Which files or settings?
@SarahKiniry
#STC16
The Hello World Story
1
2
3
What does the application do?

This application displays a message to the user.
What text will the user see?
Which files or settings?
@SarahKiniry
#STC16
The Hello World Story
1
2
3
What does the application do?

This application displays a message to the user.
What text will the user see?

The user will see the text “Hello World.”
Which files or settings?
@SarahKiniry
#STC16
The Hello World Story
1
2
3
What does the application do?

This application displays a message to the user.
What text will the user see?

The user will see the text “Hello World.”
Which files or settings?

No other files or settings are involved.
@SarahKiniry
#STC16
Hello, Java!
/* This is a Hello World script. */
class HelloWorldApp {
public static void main(String[] args)
{
// Display the string.
System.out.println("Hello World!");
}
}
@SarahKiniry
#STC16
Hello, Java!
/* This is a Hello World script. */
class HelloWorldApp {
public static void main(String[] args)
{
// Display the string.
System.out.println("Hello World!");
}
}
@SarahKiniry
#STC16
Hello, Java!
/* This is a Hello World script. */
class HelloWorldApp {
public static void main(String[] args)
{
// Display the string.
System.out.println("Hello World!");
}
}
@SarahKiniry
#STC16
Hello, JavaScript!
<script language=“Javascript">
// Write to browser window.
document.write("Hello World!");
</script>
@SarahKiniry
#STC16
Hello, JavaScript!
<script language=“Javascript">
// Write to browser window.
document.write("Hello World!");
</script>
@SarahKiniry
#STC16
Hello, JavaScript!
<script language=“Javascript">
// Write to browser window.
document.write("Hello World!");
</script>
@SarahKiniry
#STC16
Hello, C!
/* Hello World */
void main()
{
printf("Hello World!");
}
@SarahKiniry
#STC16
Hello, C!
/* Hello World */
void main()
{
printf("Hello World!");
}
Hello, C!
/* Hello World */
void main()
{
printf("Hello World!");
}
Hello, C#!
/// Let’s say Hello.
using System;
namespace HelloWorld
{
class Hello
{
static void Main()
{
Console.WriteLine("Hello World!");
}
}
}
@SarahKiniry
#STC16
Hello, C#!
/// Let’s say Hello.
using System;
namespace HelloWorld
{
class Hello
{
static void Main()
{
Console.WriteLine("Hello World!");
}
}
}
Hello, C#!
/// Let’s say Hello.
using System;
namespace HelloWorld
{
class Hello
{
static void Main()
{
Console.WriteLine("Hello World!");
}
}
}
Hello, PHP!
// Tell them hello in PHP.
<?php
echo "Hello World!";
?>
@SarahKiniry
#STC16
Hello, PHP!
// Tell them hello in PHP.
<?php
echo "Hello World!";
?>
Hello, PHP!
// Tell them hello in PHP.
<?php
echo "Hello World!";
?>
Hello, Perl!
#!/usr/bin/perl
# We’ll call this a Perl of wisdom.
print "Hello World!";
@SarahKiniry
#STC16
Hello, Perl!
#!/usr/bin/perl
# We’ll call this a Perl of wisdom.
print "Hello World!";
Hello, Perl!
#!/usr/bin/perl
# We’ll call this a Perl of wisdom.
print "Hello World!";
Hello, Ruby!
#!/usr/bin/ruby -w
# First Perl, now Ruby? Shiny.
puts "Hello, world!"
=begin
Really though, who knew there were two
programming languages named after
gemstones, even if one is kind of
misspelled?
=end
@SarahKiniry
#STC16
Hello, Ruby!
#!/usr/bin/ruby -w
# First Perl, now Ruby? Shiny.
puts "Hello, world!"
=begin
Really though, who knew there were two
programming languages named after
gemstones, even if one is kind of
misspelled?
=end
Hello, Ruby!
#!/usr/bin/ruby -w
# First Perl, now Ruby? Shiny.
puts "Hello, world!"
=begin
Really though, who knew there were two
programming languages named after
gemstones, even if one is kind of
misspelled?
=end
Hello, Python!
# A lot of programming languages use
# hashes for their comment character.
print("Hello, World!")
""" But they tend to diverge when it comes
to multiline comments. """
@SarahKiniry
#STC16
Hello, Python!
# A lot of programming languages use
# hashes for their comment character.
print("Hello, World!")
""" But they tend to diverge when it comes
to multiline comments. """
Hello, Python!
# A lot of programming languages use
# hashes for their comment character.
print("Hello, World!")
""" But they tend to diverge when it comes
to multiline comments. """
The Harder Stuff
More JavaScript
<h1>JavaScript Can Change Images</h1>
<img id="myImage" onclick="changeImage()"
src="pic_bulboff.gif" width="100" height="180">
<script>
function changeImage() {
var image = document.getElementById('myImage');
if (image.src.match("bulbon")) {
image.src = "pic_bulboff.gif";
} else {
image.src = "pic_bulbon.gif";
}
}
</script>
JavaScript code example from w3schools.com
@SarahKiniry
#STC16
More JavaScript
JavaScript code example from w3schools.com
<h1>JavaScript Can Change Images</h1>
<img id="myImage" onclick="changeImage()"
src="pic_bulboff.gif" width="100" height="180">
<script>
function changeImage() {
var image = document.getElementById('myImage');
if (image.src.match("bulbon")) {
image.src = "pic_bulboff.gif";
} else {
image.src = "pic_bulbon.gif";
}
}
</script>
@SarahKiniry
#STC16
More JavaScript
JavaScript code example from w3schools.com
<h1>JavaScript Can Change Images</h1>
<img id="myImage" onclick="changeImage()"
src="pic_bulboff.gif" width="100" height="180">
<script>
function changeImage() {
var image = document.getElementById('myImage');
if (image.src.match("bulbon")) {
image.src = "pic_bulboff.gif";
} else {
image.src = "pic_bulbon.gif";
}
}
</script>
@SarahKiniry
#STC16
More JavaScript
JavaScript code example from w3schools.com
<h1>JavaScript Can Change Images</h1>
<img id="myImage" onclick="changeImage()"
src="pic_bulboff.gif" width="100" height="180">
<script>
function changeImage() {
var image = document.getElementById('myImage');
if (image.src.match("bulbon")) {
image.src = "pic_bulboff.gif";
} else {
image.src = "pic_bulbon.gif";
}
}
</script>
@SarahKiniry
#STC16
More JavaScript
JavaScript code example from w3schools.com
<h1>JavaScript Can Change Images</h1>
<img id="myImage" onclick="changeImage()"
src="pic_bulboff.gif" width="100" height="180">
<script>
function changeImage() {
var image = document.getElementById('myImage');
if (image.src.match("bulbon")) {
image.src = "pic_bulboff.gif";
} else {
image.src = "pic_bulbon.gif";
}
}
</script>
@SarahKiniry
#STC16
More JavaScript
JavaScript code example from w3schools.com
<h1>JavaScript Can Change Images</h1>
<img id="myImage" onclick="changeImage()"
src="pic_bulboff.gif" width="100" height="180">
<script>
function changeImage() {
var image = document.getElementById('myImage');
if (image.src.match("bulbon")) {
image.src = "pic_bulboff.gif";
} else {
image.src = "pic_bulbon.gif";
}
}
</script>
@SarahKiniry
#STC16
More JavaScript
JavaScript code example from w3schools.com
<h1>JavaScript Can Change Images</h1>
<img id="myImage" onclick="changeImage()"
src="pic_bulboff.gif" width="100" height="180">
<script>
function changeImage() {
var image = document.getElementById('myImage');
if (image.src.match("bulbon")) {
image.src = "pic_bulboff.gif";
} else {
image.src = "pic_bulbon.gif";
}
}
</script>
@SarahKiniry
#STC16
What’s The Story?
1
2
3
What does the application do?
What text will the user see?
Which files or settings?
@SarahKiniry
#STC16
What’s The Story?
1
2
3
What does the application do?

This application switches between two images.
What text will the user see?
Which files or settings?
@SarahKiniry
#STC16
What’s The Story?
1
2
3
What does the application do?

This application switches between two images.
What text will the user see?

“Javascript Can Change Images”
Which files or settings?
@SarahKiniry
#STC16
What’s The Story?
1
2
3
What does the application do?

This application switches between two images.
What text will the user see?

“Javascript Can Change Images”
Which files or settings?

pic_bulbon.gif and pic_bulboff.gif, width=100,
height=180
@SarahKiniry
#STC16
More JavaScript
JavaScript code example from w3schools.com
@SarahKiniry
#STC16
More JavaScript
JavaScript code example from w3schools.com
@SarahKiniry
#STC16
Questions?
@SarahKiniry
#STC16

More Related Content

What's hot

Intro to Perl and Bioperl
Intro to Perl and BioperlIntro to Perl and Bioperl
Oops in PHP
Oops in PHPOops in PHP
Oops in PHP
Mindfire Solutions
 
Subroutines
SubroutinesSubroutines
Object Oriented Design Patterns for PHP
Object Oriented Design Patterns for PHPObject Oriented Design Patterns for PHP
Object Oriented Design Patterns for PHP
RobertGonzalez
 
Subroutines
SubroutinesSubroutines
Subroutines
primeteacher32
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
Henry Osborne
 
Oops in PHP By Nyros Developer
Oops in PHP By Nyros DeveloperOops in PHP By Nyros Developer
Oops in PHP By Nyros Developer
Nyros Technologies
 
Creating native apps with WordPress
Creating native apps with WordPressCreating native apps with WordPress
Creating native apps with WordPress
Marko Heijnen
 
CGI With Object Oriented Perl
CGI With Object Oriented PerlCGI With Object Oriented Perl
CGI With Object Oriented Perl
Bunty Ray
 
Iq rails
Iq railsIq rails
PHP Web Programming
PHP Web ProgrammingPHP Web Programming
PHP Web Programming
Muthuselvam RS
 
Subroutines in perl
Subroutines in perlSubroutines in perl
Subroutines in perl
sana mateen
 
perl usage at database applications
perl usage at database applicationsperl usage at database applications
perl usage at database applications
Joe Jiang
 
PHP - Introduction to PHP Functions
PHP -  Introduction to PHP FunctionsPHP -  Introduction to PHP Functions
PHP - Introduction to PHP Functions
Vibrant Technologies & Computers
 
Php Tutorials for Beginners
Php Tutorials for BeginnersPhp Tutorials for Beginners
Php Tutorials for Beginners
Vineet Kumar Saini
 
Class 3 - PHP Functions
Class 3 - PHP FunctionsClass 3 - PHP Functions
Class 3 - PHP Functions
Ahmed Swilam
 
Class 2 - Introduction to PHP
Class 2 - Introduction to PHPClass 2 - Introduction to PHP
Class 2 - Introduction to PHP
Ahmed Swilam
 
Ruby For Java Programmers
Ruby For Java ProgrammersRuby For Java Programmers
Ruby For Java Programmers
Mike Bowler
 
Class 7 - PHP Object Oriented Programming
Class 7 - PHP Object Oriented ProgrammingClass 7 - PHP Object Oriented Programming
Class 7 - PHP Object Oriented Programming
Ahmed Swilam
 
Preparing for the next PHP version (5.6)
Preparing for the next PHP version (5.6)Preparing for the next PHP version (5.6)
Preparing for the next PHP version (5.6)
Damien Seguy
 

What's hot (20)

Intro to Perl and Bioperl
Intro to Perl and BioperlIntro to Perl and Bioperl
Intro to Perl and Bioperl
 
Oops in PHP
Oops in PHPOops in PHP
Oops in PHP
 
Subroutines
SubroutinesSubroutines
Subroutines
 
Object Oriented Design Patterns for PHP
Object Oriented Design Patterns for PHPObject Oriented Design Patterns for PHP
Object Oriented Design Patterns for PHP
 
Subroutines
SubroutinesSubroutines
Subroutines
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
Oops in PHP By Nyros Developer
Oops in PHP By Nyros DeveloperOops in PHP By Nyros Developer
Oops in PHP By Nyros Developer
 
Creating native apps with WordPress
Creating native apps with WordPressCreating native apps with WordPress
Creating native apps with WordPress
 
CGI With Object Oriented Perl
CGI With Object Oriented PerlCGI With Object Oriented Perl
CGI With Object Oriented Perl
 
Iq rails
Iq railsIq rails
Iq rails
 
PHP Web Programming
PHP Web ProgrammingPHP Web Programming
PHP Web Programming
 
Subroutines in perl
Subroutines in perlSubroutines in perl
Subroutines in perl
 
perl usage at database applications
perl usage at database applicationsperl usage at database applications
perl usage at database applications
 
PHP - Introduction to PHP Functions
PHP -  Introduction to PHP FunctionsPHP -  Introduction to PHP Functions
PHP - Introduction to PHP Functions
 
Php Tutorials for Beginners
Php Tutorials for BeginnersPhp Tutorials for Beginners
Php Tutorials for Beginners
 
Class 3 - PHP Functions
Class 3 - PHP FunctionsClass 3 - PHP Functions
Class 3 - PHP Functions
 
Class 2 - Introduction to PHP
Class 2 - Introduction to PHPClass 2 - Introduction to PHP
Class 2 - Introduction to PHP
 
Ruby For Java Programmers
Ruby For Java ProgrammersRuby For Java Programmers
Ruby For Java Programmers
 
Class 7 - PHP Object Oriented Programming
Class 7 - PHP Object Oriented ProgrammingClass 7 - PHP Object Oriented Programming
Class 7 - PHP Object Oriented Programming
 
Preparing for the next PHP version (5.6)
Preparing for the next PHP version (5.6)Preparing for the next PHP version (5.6)
Preparing for the next PHP version (5.6)
 

Viewers also liked

LavaCon 2015 New Manager Boot Camp
LavaCon 2015 New Manager Boot CampLavaCon 2015 New Manager Boot Camp
LavaCon 2015 New Manager Boot Camp
crygula2
 
Fundamentos.de.matematica.elementar.vol.11.financeira.estatistica
Fundamentos.de.matematica.elementar.vol.11.financeira.estatisticaFundamentos.de.matematica.elementar.vol.11.financeira.estatistica
Fundamentos.de.matematica.elementar.vol.11.financeira.estatistica
Jose Cicero
 
Energias alternativas
Energias alternativasEnergias alternativas
Energias alternativas
Mario Avalos Villarreal
 
【大阪】大阪へのUIJターンで府内企業の活性化につなげていきたい
【大阪】大阪へのUIJターンで府内企業の活性化につなげていきたい【大阪】大阪へのUIJターンで府内企業の活性化につなげていきたい
【大阪】大阪へのUIJターンで府内企業の活性化につなげていきたい
さぶみっと!ヨクスル
 
伝統産業で地域活性!京都の伝統「着物」で、地域に雇用を創出する!【寺谷 卓也さん(京都着物レンタルさくら)】
伝統産業で地域活性!京都の伝統「着物」で、地域に雇用を創出する!【寺谷 卓也さん(京都着物レンタルさくら)】伝統産業で地域活性!京都の伝統「着物」で、地域に雇用を創出する!【寺谷 卓也さん(京都着物レンタルさくら)】
伝統産業で地域活性!京都の伝統「着物」で、地域に雇用を創出する!【寺谷 卓也さん(京都着物レンタルさくら)】
さぶみっと!ヨクスル
 
IPA KELAS 9 REPRODUKSI WANITA
IPA KELAS 9 REPRODUKSI WANITAIPA KELAS 9 REPRODUKSI WANITA
IPA KELAS 9 REPRODUKSI WANITA
ajengkartika123
 
Los valores
Los valoresLos valores
第六章 ユマニチュードの哲学~介護者とは何か~
第六章 ユマニチュードの哲学~介護者とは何か~第六章 ユマニチュードの哲学~介護者とは何か~
第六章 ユマニチュードの哲学~介護者とは何か~
Atsushi OMATA
 
RESUME OF AHSANUL KABIR
RESUME OF AHSANUL KABIRRESUME OF AHSANUL KABIR
RESUME OF AHSANUL KABIR
AHSANUL KABIR
 
10 popular software programs written in python
10 popular software programs written in python 10 popular software programs written in python
10 popular software programs written in python
ATEES Industrial Training Pvt Ltd
 
Top 10 graphic and web design tools in 2015
Top 10 graphic and web design tools in 2015Top 10 graphic and web design tools in 2015
Top 10 graphic and web design tools in 2015
ATEES Industrial Training Pvt Ltd
 
Trece Consejos para la Vida
Trece Consejos para la VidaTrece Consejos para la Vida
Trece Consejos para la Vida
erickeduproducciones
 
Information about WRAP
Information about WRAPInformation about WRAP
Information about WRAP
marianskeffington
 
Давайте знакомые книжки откроем
Давайте знакомые книжки откроемДавайте знакомые книжки откроем
Давайте знакомые книжки откроем
Library43
 
Самая, самое, самый
Самая, самое, самыйСамая, самое, самый
Самая, самое, самый
Library43
 
【concrete5】CMS夏祭り2015@mttokyo
【concrete5】CMS夏祭り2015@mttokyo【concrete5】CMS夏祭り2015@mttokyo
【concrete5】CMS夏祭り2015@mttokyo
Shinji Sakai
 

Viewers also liked (16)

LavaCon 2015 New Manager Boot Camp
LavaCon 2015 New Manager Boot CampLavaCon 2015 New Manager Boot Camp
LavaCon 2015 New Manager Boot Camp
 
Fundamentos.de.matematica.elementar.vol.11.financeira.estatistica
Fundamentos.de.matematica.elementar.vol.11.financeira.estatisticaFundamentos.de.matematica.elementar.vol.11.financeira.estatistica
Fundamentos.de.matematica.elementar.vol.11.financeira.estatistica
 
Energias alternativas
Energias alternativasEnergias alternativas
Energias alternativas
 
【大阪】大阪へのUIJターンで府内企業の活性化につなげていきたい
【大阪】大阪へのUIJターンで府内企業の活性化につなげていきたい【大阪】大阪へのUIJターンで府内企業の活性化につなげていきたい
【大阪】大阪へのUIJターンで府内企業の活性化につなげていきたい
 
伝統産業で地域活性!京都の伝統「着物」で、地域に雇用を創出する!【寺谷 卓也さん(京都着物レンタルさくら)】
伝統産業で地域活性!京都の伝統「着物」で、地域に雇用を創出する!【寺谷 卓也さん(京都着物レンタルさくら)】伝統産業で地域活性!京都の伝統「着物」で、地域に雇用を創出する!【寺谷 卓也さん(京都着物レンタルさくら)】
伝統産業で地域活性!京都の伝統「着物」で、地域に雇用を創出する!【寺谷 卓也さん(京都着物レンタルさくら)】
 
IPA KELAS 9 REPRODUKSI WANITA
IPA KELAS 9 REPRODUKSI WANITAIPA KELAS 9 REPRODUKSI WANITA
IPA KELAS 9 REPRODUKSI WANITA
 
Los valores
Los valoresLos valores
Los valores
 
第六章 ユマニチュードの哲学~介護者とは何か~
第六章 ユマニチュードの哲学~介護者とは何か~第六章 ユマニチュードの哲学~介護者とは何か~
第六章 ユマニチュードの哲学~介護者とは何か~
 
RESUME OF AHSANUL KABIR
RESUME OF AHSANUL KABIRRESUME OF AHSANUL KABIR
RESUME OF AHSANUL KABIR
 
10 popular software programs written in python
10 popular software programs written in python 10 popular software programs written in python
10 popular software programs written in python
 
Top 10 graphic and web design tools in 2015
Top 10 graphic and web design tools in 2015Top 10 graphic and web design tools in 2015
Top 10 graphic and web design tools in 2015
 
Trece Consejos para la Vida
Trece Consejos para la VidaTrece Consejos para la Vida
Trece Consejos para la Vida
 
Information about WRAP
Information about WRAPInformation about WRAP
Information about WRAP
 
Давайте знакомые книжки откроем
Давайте знакомые книжки откроемДавайте знакомые книжки откроем
Давайте знакомые книжки откроем
 
Самая, самое, самый
Самая, самое, самыйСамая, самое, самый
Самая, самое, самый
 
【concrete5】CMS夏祭り2015@mttokyo
【concrete5】CMS夏祭り2015@mttokyo【concrete5】CMS夏祭り2015@mttokyo
【concrete5】CMS夏祭り2015@mttokyo
 

Similar to STC 2016 Programming Language Storytime

Building maintainable javascript applications
Building maintainable javascript applicationsBuilding maintainable javascript applications
Building maintainable javascript applications
equisodie
 
In-Depth Guide On WordPress Coding Standards For PHP & HTML
In-Depth Guide On WordPress Coding Standards For PHP & HTMLIn-Depth Guide On WordPress Coding Standards For PHP & HTML
In-Depth Guide On WordPress Coding Standards For PHP & HTML
eSparkBiz
 
JavaScript and UI Architecture Best Practices
JavaScript and UI Architecture Best PracticesJavaScript and UI Architecture Best Practices
JavaScript and UI Architecture Best Practices
Siarhei Barysiuk
 
PHP-03-Functions.ppt
PHP-03-Functions.pptPHP-03-Functions.ppt
PHP-03-Functions.ppt
Jamers2
 
PHP-03-Functions.ppt
PHP-03-Functions.pptPHP-03-Functions.ppt
PHP-03-Functions.ppt
ShishirKantSingh1
 
Javascript sivasoft
Javascript sivasoftJavascript sivasoft
Javascript sivasoft
ch samaram
 
Php
PhpPhp
Java findamentals2
Java findamentals2Java findamentals2
Java findamentals2
Todor Kolev
 
Java findamentals2
Java findamentals2Java findamentals2
Java findamentals2
Todor Kolev
 
Licão 13 functions
Licão 13 functionsLicão 13 functions
Licão 13 functions
Acácio Oliveira
 
A tour on ruby and friends
A tour on ruby and friendsA tour on ruby and friends
A tour on ruby and friends
旻琦 潘
 
Ruby/Rails
Ruby/RailsRuby/Rails
Ruby/Rails
rstankov
 
Painless Javascript Unit Testing
Painless Javascript Unit TestingPainless Javascript Unit Testing
Painless Javascript Unit Testing
Benjamin Wilson
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
ciklum_ods
 
Struts 2
Struts 2Struts 2
Struts 2
Lalit Garg
 
Intro Java Rev010
Intro Java Rev010Intro Java Rev010
Intro Java Rev010
Rich Helton
 
PHP Reviewer
PHP ReviewerPHP Reviewer
PHP Reviewer
Cecilia Pamfilo
 
Lettering js
Lettering jsLettering js
Lettering js
davatron5000
 
Dsl
DslDsl
Dsl
phoet
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
Fabio Franzini
 

Similar to STC 2016 Programming Language Storytime (20)

Building maintainable javascript applications
Building maintainable javascript applicationsBuilding maintainable javascript applications
Building maintainable javascript applications
 
In-Depth Guide On WordPress Coding Standards For PHP & HTML
In-Depth Guide On WordPress Coding Standards For PHP & HTMLIn-Depth Guide On WordPress Coding Standards For PHP & HTML
In-Depth Guide On WordPress Coding Standards For PHP & HTML
 
JavaScript and UI Architecture Best Practices
JavaScript and UI Architecture Best PracticesJavaScript and UI Architecture Best Practices
JavaScript and UI Architecture Best Practices
 
PHP-03-Functions.ppt
PHP-03-Functions.pptPHP-03-Functions.ppt
PHP-03-Functions.ppt
 
PHP-03-Functions.ppt
PHP-03-Functions.pptPHP-03-Functions.ppt
PHP-03-Functions.ppt
 
Javascript sivasoft
Javascript sivasoftJavascript sivasoft
Javascript sivasoft
 
Php
PhpPhp
Php
 
Java findamentals2
Java findamentals2Java findamentals2
Java findamentals2
 
Java findamentals2
Java findamentals2Java findamentals2
Java findamentals2
 
Licão 13 functions
Licão 13 functionsLicão 13 functions
Licão 13 functions
 
A tour on ruby and friends
A tour on ruby and friendsA tour on ruby and friends
A tour on ruby and friends
 
Ruby/Rails
Ruby/RailsRuby/Rails
Ruby/Rails
 
Painless Javascript Unit Testing
Painless Javascript Unit TestingPainless Javascript Unit Testing
Painless Javascript Unit Testing
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
 
Struts 2
Struts 2Struts 2
Struts 2
 
Intro Java Rev010
Intro Java Rev010Intro Java Rev010
Intro Java Rev010
 
PHP Reviewer
PHP ReviewerPHP Reviewer
PHP Reviewer
 
Lettering js
Lettering jsLettering js
Lettering js
 
Dsl
DslDsl
Dsl
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 

STC 2016 Programming Language Storytime

  • 2. About Me Jason (hubby!) Backend Perl developer, extremely patient about being my in-home tutor, taught me a whole lot of The Things. Sarah Kiniry (me!) Technical Writer, former Stage Manager and Box Office Manager, needs-an-intervention level Trekkie. technicolorwriter.com
 @SarahKiniry @SarahKiniry #STC16
  • 3. If you can learn to read, you can learn to read code.
  • 4. Just read the story! 1 2 3 What does the application do? What text will the user see? Which files or settings? @SarahKiniry #STC16
  • 5. How do I find the story?
  • 6. Code Clues 1 2 3 What does the application do? What text will the user see? Which files or settings? Code Comments Function Names Variable (Setting) Names File Locations Print Functions Files Directories Variables Code comments, function names, setting names, and file locations. Display methods, like print, and other output functions. File names, file paths, and other variables. @SarahKiniry #STC16
  • 7. Comments Text in code that the computer doesn’t try to run. Instead, it’s there for the developer’s reference. Sometimes, it’s also used to temporarily “turn off” code without deleting it.
  • 8. Comments // Single-line comments // require a comment // for each line. do(thing); // comment /* Multi-line comments use beginning and end characters for multiple lines. */ Single-line comments… • Can be used on the same line as code (a trailing comment). • Comment character at the beginning of the comment only. • A line break ends the comment. Multi-line comments… • Comment character at the beginning and end of the comment. • Generally, these exist on separate lines from the code. @SarahKiniry #STC16
  • 9. Single Line // Java, JavaScript, C, C#, PHP # PHP, Perl, Ruby, Python @SarahKiniry #STC16
  • 10. Multi Line /* Comment */ Java, JavaScript, C, C#, PHP // Comment Comment C =pod =cut Perl =begin =end Ruby """ """ Python @SarahKiniry #STC16
  • 11. Functions Reusable code that performs one or more actions. Sometimes, the code that you’re looking at is a function, while sometimes it uses existing functions. * This is a lazy use of the term. These actions can be subroutines, methods, procedures, etc.
  • 12. Functions sub do_something { my $value = @_; if $value { return "Yay!"; } … do_something($value); Function definition… • Includes all of the code that will run anytime the function is used. • Creating a function that’s used elsewhere. • Sets the function name. Function use… • Could be a custom-written function, or one that’s built into the programming language. • Often, custom functions are defined in other code, not in the same file. @SarahKiniry #STC16
  • 14. Creating Functions // This is the format to define a function. class type functionname(parameters) { code } *Java uses a “class” structure, so when you see this in code it’s going to be nested in a class. Java*, C# @SarahKiniry #STC16
  • 15. Creating Functions // This is the format to define a function. class type functionname(parameters) { code } // This example defines a function. public static void printyay() { System.out.println ("Yay!"); } *Java uses a “class” structure, so when you see this in code it’s going to be nested in a class. Java*, C# @SarahKiniry #STC16
  • 16. Creating Functions // This is the format to define a function. class type functionname(parameters) { code } // This example defines a function. public static void printyay() { System.out.println ("Yay!"); } *Java uses a “class” structure, so when you see this in code it’s going to be nested in a class. Java*, C# @SarahKiniry #STC16 // This uses the defined function. printyay();
  • 17. Creating Functions // This is the format to define a function. class type functionname(parameters) { code } // This example defines a function. public static void printyay() { System.out.println ("Yay!"); } *Java uses a “class” structure, so when you see this in code it’s going to be nested in a class. Java*, C# @SarahKiniry #STC16 // This uses the defined function. printyay(); Yay!
  • 18. Creating Functions // This is the format to define a function. type functionname(parameters) { code } C @SarahKiniry #STC16
  • 19. Creating Functions // This is the format to define a function. type functionname(parameters) { code } // This example defines a function. int printyay() { printf("Yay!"); } C @SarahKiniry #STC16
  • 20. Creating Functions // This is the format to define a function. type functionname(parameters) { code } // This example defines a function. int printyay() { printf("Yay!"); } C @SarahKiniry #STC16 // This uses the defined function. printyay();
  • 21. Creating Functions // This is the format to define a function. type functionname(parameters) { code } // This example defines a function. int printyay() { printf("Yay!"); } C @SarahKiniry #STC16 // This uses the defined function. printyay(); Yay!
  • 22. Creating Functions // This is the format to define a function. function functionname(parameters) { code } JavaScript, PHP @SarahKiniry #STC16
  • 23. Creating Functions // This is the format to define a function. function functionname(parameters) { code } // This example defines a function. function multiply(a,b) { return a * b; } JavaScript, PHP @SarahKiniry #STC16
  • 24. Creating Functions // This is the format to define a function. function functionname(parameters) { code } // This example defines a function. function multiply(a,b) { return a * b; } JavaScript, PHP @SarahKiniry #STC16 // This uses the defined function. multiply(3,2);
  • 25. Creating Functions // This is the format to define a function. function functionname(parameters) { code } // This example defines a function. function multiply(a,b) { return a * b; } JavaScript, PHP @SarahKiniry #STC16 // This uses the defined function. multiply(3,2); 6
  • 26. Creating Functions # This is the format to define a function. sub functionname { code } Perl @SarahKiniry #STC16
  • 27. Creating Functions # This is the format to define a function. sub functionname { code } # This example defines a function. sub dothingstovars { $variables = @_; do_something($variables); return $variables; } Perl @SarahKiniry #STC16
  • 28. Creating Functions Perl @SarahKiniry #STC16 # This uses the defined function. dothingstovars(“red”); # This example defines a function. sub dothingstovars { $variables = @_; do_something($variables); return $variables; } # This is the format to define a function. sub functionname { code }
  • 29. Creating Functions Perl @SarahKiniry #STC16 # This uses the defined function. dothingstovars(“red”); # This example defines a function. sub dothingstovars { $variables = @_; do_something($variables); return $variables; } # This is the format to define a function. sub functionname { code } blue
  • 30. Creating Functions # This is the format to define a function. def functionname(parameters) code end Ruby @SarahKiniry #STC16
  • 31. Creating Functions # This is the format to define a function. def functionname(parameters) code end # This example defines a function. def Texas(name) var = "Howdy, " + name return var end Ruby @SarahKiniry #STC16
  • 32. Creating Functions Ruby @SarahKiniry #STC16 # This uses the defined function. Texas(Bob) # This is the format to define a function. def functionname(parameters) code end # This example defines a function. def Texas(name) var = "Howdy, " + name return var end
  • 33. Creating Functions Ruby @SarahKiniry #STC16 # This uses the defined function. Texas(Bob) # This is the format to define a function. def functionname(parameters) code end # This example defines a function. def Texas(name) var = "Howdy, " + name return var end Howdy, Bob
  • 34. Creating Functions # This is the format to define a function. def functionname(parameters): code return[value] Python @SarahKiniry #STC16
  • 35. Creating Functions # This example defines a function. def print_return(my_words) print my_words return[] Python @SarahKiniry #STC16 # This is the format to define a function. def functionname(parameters): code return[value]
  • 36. Creating Functions Python @SarahKiniry #STC16 # This uses the defined function. print_return(“Hey everybody!") # This example defines a function. def print_return(my_words) print my_words return[] # This is the format to define a function. def functionname(parameters): code return[value]
  • 37. Creating Functions Python @SarahKiniry #STC16 # This uses the defined function. print_return(“Hey everybody!") # This example defines a function. def print_return(my_words) print my_words return[] # This is the format to define a function. def functionname(parameters): code return[value] Hey everybody!
  • 38. Variables The names of stored values that code uses to perform actions. This can mean strings (text), numbers, or boolean values (true/false). There are also methods of storing groups of values, such as arrays or hashes.
  • 39. Variables variable_name Java, JavaScript, C, C#, Python $variable_name PHP, Perl, Ruby @variable_name Perl, Ruby %variable_name Perl (and arrays and hashes) @SarahKiniry #STC16
  • 40. Important Value Types Files example.txt, example.jpg, example.php Directories Linux: /example/directory or example/directory/ Windows: C:exampledirectory or ..exampledirectory Settings managed, unmanaged; blue, green, red; 0, 1 @SarahKiniry #STC16
  • 41. Variables my $file = example.txt; $color = blue; $do_something = 1; @SarahKiniry #STC16
  • 43. The Hello World Story 1 2 3 What does the application do? What text will the user see? Which files or settings? @SarahKiniry #STC16
  • 44. The Hello World Story 1 2 3 What does the application do?
 This application displays a message to the user. What text will the user see? Which files or settings? @SarahKiniry #STC16
  • 45. The Hello World Story 1 2 3 What does the application do?
 This application displays a message to the user. What text will the user see?
 The user will see the text “Hello World.” Which files or settings? @SarahKiniry #STC16
  • 46. The Hello World Story 1 2 3 What does the application do?
 This application displays a message to the user. What text will the user see?
 The user will see the text “Hello World.” Which files or settings?
 No other files or settings are involved. @SarahKiniry #STC16
  • 47. Hello, Java! /* This is a Hello World script. */ class HelloWorldApp { public static void main(String[] args) { // Display the string. System.out.println("Hello World!"); } } @SarahKiniry #STC16
  • 48. Hello, Java! /* This is a Hello World script. */ class HelloWorldApp { public static void main(String[] args) { // Display the string. System.out.println("Hello World!"); } } @SarahKiniry #STC16
  • 49. Hello, Java! /* This is a Hello World script. */ class HelloWorldApp { public static void main(String[] args) { // Display the string. System.out.println("Hello World!"); } } @SarahKiniry #STC16
  • 50. Hello, JavaScript! <script language=“Javascript"> // Write to browser window. document.write("Hello World!"); </script> @SarahKiniry #STC16
  • 51. Hello, JavaScript! <script language=“Javascript"> // Write to browser window. document.write("Hello World!"); </script> @SarahKiniry #STC16
  • 52. Hello, JavaScript! <script language=“Javascript"> // Write to browser window. document.write("Hello World!"); </script> @SarahKiniry #STC16
  • 53. Hello, C! /* Hello World */ void main() { printf("Hello World!"); } @SarahKiniry #STC16
  • 54. Hello, C! /* Hello World */ void main() { printf("Hello World!"); }
  • 55. Hello, C! /* Hello World */ void main() { printf("Hello World!"); }
  • 56. Hello, C#! /// Let’s say Hello. using System; namespace HelloWorld { class Hello { static void Main() { Console.WriteLine("Hello World!"); } } } @SarahKiniry #STC16
  • 57. Hello, C#! /// Let’s say Hello. using System; namespace HelloWorld { class Hello { static void Main() { Console.WriteLine("Hello World!"); } } }
  • 58. Hello, C#! /// Let’s say Hello. using System; namespace HelloWorld { class Hello { static void Main() { Console.WriteLine("Hello World!"); } } }
  • 59. Hello, PHP! // Tell them hello in PHP. <?php echo "Hello World!"; ?> @SarahKiniry #STC16
  • 60. Hello, PHP! // Tell them hello in PHP. <?php echo "Hello World!"; ?>
  • 61. Hello, PHP! // Tell them hello in PHP. <?php echo "Hello World!"; ?>
  • 62. Hello, Perl! #!/usr/bin/perl # We’ll call this a Perl of wisdom. print "Hello World!"; @SarahKiniry #STC16
  • 63. Hello, Perl! #!/usr/bin/perl # We’ll call this a Perl of wisdom. print "Hello World!";
  • 64. Hello, Perl! #!/usr/bin/perl # We’ll call this a Perl of wisdom. print "Hello World!";
  • 65. Hello, Ruby! #!/usr/bin/ruby -w # First Perl, now Ruby? Shiny. puts "Hello, world!" =begin Really though, who knew there were two programming languages named after gemstones, even if one is kind of misspelled? =end @SarahKiniry #STC16
  • 66. Hello, Ruby! #!/usr/bin/ruby -w # First Perl, now Ruby? Shiny. puts "Hello, world!" =begin Really though, who knew there were two programming languages named after gemstones, even if one is kind of misspelled? =end
  • 67. Hello, Ruby! #!/usr/bin/ruby -w # First Perl, now Ruby? Shiny. puts "Hello, world!" =begin Really though, who knew there were two programming languages named after gemstones, even if one is kind of misspelled? =end
  • 68. Hello, Python! # A lot of programming languages use # hashes for their comment character. print("Hello, World!") """ But they tend to diverge when it comes to multiline comments. """ @SarahKiniry #STC16
  • 69. Hello, Python! # A lot of programming languages use # hashes for their comment character. print("Hello, World!") """ But they tend to diverge when it comes to multiline comments. """
  • 70. Hello, Python! # A lot of programming languages use # hashes for their comment character. print("Hello, World!") """ But they tend to diverge when it comes to multiline comments. """
  • 72. More JavaScript <h1>JavaScript Can Change Images</h1> <img id="myImage" onclick="changeImage()" src="pic_bulboff.gif" width="100" height="180"> <script> function changeImage() { var image = document.getElementById('myImage'); if (image.src.match("bulbon")) { image.src = "pic_bulboff.gif"; } else { image.src = "pic_bulbon.gif"; } } </script> JavaScript code example from w3schools.com @SarahKiniry #STC16
  • 73. More JavaScript JavaScript code example from w3schools.com <h1>JavaScript Can Change Images</h1> <img id="myImage" onclick="changeImage()" src="pic_bulboff.gif" width="100" height="180"> <script> function changeImage() { var image = document.getElementById('myImage'); if (image.src.match("bulbon")) { image.src = "pic_bulboff.gif"; } else { image.src = "pic_bulbon.gif"; } } </script> @SarahKiniry #STC16
  • 74. More JavaScript JavaScript code example from w3schools.com <h1>JavaScript Can Change Images</h1> <img id="myImage" onclick="changeImage()" src="pic_bulboff.gif" width="100" height="180"> <script> function changeImage() { var image = document.getElementById('myImage'); if (image.src.match("bulbon")) { image.src = "pic_bulboff.gif"; } else { image.src = "pic_bulbon.gif"; } } </script> @SarahKiniry #STC16
  • 75. More JavaScript JavaScript code example from w3schools.com <h1>JavaScript Can Change Images</h1> <img id="myImage" onclick="changeImage()" src="pic_bulboff.gif" width="100" height="180"> <script> function changeImage() { var image = document.getElementById('myImage'); if (image.src.match("bulbon")) { image.src = "pic_bulboff.gif"; } else { image.src = "pic_bulbon.gif"; } } </script> @SarahKiniry #STC16
  • 76. More JavaScript JavaScript code example from w3schools.com <h1>JavaScript Can Change Images</h1> <img id="myImage" onclick="changeImage()" src="pic_bulboff.gif" width="100" height="180"> <script> function changeImage() { var image = document.getElementById('myImage'); if (image.src.match("bulbon")) { image.src = "pic_bulboff.gif"; } else { image.src = "pic_bulbon.gif"; } } </script> @SarahKiniry #STC16
  • 77. More JavaScript JavaScript code example from w3schools.com <h1>JavaScript Can Change Images</h1> <img id="myImage" onclick="changeImage()" src="pic_bulboff.gif" width="100" height="180"> <script> function changeImage() { var image = document.getElementById('myImage'); if (image.src.match("bulbon")) { image.src = "pic_bulboff.gif"; } else { image.src = "pic_bulbon.gif"; } } </script> @SarahKiniry #STC16
  • 78. More JavaScript JavaScript code example from w3schools.com <h1>JavaScript Can Change Images</h1> <img id="myImage" onclick="changeImage()" src="pic_bulboff.gif" width="100" height="180"> <script> function changeImage() { var image = document.getElementById('myImage'); if (image.src.match("bulbon")) { image.src = "pic_bulboff.gif"; } else { image.src = "pic_bulbon.gif"; } } </script> @SarahKiniry #STC16
  • 79. What’s The Story? 1 2 3 What does the application do? What text will the user see? Which files or settings? @SarahKiniry #STC16
  • 80. What’s The Story? 1 2 3 What does the application do?
 This application switches between two images. What text will the user see? Which files or settings? @SarahKiniry #STC16
  • 81. What’s The Story? 1 2 3 What does the application do?
 This application switches between two images. What text will the user see?
 “Javascript Can Change Images” Which files or settings? @SarahKiniry #STC16
  • 82. What’s The Story? 1 2 3 What does the application do?
 This application switches between two images. What text will the user see?
 “Javascript Can Change Images” Which files or settings?
 pic_bulbon.gif and pic_bulboff.gif, width=100, height=180 @SarahKiniry #STC16
  • 83. More JavaScript JavaScript code example from w3schools.com @SarahKiniry #STC16
  • 84. More JavaScript JavaScript code example from w3schools.com @SarahKiniry #STC16