السلام عليكم و رحمة الله :-
سأقوم بالقاء محاضرة بعنوان مدخل الى عالم البرمجة و هذه مسودة ابتدائية ، و انا في مرحلة جمع الاقتراحات .... ارجو الاطلاع على الهيكل الاولي هنا و الذي ارفقته كنص لمشاكل واجهتني في عرض السلايدات ... ارجو عدم الاهتمام بالمظهر فقط المهم هو العناوين التي كل واحد منها سلايد مستقل ...
What is programming?
Programs vs. Scripts
Compiled vs Interpreted
Dynamic vs. Static
Source vs. binary
Desktop vs. Web
ServerSide vs. ClientSide
What do you need?
What do you need ?
Or just use and IDE:
What do you need ?
Or just use and IDE:
What do you need ?
Or just use and IDE:
What do you need ?
Or just use and IDE:
What do you need ?
Or just use and IDE:
Program. Langs. Categorization --- my own classification for ease
Microsoft(Windows): vb, asp, C#, .NET..etc
Unix: C|C++, python, perl, php, ruby…etc
Sun JVM: Java, Groovy, Fortress, Scala, Jython…etc.
Programming Paradigm:
A programming paradigm is a fundamental style of computer programming. (Compare with a methodology, which is a style of solving specific software engineering problems.) Paradigms differ in the concepts and abstractions used to represent the elements of a program (such as objects, functions, variables, constraints, etc.) and the steps that compose a computation (assignment, evaluation, continuations, data flows, etc.).
Procedural Prog.
Sequenced
Like get two numbers, add them, return the result.
Subroutines:
Modules
Ready to use libraries for the language:
Like bindings for GUI libraries, or facilities to work with internet, etc.
CPAN…
Object Oriented
Objects
Data fields
Methods
Classes
Inheritence
Polymorphism
Overloading vs OverRiding
Pure OO vs Hybird
GUI programing:
Event Driven programing:
Exceptions
Exceptions:
Eval
$total = 13/0;
print $total;
Program fails with: Illegal division by zero
Exceptions
Defensive programming:
$a= 10;
$b = 0;
if ($b == 0){ print"you are trying to divide by zero"}
else { print $a/$b;}
Extreme Programing
Tests
How to become a programer?
“Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter.”
(Eric Raymond)
Teach yourself prog. In ten years:
Get interested in programming, and do some because it is fun. Make sure that it keeps being enough fun so that you will be willing to put in ten years.
Talk to other programmers; read other programs. This is more important than any book or training course.
Program. The best kind of learning is learning by doing.
If you want, put in four years at a college (or more at a graduate school). This will give you access to some jobs that require credentials, and it will give you a deeper understanding of the field, but if you don't enjoy school, you can (with some dedication) get similar experience on the job. In any case, book learning alone won't be enough.
Teach yourself prog. In ten years:
Work on projects with other programmers. Be the best programmer on some projects; be the worst on some others.
Work on projects after other programmers. Be involved in understanding a program written by someone else. See what it takes to understand and fix it when the original programmers are not around. Think about how to design your programs to make it easier for those who will maintain it after you.
Learn at least a half dozen programming languages.
Remember that there is a "computer" in "computer science". Know how long it takes your computer to execute an instruction, fetch a word from memory (with and without a cache miss), read consecutive words from disk, and seek to a new location on disk.
Get involved in a language standardization effort.
Have the good sense to get off the language standardization effort as quickly as possible.
Programers virtues:
Laziness - The quality that makes you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful, and document what you wrote so you don't have to answer so many questions about it. Hence, the first great virtue of a programmer.
Impatience - The anger you feel when the computer is being lazy. This makes you write programs that don't just react to your needs, but actually anticipate them. Or at least pretend to.
Hubris - Excessive pride, the sort of thing Zeus zaps you for. Also the quality that makes you write (and maintain) programs that other people won't want to say bad things about.
The END
Any questions?
سأقوم بالقاء محاضرة بعنوان مدخل الى عالم البرمجة و هذه مسودة ابتدائية ، و انا في مرحلة جمع الاقتراحات .... ارجو الاطلاع على الهيكل الاولي هنا و الذي ارفقته كنص لمشاكل واجهتني في عرض السلايدات ... ارجو عدم الاهتمام بالمظهر فقط المهم هو العناوين التي كل واحد منها سلايد مستقل ...
كود:
بسم الله الرحمن الرحيم اللهم صلي على محمد و ال محمد مدخــــــــــل الى عالم البرمجة اعداد علي آل ياسين [EMAIL="Perl_so[email protected]"][email protected][/EMAIL]
Programs vs. Scripts
Compiled vs Interpreted
Dynamic vs. Static
Source vs. binary
Desktop vs. Web
ServerSide vs. ClientSide
What do you need?
- Text Editor
- Compiler or Interpreter
What do you need ?
Or just use and IDE:
What do you need ?
Or just use and IDE:
What do you need ?
Or just use and IDE:
What do you need ?
Or just use and IDE:
What do you need ?
Or just use and IDE:
Program. Langs. Categorization --- my own classification for ease
Microsoft(Windows): vb, asp, C#, .NET..etc
Unix: C|C++, python, perl, php, ruby…etc
Sun JVM: Java, Groovy, Fortress, Scala, Jython…etc.
Programming Paradigm:
A programming paradigm is a fundamental style of computer programming. (Compare with a methodology, which is a style of solving specific software engineering problems.) Paradigms differ in the concepts and abstractions used to represent the elements of a program (such as objects, functions, variables, constraints, etc.) and the steps that compose a computation (assignment, evaluation, continuations, data flows, etc.).
- Programming Paradigms:
- Procedural
- Object Oriented
- Event driven
- Functional
Procedural Prog.
Sequenced
Like get two numbers, add them, return the result.
كود PHP:
{my $number =1;
my $number2 =2;
print $number+$number2;
}
كود PHP:
Control Structeres
IF statement:
if ($user eq "Ali")
{print "Access granted!"}
Adding else:
else{ print "I don't know you"}
Introducing more conditions:
elsif($user eq "fatima")
{print "I love u!"}
Control Structeres
Unless:
unless($a == 10)
{
print "The number isn't 10";}
if ($a != 10)
{
print "The number isn't 10";
}
Control Structres:
FOR
for (1..10)
{print "looping 10 times!\n"}
Long style:
for ($a=0;$a<10;$a++)
{print "loop $a"}
Control Structers
Foreach :
my @list = qw/Ali Sara Yosra Mamdoh/;
foreach (@list){
print $_, " You are a member of the family!\n";
}
Control Structers:
WHILE
$a= 10;
while ($a != 0)
{print $a--;}
Ouputs: 10987654321
Control Structers:
Introducing until:
my $controller = 10;
until ($controller == 20)
{
print"going up unitl 19\n";
$controller++;
}
Control Structers
given( $name ){
when("Ali"){ say "welcome $name your are the 1st"}
when("Saleh"){say "welcome $name your are the 2nd"}
when("Hashem"){say "welcome $name your are the 3d"}
default{say "I don't know you"}}
Control Structures
use Switch;
switch ( $name ){
case "Ali" { say "welcome $name your are the 1st"}
case "Saleh" {say "welcome $name your are the 2nd"}
case "Hashem" {say "welcome $name your are the 3d"}
else {say "I don't know you"}
}
Expression Modifiers
use 5.010;
$bool = 1;
$a = 5;
say "I am in love" if $bool;
say "false" unless $bool;
say "my name is", ($a++) while $a < 9;
Records
Variable : can hold one item only;
my $number = 1;
Array: can hold more than one item
my @array = qw\ali yasser salman\;
print $array[0];
Records
Null value:
if (defined($my_total)){}
my $var = undef;
Records
Hashes:
my %hash= qw/
0555555 ali
0666666 yasser
0899999 basem/;
foreach $phoneNumber(keys %hash)
{
print "$phoneNumber = $hash{$phoneNumber} \n"}
Subroutines:
Chunks of frequent used code: like headers, footers,..etc
&hello(); sub hello(){
print "welcome to ali website";}
Passing parameters:
&hello("Visitor1"); sub hello(){
$name = shift;
print "welcome to ali website\n";
print "welcome $name";}
كود PHP:
Passing more than one item:
&hello("Visitor1","Visitor2");
sub hello(){my ($name1, $name2) = @_;
print "welcome to ali website\n";
print "welcome $name1";
print "welcome $name2";}
Returning:
print &hello();
sub hello(){
return 1;}
Scoping:
$total = 10;
$number = 12;
&adding($number);
sub adding()
{
$number = shift;
$total = $total + --$number;
}
print $number;
print $total;
Naked block Control Structer
{
my $name = "Ali", $age="24", $location="SA";
print $name;
print $age;
print $location
}
Regular Expressions:
if($string =~ m/(A|E|I|O|U|Y|a|e|i|o|u|y)/)
{print "String contains a vowel!\n"}
$string =~ s/Ali Yami/Ali Qahtani/;
Change everything to upper case: $string =~ tr/[a-z]/[A-Z]/;
Change everything to lower case $string =~ tr/[A-Z]/[a-z]/;
Ready to use libraries for the language:
Like bindings for GUI libraries, or facilities to work with internet, etc.
CPAN…
Object Oriented
Objects
Data fields
Methods
Classes
Inheritence
Polymorphism
Overloading vs OverRiding
Pure OO vs Hybird
GUI programing:
Event Driven programing:
Exceptions
Exceptions:
Eval
$total = 13/0;
print $total;
Program fails with: Illegal division by zero
Exceptions
Defensive programming:
$a= 10;
$b = 0;
if ($b == 0){ print"you are trying to divide by zero"}
else { print $a/$b;}
Extreme Programing
Tests
كود PHP:
use Test::Simple tests => 2;
use Date::ICal;
my $ical = Date::ICal->new; # create an object
ok( defined $ical ); # check that we got something
ok( $ical->isa('Date::ICal') ); # and it's the right class
- Test Driven Development
- closures
- recursion
How to become a programer?
“Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter.”
(Eric Raymond)
Teach yourself prog. In ten years:
Get interested in programming, and do some because it is fun. Make sure that it keeps being enough fun so that you will be willing to put in ten years.
Talk to other programmers; read other programs. This is more important than any book or training course.
Program. The best kind of learning is learning by doing.
If you want, put in four years at a college (or more at a graduate school). This will give you access to some jobs that require credentials, and it will give you a deeper understanding of the field, but if you don't enjoy school, you can (with some dedication) get similar experience on the job. In any case, book learning alone won't be enough.
Teach yourself prog. In ten years:
Work on projects with other programmers. Be the best programmer on some projects; be the worst on some others.
Work on projects after other programmers. Be involved in understanding a program written by someone else. See what it takes to understand and fix it when the original programmers are not around. Think about how to design your programs to make it easier for those who will maintain it after you.
Learn at least a half dozen programming languages.
Remember that there is a "computer" in "computer science". Know how long it takes your computer to execute an instruction, fetch a word from memory (with and without a cache miss), read consecutive words from disk, and seek to a new location on disk.
Get involved in a language standardization effort.
Have the good sense to get off the language standardization effort as quickly as possible.
Programers virtues:
Laziness - The quality that makes you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful, and document what you wrote so you don't have to answer so many questions about it. Hence, the first great virtue of a programmer.
Impatience - The anger you feel when the computer is being lazy. This makes you write programs that don't just react to your needs, but actually anticipate them. Or at least pretend to.
Hubris - Excessive pride, the sort of thing Zeus zaps you for. Also the quality that makes you write (and maintain) programs that other people won't want to say bad things about.
The END
Any questions?
تعليق