CS112: Introduction to Programming with C# at Yale University, Slides of C programming

An introduction to the cs112 course offered at yale university, which focuses on teaching elementary and intermediate programming techniques using the c# programming language. Students will learn how to design and code programs effectively, as well as important algorithms and data structures. The course uses microsoft visual studio .net and the .net framework for development. The document also discusses the history and features of c# and java, and the benefits of learning these languages for programming.

Typology: Slides

2010/2011

Uploaded on 10/05/2011

christina
christina 🇺🇸

4.6

(23)

393 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
CS 112 Introduction to Programming
Lecture 1: Introduction
Zhong Shao
Department of Computer Science
Yale University
314 AK Watson, Phone: 432-6828
2
Introduction
rProgramming is to solve problems using computers
How to do it at all ?
How to do it robustly ?
How to do it effectively ?
rProgramming consists of two steps:
Algorithmic design (the architects)
Coding (the construction workers)
rProgramming requires:
A programming language (e.g., C#) to express your ideas
A set of tools to design, edit, and debug your code
A compiler to translate your programs into machine code
A machine to run the executable code
3
Why CS112 ?
rComputer is becoming ubiquitous …
programming gets you more out of computer
learn how to solve problems
dealing with abstractions
be more precise
rUnfortunately, most people
know little about Computer Science
know little about Programming
write bad or buggy programs
become lost when writing large programs
rWhat can help? Take CS112 !
4
This Course
rThe goal of cs112 is to learn
elementary and intermediate programming techniques
how to craft medium and large programs
C# programming language (Java is similar)
important algorithms and data structures
software tools and operating systems
in-depth knowledge about Computer Science
rA heavy programming course
rUse Microsoft Visual Studio . NET C# Compiler
via Remote Desktop Client to three cs112 servers
rIntended mainly as you first programming course
5
Crafting Programs Effectively
rProgram design
design process
stepwise refinement & top-down design
bottom-up design
modularization, interfaces
use of abstractions
rProgramming style
structured programming
readable code
effective use of language constructs
“formatting”
software organization
rDocumentation and comments
6
Algorithms and Data Structures
rAlgorithm: a strategy for computing something, e.g.,
sorting: putting data in order by key
searching: finding data in some kind of index
finding primes and generating random numbers
string processing
graphics: drawing lines, arcs, and other geometric objects
rData structure: a way to store data, e.g.,
arrays and vectors
linked lists
rTwo are related:
data structures organize data
algorithms use that organization
pf3

Partial preview of the text

Download CS112: Introduction to Programming with C# at Yale University and more Slides C programming in PDF only on Docsity!

CS 112 Introduction to Programming

Lecture 1: Introduction

Zhong Shao

Department of Computer Science Yale University 314 AK Watson, Phone: 432- Email: [email protected]

2

Introduction

r Programming is to solve problems using computers

  • How to do it at all?
  • How to do it robustly?
  • How to do it effectively?

r Programming consists of two steps:

  • Algorithmic design (the architects)
  • Coding (the construction workers)

r Programming requires:

  • A programming language (e.g., C#) to express your ideas
  • A set of tools to design, edit, and debug your code
  • A compiler to translate your programs into machine code
  • A machine to run the executable code

3

Why CS112?

r Computer is becoming ubiquitous …

  • programming gets you more out of computer
  • learn how to solve problems
  • dealing with abstractions
  • be more precise

r Unfortunately, most people

  • know little about Computer Science
  • know little about Programming
  • write bad or buggy programs
  • become lost when writing large programs

r What can help? Take CS112!

4

This Course

r The goal of cs112 is to learn

  • elementary and intermediate programming techniques
  • how to craft medium and large programs
  • C# programming language (Java is similar)
  • important algorithms and data structures
  • software tools and operating systems
  • in-depth knowledge about Computer Science

r A heavy programming course

r Use Microsoft Visual Studio. NET C# Compiler

  • via Remote Desktop Client to three cs112 servers

r Intended mainly as you first programming course

5

Crafting Programs Effectively

r Program design

  • design process
  • stepwise refinement & top-down design
  • bottom-up design
  • modularization, interfaces
  • use of abstractions

r Programming style

  • structured programming
  • readable code
  • effective use of language constructs
  • “formatting”
  • software organization

r Documentation and comments

6

Algorithms and Data Structures

r Algorithm: a strategy for computing something, e.g.,

  • sorting: putting data in order by key
  • searching: finding data in some kind of index
  • finding primes and generating random numbers
  • string processing
  • graphics: drawing lines, arcs, and other geometric objects

r Data structure: a way to store data, e.g.,

  • arrays and vectors
  • linked lists

r Two are related:

  • data structures organize data
  • algorithms use that organization

7

Java Programming Language

r Sun Microsystems corporate research project (1991)

  • Code-named Green, led by James Gosling and Bill Joy
  • Based on C and C++

r Intended for intelligent consumer-electronic devices

  • Lack of popularity almost causes cancellation

r Sudden popularity of WWW provides new potential

  • Java capable of dynamic content (e.g., animation, interaction)
  • Grabbed attention of business community

r Now very widely used

  • Enhance functionality of WWW servers
  • Provide applications for consumer devices

8

.NET Framework

r Introduced by Microsoft (June 2000)

  • Vision for embracing the Internet in software development
  • Heart of .NET strategy

r Language- and “platform-” independence

  • Visual Basic .NET, Visual C++ .NET, C# and more
  • Includes Framework Class Library (FCL) for reuse

r Executes programs by Common Language Runtime (CLR)

  • Programs compiled to Microsoft Intermediate Language (MSIL)
  • MSIL code translated into machine code

r (Unlike Java) this is mostly Windows (MS) centric

  • There is a Linux port (see the Mono project)

9

C# Programming Language

r Developed at Microsoft by Anders Hejlsberg et al

r Event driven, object oriented, visual programming language

r Based from C, C++ and Java

r Incorporated into .NET platform

  • Web based applications can be distributed
  • Programs that can be accessed by anyone through any device
  • Allows communicating with different computer languages

r I ntegrated D esign E nvironment (IDE)

  • Makes programming and debugging fast and easy
  • R apid A pplication D evelopment (RAD)

10

Why C# and Java in CS112?

r They support so-called safe internet programming

r They are simpler than other object-oriented languages [C++]

r They are safe and robust --- no core dump or dead console

r They have good graphics package

r They are related to C and C++

r They have good client-server and network support

r They are good for your summer job

r However, they are not easy to learn; each has many features …

r Right now, C# has a better buzz than Java

11

Learning C#

r Just like learning any new language

r Syntax: “new words”

r Grammar: how to put them together

r Programming: telling a coherent story

r Library: use plots already written

r Initially overwhelming, but pays off in the end!

r Picking up Java and C++ after C# should be easy!

12

Course Information

r Textbook : Computing with C# and .NET Framework by Art Gittleman

r Information, assignments, & lecture notes are available on-line.

  • We won’t use much paper!

r Official URL: http://flint.cs.yale.edu/cs

r Course newsgroup: yale.cs.cs

r For help, send email to [email protected] or [email protected]

r Please read online information at least once every two days!