CS 151 Fall 2003 - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

CS 151 Fall 2003

Description:

CS 151 - Fall 2003. Things we didn't have time to cover. Bits of C we didn't cover ... While C is a good place to start learning about langauges, not the final word ... – PowerPoint PPT presentation

Number of Views:25
Avg rating:3.0/5.0
Slides: 15
Provided by: timoth90
Category:
Tags: fall | langauges

less

Transcript and Presenter's Notes

Title: CS 151 Fall 2003


1
CS 151 - Fall 2003
  • Things we didn't have time to cover

2
Bits of C we didn't cover
  • We've covered most of the C language, just a few
    small items
  • Lots of libraries we didn't cover
  • Small bits of syntax, such as the enuemration

3
Enumerations
  • A way to make a small discrete set of values
  • enum colors Red, Blue, Yellow
  • enum days Monday, Tuesday, Wednesday
  • creates a new set of constants (Red, Blue, etc)
    and a new type (colors)

4
Creating variables of type
  • Can create variables of the type
  • enum colors myFavoriteColor
  • myFavoriteColor Red
  • unfortunately, doesn't print the way you would
    expect

5
printing enumerations
  • printf("My favorite color is d",
    myFavoriteColor)
  • myFavoriteColor is 3
  • shows that under the hood enumerations are just
    integers. No, it cannot be printed as a string.

6
Bigger Topics
  • Programming C is just the first tiny step on the
    path to computer science.
  • How to organize and structure large tasks,
    perhaps involving many programming - software
    engineering
  • Other programming languages and styles, OOP,
    functional programming, logic programming

7
Software Engineering
  • Programming is similar to other engineering
    activities (building bridges) and in some ways
    very different.
  • Example Adding people to a programming team will
    often make it go more slowly, not faster.

8
One Saying
  • Fred Brooks used to say
  • "It takes nine months to create a child, no
    matter now many women are assigned to the task"
  • Major problem in software teams in communication,
    not programming - gets worse more people you have

9
So how to you handle complexity?
  • So how do you handle complexity?
  • Better languages, better tools, better
    organizational techniques
  • Will see this in many of your future classes.

10
Languages
  • While C is a good place to start learning about
    langauges, not the final word
  • Object-Oriented Languages, Functional Languages,
    Logic Languages, Scripting Languages,
    Coordination Languages, visual languages, etc etc

11
Object-Oriented Languages
  • The next bit you will study (if you take the next
    class). OO languages - Java, C, etc.
  • Organize complex tasks in terms of services.
  • A Program is viewed as an organization, or team.
    Each member of the team provides services that
    the others use.

12
Vending machine
  • Vending machine example
  • Coin handler, does nothing more than take and
    give coins, keep balance
  • Dispender, knows what is in machine, can dispense
  • Selection button - knows when it is pressed, and
    can set display

13
Functional Languages
  • Based on expressions, function invocations, not
    variables.
  • Computation is building a function (using
    existing functions), not incremental changes to
    state
  • Much cleaner, but does it scale to large projects?

14
Many more paradigms
  • You will learn about many more paradigms in 381,
    elsewhere.
  • Believe me, you have just scratched the surface !
Write a Comment
User Comments (0)
About PowerShow.com