33
CYPRESS SEMICONDUCTOR 1 RUBY CONF 2004 TEACHING RUBY IN A CORPORATE ENVIRONMENT JIM FREEZE OCT 1, 2004

TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 1 RUBY CONF 2004

TEACHING RUBY IN ACORPORATE ENVIRONMENT

JIM FREEZEOCT 1, 2004

Page 2: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 2 RUBY CONF 2004

BACKGROUND

CYPRESS SEMICONDUCTOR

ACRONYMSEDA - ELECTRONIC DESIGN AUTOMATIONCAD - BACKEND TOOL SUPPORT

Page 3: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 3 RUBY CONF 2004

RUBY IN THE EDA

EDA COMPANIES USING RUBY(THAT I KNOW OF)

CYPRESS AGILENT INTELAT&T MAXIM-IC MOTOROLA

Page 4: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 4 RUBY CONF 2004

OUTLINE

COURSE HISTORYSTUDENT PROFILETOOLS AND TEXTSCURRICULUMCOURSE FLOW (STYLE)PUBLICIZINGINFRASTRUCTUREBEST PRACTICES

Page 5: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 5 RUBY CONF 2004

COURSE HISTORY

ORIGINALLY TAUGHT IN ONE QTRTWO LESSONS PER WEEK20 LESSONSHOMEWORK

WRITTEN EXERCISESPROGRAMMING LABS

CONDENSED INTO 2.5 DAY COURSENOW TAUGHT 1-2 TIMES PER QTR

Page 6: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 6 RUBY CONF 2004

COURSE OVERVIEW

REQUIRES COMPUTER ACCESS IN CLASSROOM1-3 STUDENTS PER COMPUTER

LENGTH IS 2.5 TO 3 DAYSINTERACTIVE EXAMPLESEXCERCISES AND PROGRAMMING LABSCODE REVIEWSPLENTY OF GOOD FOOD AND SNACKSIT’S A CLASS, NOT A PRESENTATION

Page 7: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 7 RUBY CONF 2004

STUDENT PROFILE

MANAGERSTEST ENGINEERSMODELING ENGINEERSCAD ENGINEERSTECHNOLOGY INTEGRATION CAD ENGRSDESIGN ENGINEERS

Page 8: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 8 RUBY CONF 2004

TOOLS AND TEXTS

Page 9: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 9 RUBY CONF 2004

TOOLS

IRBRIEDITOR WITH SYNTAX HIGHLIGHTINGCOMMAND LINE

Page 10: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 10 RUBY CONF 2004

TEXTS

PRINTOUT OF LECTURE SLIDES320+ PAGES OF POWERPOINT

Programming Ruby: The PragmaticProgrammer’s Guide

David Thomas, Andrew HuntAddison Wesley Longman, Inc.

Page 11: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 11 RUBY CONF 2004

TEXTS CON’T

TEXT MUST HAVE INDEX

STUDENTS WOULD LIKE A QUICK HELPGUIDE

Page 12: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 12 RUBY CONF 2004

CURRICULUM

Page 13: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 13 RUBY CONF 2004

Course Outline - Day 1• Introduction 7• Ruby Design Principles 23• Getting Started 33• Lab 1 40• Variable, Methods, Classes and Objects 41

• Variables 43• Methods 47• Classes and Objects 52

• OO Theory 59• Lab 2 68• Standard Types 69• Variables 79• Control Structures 87• Printing, Strings and Statements 96• Documentation 104• Lab 3 119• Test First Development 120• Lab 4 148• Regular Expressions and Case Statement 149• Lab 5 174

LET’S RUBY

Page 14: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 14 RUBY CONF 2004

CURRICULUM

INTRODUCTION TO RUBY AND MATZHAVE FUNWOW ‘EM

SYNTAX BASICS - NAMING, CONTROL FLOWVARIABLES, METHODS, CLASSES & OBJECTS

INTERNALIZING NEW CONCEPTS MAY BE SLOWCUSTOMIZE CONTENT CAN HELP

Page 15: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 15 RUBY CONF 2004

WHAT IS A CLASS?A CLASS IS A COMBINATION OF

• STATE• BEHAVIOR

EXAMPLES:

extract_netlistrmin, fmaxLayout

BehaviorStateClass

simulatevdd, vccFET

to_raphael2dnum_metalsStackup

Page 16: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 16 RUBY CONF 2004

STACKUP OBJECT

AN OBJECT IS AN INSTANTIATION OF A CLASS.

Object

Class to_raphael_2dnum_metalsStackup

BehaviorStateName

ram5.to_raphael_2d2ram5

r95ld

Stackup

Page 17: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 17 RUBY CONF 2004

NMOS OBJECT

AN OBJECT IS AN INSTANTIATION OF A CLASS.

Object

Class simulatevdd, vccFET

BehaviorStateName

nmos.simulate3.3, 0.0nmos

nmos

FET

Page 18: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 18 RUBY CONF 2004

Course Outline - Day 1• Introduction 7• Ruby Design Principles 23• Getting Started 33• Lab 1 40• Variable, Methods, Classes and Objects 41

• Variables 43• Methods 47• Classes and Objects 52

• OO Theory 59• Lab 2 68• Standard Types 69• Variables 79• Control Structures 87• Printing, Strings and Statements 96• Documentation 104• Lab 3 119• Test First Development 120• Lab 4 148• Regular Expressions and Case Statement 149• Lab 5 174

Page 19: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 19 RUBY CONF 2004

CURRICULUM

SOLVE COMMON PROBLEMSCODE DOCUMENTATIONSHORT HALF-LIFE OF SCRIPTS

