Sie sind auf Seite 1von 26

Introduction to Programming

Fundamentals
B.Sathis Kumar
Aligning Student Competencies
Employability Competencies Seminars Industry Visits Learning
Resources
English Language Fluency Industry Trends Quiz Contests Paper
• Comprehension • Written & Oral Comm • Essays
Presentations
• Articulation • Essay Writing • Technical Papers
Project
• PersuasionBank Online
• Assessments
Technical papers • Reports Book

Quality/ Process Orientation Reviews


• TQM • CMM • Projects
Integrated • SW QA

• Communication • Time Management • Communication lab


Life Skills •Team work • Customer Interaction • Team work Projects
• Discussions, • Goal Setting • Group Discussions

ted
Decisions and Presn. • Analytical Skills
• Ethics and Etiquette
g r a • Team problem solving
Inte
• Computer H/w, OS • Client – Server • Hw/, OS, N/W
• RDBMS • OOAD • Programming
Basic IT Competencies • Programming • Project Management Concepts
• S/W Development • Adv. Programming • RDBMS
Methodology • Internet Applications • UI Design
• Internet Technology • S/W Testing
• Algorithms, UI, OO • SDM

Professional Core Lecture Tutorial Practical


B.SATHIS KUMAR VITCC 2
Programming Fundamentals

It’s about:
a) foundations of programming langauges
b) but also how to design your own languages
c) how to implement them
d) and about PL tools, such as analyzers
e) also learn about some classical C.S. algorithms.

B.SATHIS KUMAR VITCC 3


3
Why a software
engineer/developer needs PL
New languages will keep coming
– Understand them, choose the right one.
Write code that writes code
– Be the wizard, not the typist.
Develop your own language.
– Are you kidding? No.
Learn about compilers and interpreters.
– Programmer’s main tools.
B.SATHIS KUMAR VITCC 4
4
New Languages will Keep
Coming

B.SATHIS KUMAR VITCC 5


The Reality...
XSLT XQuery
bash
Python javascript
perl C#
Haskell
ActionScript C
Java SQL
Ruby Ocaml
awk C++ latex
PHP
Tcl/TK postscript make ML
Visual Basic B.SATHIS KUMAR VITCC regular 6
A survey: how many languages
did you use?
• Let’s list them here:

B.SATHIS KUMAR VITCC 7


7
Explosive Growth
In the past 20 years, computer science has
deepened intellectually, broadened in scope, and
penetrated all areas of modern life.
The web, electronic commerce, social networks,
graphics, gaming, image processing, security,
natural language processing, bio informatics,
machine learning, multi-core processors, sensor
networks, Google-style distributed processing,
XML, software transactions, databases,
operating systems, networks...
This growth puts enormous pressure on
undergraduate curriculum.
B.SATHIS KUMAR VITCC 8
Learning New Languages

it is more important that students


learn how to learn a language rather
than the particulars of a single
language.
Understanding PL fundamentals
makes learning languages much
easier.
B.SATHIS KUMAR VITCC 9
Be prepared to program in new
languages
Languages undergo constant change
– FORTRAN 1953
– ALGOL 60 1960
–C 1973
– C++ 1985
– Java 1995
Evolution steps: 12 years per widely
adopted language

B.SATHIS KUMAR VITCC 10


10
Develop your own language
Are you kidding? No. Guess who developed:
– PHP
– Ruby
– JavaScript
– perl
Done by smart students like you
Our goal: learn good academic lessons
– so that your future languages avoid known mistakes

B.SATHIS KUMAR VITCC 11


11
Building Languages
Not many people design new general-
purpose languages.
But many people design APIs, configuration
languages, and domain-specific languages.
Understanding PL fundamentals allows
students to know when and how to build
such “little languages”.
What are the abstractions? How do they
interact? What should be expressible? What
should not be?
B.SATHIS KUMAR VITCC 12
Trends in Programming
Languages

B.SATHIS KUMAR VITCC 13


Trends in programming
languages
programming language and its interpreter/compiler:
– programmer’s primary tools
– you must know them inside out

languages have been constantly evolving ...


– what are the forces driving the change?

... and will keep doing so


– to predict the future, let’s examine the history…

B.SATHIS KUMAR VITCC 14


14
ENIAC (1946, University of
Philadelphia)
ENIAC program for external ballistic equations:

B.SATHIS KUMAR VITCC 15


15
Programming the ENIAC

B.SATHIS KUMAR VITCC 16


16
ENIAC (1946, University of
Philadelphia)
programming done by
– rewiring the interconnections
– to set up desired formulas,
etc
Problem (what’s the tedious
part?)
– programming = rewiring
– slow, error-prone
solution:
– store the program in
memory! B.SATHIS KUMAR VITCC 17
17
– birth of von Neuman
UDSAC (1947, Cambridge
University)
the first real computer
– large-scale, fully functional, stored-program
electronic digital computer (by Maurice Wilkes)
problem: Wilkes realized:
– “a good part of the remainder of my life was going to
be spent in finding errors in ... programs”
solution: procedures (1951)
– procedure: abstracts away the implementation
– reusable software was born

B.SATHIS KUMAR VITCC 18


18
Assembly – the language
(UNIVAC 1, 1950)
Idea: mnemonic (assembly) code
– Then translate it to machine code by hand (no compiler yet)
– write programs with mnemonic codes (add, sub),
with symbolic labels,
– then assign addresses by hand
Example of symbolic assembler
clear-and-add a
add b
store c
translate it by hand to something like this (understood by CPU)
B100 A200
C300

B.SATHIS KUMAR VITCC 19


19
Example

B.SATHIS KUMAR VITCC 20


Assembler – the compiler
(Manchester, 1952)
• it was assembler nearly as we know it, called
AutoCode

B.SATHIS KUMAR VITCC 21


21
Assembly programming caught
on, but

Problem: Software costs exceeded hardware


costs!

John Backus: “Speedcoding”


– An interpreter for a high-level language
– Ran 10-20 times slower than hand-written
assembly
• way too slow
B.SATHIS KUMAR VITCC 22
22
FORTRAN I (1954-57)
Langauge, and the first compiler
– Produced code almost as good as hand-written
– Huge impact on computer science (laid foundations for cs164)
– Modern compilers
– FORTRAN (the language) still in use today

By 1958, >50% of all software is in FORTRAN

Cut development time dramatically

B.SATHIS KUMAR VITCC 23


23
Goto considered harmful
L1: statement
if expression goto L1
statement

Dijkstra says: gotos are harmful


– use structured programming
– lose some performance, gain a lot of readability
how do you rewrite the above code into structured
form?
B.SATHIS KUMAR VITCC 24
24
Object-oriented programming
(1970s)

OO approach
• Model the world as it is

• Simulation based modelling

B.SATHIS KUMAR VITCC 25


25
Review of historic development
• wired interconnects  stored program (von
Neuman machines)
• lots of common bugs in repeated code 
procedures
• machine code  symbolic assembly (compiled
by hand)
• tedious compilation  assembler (the assembly
compiler)
• assembly  FORTRAN I
• gotos  structured programming 
“OO” programming inheritance,
B.SATHIS KUMAR VITCC 26
26

Das könnte Ihnen auch gefallen