Programming Languages and Software Engineering - PowerPoint PPT Presentation


PPT – Programming Languages and Software Engineering PowerPoint presentation | free to download - id: 6ee74d-NjJkY


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation

Programming Languages and Software Engineering


Programming Languages and Software Engineering Topics discuss some of the underlying commonalities and differences among programming languages explain what there is ... – PowerPoint PPT presentation

Number of Views:49
Avg rating:3.0/5.0
Slides: 17
Provided by: Thoma491


Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: Programming Languages and Software Engineering

Programming Languages and Software Engineering
  • discuss some of the underlying commonalities and
    differences among programming languages
  • explain what there is to learn about software
    engineering beyond programming

Learn Programming in Ten Years(Peter Norvig)
  • it takes time/practice/experience to learn to
    become a good programmer
  • you can learn syntax in one semester (or from a
    book), but...
  • need to built up a repertoire of problems you
    have previously solved, so when you face a new
    problem, you can draw upon your prior experience,
    youve seen it before design patterns

  • Norvigs suggestions
  • Get interested in programming, and do some
    because it is fun..
  • Program. The best kind of learning is learning by
  • Talk with other programmers read other programs.
  • Work on projects with other programmers.
  • Work on projects after other programmers.
  • Learn at least a half dozen programming
  • Remember that there is a "computer" in "computer
    science". Understand how it works.
  • Get involved in a language standardization

  • In CSCE 121, we teach C because it is widely
    used for large industrial applications.
  • Many additional computational concepts are
    introduced in this course, such as how compilers
    work, object-oriented design, etc.
  • There are many other languages - do you need to
    learn them all?

  • Assembler
  • Fortran, Pascal, COBOL, Basic
  • Ada, Modula, PL/1, Simula, MatLAB
  • Haskell, LISP, Scheme
  • C, C, C, Objective-C
  • Smalltalk, Java, Javascript
  • PERL, PHP, TCL, Python, Ruby
  • csh, awk, sed
  • Prolog a logic-based language for making
    inferences from knowledge bases
  • Postscript a stack-based language for printers

source http//
Two Interesting Questions
  • Why are there such a bewildering array of
  • historical artifact some languages evolved
    into, or inspired, other languages
  • some languages started out as experiments to test
    new ideas or features, like OO and
    message-passing in Smalltalk
  • some languages are more suited for certain
    applications, like Fortran for numerical
    computing, or PERL/Python for processing text
  • there are special-purpose languages like
    Postscript (or MatLAB, Simula) that are
    custom-designed for certain tasks (printing,

Two Interesting Questions
  • Isnt C overkill for writing low-level code
    like drivers/controllers/firmware? wouldnt C be
    much more efficient with less overhead?
  • this is a common misconception
  • by this reasoning, why not use assembler?
  • modern C compilers have many optimizations that
    make code fast/competitive
  • most importantly, C allows code to be expressed
    in a more comprehensible (generic, factored) way
    that facilitates maintainability and long-term
    use of code over many years
  • these issues often outweigh a few extra
  • the original programmer might be long gone, and
    someone else has to find and fix a bug

  • The same algorithm can be implemented in many
    programming languages.

in C
in Python
in Java
import sys if __name____main__ a
int(sys.argv1) b int(sys.argv2) if
altb b,a a,b while bgt0 r ab
a,b b,r print GCD is,a
include ltstdio.hgt void main(int
argc,charargv) int a,b,temp
sscanf(argv1,d,a) sscanf(argv2,d,b)
if (altb) tempa ab btemp while
(bgt0) int rab ab br
printf(GCD is d\n,a)
public class GCD public static void
main(String args) int a,b,temp
rseInt(args0) bInteger.parseInt(args1)
if (altb) tempa ab btemp while
(bgt0) int rab ab br
System.out.println( "GCD is "a)
  • Point 1 Once you understand the general
    principles (which you will learn in CSCE 314),
    you just have to learn the syntactic variations
    in each language
  • Point 2 There are some unique language
    differences/features including user-created
    types, polymorphism, list comprehension,
    exceptions, function objects...

  • In CSCE 314, you will learn the structure of
    languages and what unites them, so you can
    eventually learn to program in any of them
  • major classes of languages
  • imperative/procedural languages
  • Pascal, Fortran, C, Ada...
  • functional languages (expression evaluation)
  • Scheme, LISP, Haskell...
  • object-oriented (encapsulation, message
  • Smalltalk, Java, Objective-C, C
  • logic-programming
  • Prolog
  • (of course, some languages blur these

  • I already showed examples of procedural
  • here is the functional version of factorial and
    GCD written in LISP
  • (this is an interactive command line I typed
  • gt(defun fact (n) (if (lt n 1) 1 ( n (fact (- n
  • FACT
  • gt(fact 10)
  • 3628800
  • gt(defun gcd (x y)
  • (if (lt x y) (gcd y x)
  • (if ( y 0) x (gcd y (mod x
  • GCD
  • gt(gcd 112 40) // running a program is done by
    evaluating an expression
  • 8

  • interpreted vs. compiled languages
  • interpreters read in lines and execute directly
  • compilers
  • convert source code to low-level language (.exe,
    assembly language, executable CPU instructions)
  • have to learn about regular expressions, parsing,
    syntax and semantics, optimization...
  • compare Python and C
  • block structure
  • think how the body of a for loop or if
    statement is marked in different languages (,
    endfor, change of indentation)
  • type systems
  • can users define new types and operations on
    them? like structs and classes, example Complex
  • object-oriented languages
  • classes, inheritance, polymorphism...
  • extensions for concurrency, exception-handling,
    real-time applications...

  • Here is an example of an object-oriented
    definition of Rectangles in Java

public class Rectangle int height,width //
interval variables // initializer public
Rectangle(int a,int b) heighta widthb
int area() return heightwidth
static Rectangle BoundingBox( Rectangle
A,Rectangle B) int hmax(A.height,B.height)
int wmax(A.width,B.width) Rectangle Cnew
Rectangle(h,w) return C
public static void main(String args)
Rectangle Pnew Rectangle(3,2) Rectangle
Qnew Rectangle(1,4) Rectangle
RBoundingBox(p,q) System.out.println(
P(3,2) area"P.area()) System.out.println(
Q(1x4) area"Q.area())
System.out.println( R(3x4)
27 sungt java local/testRectangle p(3,2)
area6 q(1x4) area4 r(3x4) area12
P h3, w2
R h3, w4
Q h1, w4
Learning Unix (part of CSCE 312/Systems)
  • why learn this? is it necessary?
  • many command-line development tools
  • (compared to IDEs like MS Visual Studio)
  • Unix has well-defined concepts and principles
  • executables, flags, pipes, streams, sockets...
  • multitasking
  • many powerful tools for software development
  • editors like Emacs
  • compilers like g
  • make files (for multi-file projects)
  • debuggers like gdb
  • source-code control like CVS or SVN

Software Engineering (CSCE 431)
  • software engineering usually involves working in
  • requirements gathering/writing specifications
    (with customer)
  • UML (Unified Modeling Language)
  • diagram out how your modules work and interact
  • libraries reuse of code
  • e.g. APIs for image processing, network access,
    speech recog...
  • large projects have many dependencies
  • testing defining test cases as important as
    writing code
  • documentation
  • explain how things work, why it was designed that
    way, ASSUMPTIONS, alternatives, limitations...
  • version control
  • issue new number with each change to file, e.g.
  • critical so you can identify and undo mistakes
  • life-cycle models
  • waterfall, rapid prototyping, extreme programming
  • metrics for tracking/estimating number of bugs
    over time