LET’S KEEP UNREADABLE LANGUAGES UNREAD

Page 20: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 20 RUBY CONF 2004

Course Outline - Day 1• Introduction 7• Ruby Design Principles 23• Getting Started 33• Lab 1 40• Variable, Methods, Classes and Objects 41

• Variables 43• Methods 47• Classes and Objects 52

• OO Theory 59• Lab 2 68• Standard Types 69• Variables 79• Control Structures 87• Printing, Strings and Statements 96• Documentation 104• Lab 3 119• Test First Development 120• Lab 4 148• Regular Expressions and Case Statement 149• Lab 5 174

Page 21: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 21 RUBY CONF 2004

Course Outline - Day 2• Lab 5 174• Iterators and Blocks 175• Method Invocation and Method Missing 188• Lab 6 196• Files and Directory 197• Lab 7 211• Class Variables & Methods and Inheritance 212• Modules, Module Methods and Eval 230• Command Line Applications 242• Exceptions, Catch and Throw 257• Lab 8 273• Daemons, System Calls and Forking 274• Debugging, Profiling and Benchmarking 285• Threads and IO 298• Deployment 305• Best Practices 312• Mail 317• HTTP 319• Resources 321

Page 22: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 22 RUBY CONF 2004

CURRICULUM

BLOCKS, PROCS, LAMBDAS, ITERATORS, …GENERALLY MIND WARPING

METHOD INVOCATIONFILE AND DIRECTORY ACCESS

“RUBY SAY …”, GUY DECOUX

Page 23: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 23 RUBY CONF 2004

Course Outline - Day 2• Lab 5 174• Iterators and Blocks 175• Method Invocation and Method Missing 188• Lab 6 196• Files and Directory 197• Lab 7 211• Class Variables & Methods and Inheritance 212• Modules, Module Methods and Eval 230• Command Line Applications 242• Exceptions, Catch and Throw 257• Lab 8 273• Daemons, System Calls and Forking 274• Debugging, Profiling and Benchmarking 285• Threads and IO 298• Deployment 305• Best Practices 312• Mail 317• HTTP 319• Resources 321

Page 24: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 24 RUBY CONF 2004

Course Outline - Day 2• Lab 5 174• Iterators and Blocks 175• Method Invocation and Method Missing 188• Lab 6 196• Files and Directory 197• Lab 7 211• Class Variables & Methods and Inheritance 212• Modules, Module Methods and Eval 230• Command Line Applications 242• Exceptions, Catch and Throw 257• Lab 8 273• Daemons, System Calls and Forking 274• Debugging, Profiling and Benchmarking 285• Threads and IO 298• Deployment 305• Best Practices 312• Mail 317• HTTP 319• Resources 321

Page 25: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 25 RUBY CONF 2004

CURRICULUM

TYING UP LOOSE ENDSFORKING, DEBUGGING, PROFILING,

BENCHMARKING

CORPORATION CUSTOMIZATIONDEPLOYMENTBEST PRACTICESINFRASTRUCTURE

“IT’S A PROGRAMMING IDIOM, NOT A TEST OF CHARACTER”,DAVID BLACK

Page 26: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 26 RUBY CONF 2004

Course Outline - Day 2• Lab 5 174• Iterators and Blocks 175• Method Invocation and Method Missing 188• Lab 6 196• Files and Directory 197• Lab 7 211• Class Variables & Methods and Inheritance 212• Modules, Module Methods and Eval 230• Command Line Applications 242• Exceptions, Catch and Throw 257• Lab 8 273• Daemons, System Calls and Forking 274• Debugging, Profiling and Benchmarking 285• Threads and IO 298• Deployment 305• Best Practices 312• Mail 317• HTTP 319• Resources 321

Page 27: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 27 RUBY CONF 2004

CURRICULUM

SENDING EMAILHTTP DATA MINING

Page 28: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 28 RUBY CONF 2004

COURSE FLOW/INTENSITY

LECTURES MIX OF SLIDES AND IRBEXERCISES DONE BEFORE LABSLABS

LAB TIME USED FOR BREAKSNO SPOON FEEDINGNO FIREHOSEAMPLE COACHING AND SUPPORT

Page 29: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 29 RUBY CONF 2004

PUBLICITYWEBSITE - (RUBLOG)

MEMOS

Page 30: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 30 RUBY CONF 2004

INFRASTRUCTURE

CUSTOM CORPORATE LIBRARIES AND APPSrequire ‘cypress_init’Cypress::ApplicationCypress::OptionParserproject_config

IP REPOSITORY (DESTOOLS)LIGHTWEIGHT APPLICATION REVIEW BOARD

REVIEW CODEMANAGE IP

Page 31: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 31 RUBY CONF 2004

CODE REVIEW

KEEP RUBY CODE LOOKING LIKE RUBYKEEP THINGS SIMPLEENSURE REUSE OF CYPRESS RUBY LIBRARIESENSURE USE OF ‘GLOBAL’ RUBY LIBRARIES

Page 32: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 32 RUBY CONF 2004

BEST PRACTICES

BE PATIENT, BE A TEACHER

FACILITATE INTEGRATION, TAKE NO CREDIT

PROMOTE RUBY CODERS, NOT RUBY

Page 33: TEACHING RUBY IN A CORPORATE ENVIRONMENT · cypress semiconductor 6 ruby conf 2004 course overview requires computer access in classroom 1-3 students per computer length is 2.5 to

CYPRESS SEMICONDUCTOR 33 RUBY CONF 2004

WHAT NEXT?

OPEN SOURCE COURSEWARE?