1 Professionalism in Programming Alexander Stepanov.

Slides:



Advertisements
Similar presentations
You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
Advertisements

Using Matrices in Real Life
Advanced Piloting Cruise Plot.
Chapter 1: The Database Environment
Chapter 7 Constructors and Other Tools. Copyright © 2006 Pearson Addison-Wesley. All rights reserved. 7-2 Learning Objectives Constructors Definitions.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Chapter 1 The Study of Body Function Image PowerPoint
Business Transaction Management Software for Application Coordination 1 Business Processes and Coordination.
Human Performance Improvement Process
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
My Alphabet Book abcdefghijklm nopqrstuvwxyz.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Addition Facts
Year 6 mental test 5 second questions
Year 6 mental test 10 second questions
Configuration management
Chapter 17 Linked Lists.
DATA STRUCTURES AND ALGORITHMS Prepared by İnanç TAHRALI
1111 Abstract Data Types Cpt S 223. School of EECS, WSU.
Data Structures: A Pseudocode Approach with C
Data Structures ADT List
ITEC200 Week04 Lists and the Collection Interface.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Ver Chapter 4: Linked Lists Data Abstraction & Problem Solving with.
Data Structures Using C++
Chapter 1 Object Oriented Programming 1. OOP revolves around the concept of an objects. Objects are created using the class definition. Programming techniques.
ABC Technology Project
CSE Lecture 12 – Linked Lists …
1 Undirected Breadth First Search F A BCG DE H 2 F A BCG DE H Queue: A get Undiscovered Fringe Finished Active 0 distance from A visit(A)
IP Multicast Information management 2 Groep T Leuven – Information department 2/14 Agenda •Why IP Multicast ? •Multicast fundamentals •Intradomain.
VOORBLAD.
Review Pseudo Code Basic elements of Pseudo code
1 Breadth First Search s s Undiscovered Discovered Finished Queue: s Top of queue 2 1 Shortest path from s.
©2007 First Wave Consulting, LLC A better way to do business. Period This is definitely NOT your father’s standard operating procedure.
BIOLOGY AUGUST 2013 OPENING ASSIGNMENTS. AUGUST 7, 2013  Question goes here!
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
Squares and Square Root WALK. Solve each problem REVIEW:
© 2012 National Heart Foundation of Australia. Slide 2.
Lets play bingo!!. Calculate: MEAN Calculate: MEDIAN
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
Chapter 5 Test Review Sections 5-1 through 5-4.
GG Consulting, LLC I-SUITE. Source: TEA SHARS Frequently asked questions 2.
Addition 1’s to 20.
25 seconds left…...
H to shape fully developed personality to shape fully developed personality for successful application in life for successful.
Januar MDMDFSSMDMDFSSS
Week 1.
Analyzing Genes and Genomes
Chapter 9 Interactive Multimedia Authoring with Flash Introduction to Programming 1.
We will resume in: 25 Minutes.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Essential Cell Biology
Intracellular Compartments and Transport
PSSA Preparation.
Immunobiology: The Immune System in Health & Disease Sixth Edition
Essential Cell Biology
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 13 Slide 1 Application architectures.
How Cells Obtain Energy from Food
Immunobiology: The Immune System in Health & Disease Sixth Edition
Energy Generation in Mitochondria and Chlorplasts
CpSc 3220 Designing a Database
Data Structures Using C++ 2E
1 Programming Languages (CS 550) Mini Language Interpreter Jeremy R. Johnson.
Presentation transcript:

1 Professionalism in Programming Alexander Stepanov

2 AbstractAbstract Programming is about writing code. The code could be good or bad and it is not a matter of personal taste. Programming is a profession. It requires constant professional education and professional ethics. It is essential that organizational structures support writing of professional code and maintaining professional workforce.

3 Tracker& Tracker::GetTracker(void) { // FIX_ME: 9/2/99 - Why is this here? It should be //explained with a // comment, or removed. if (!sTracker) { int foo = 44; foo++; Signal_("sTracker == NULL"); } PPValidatePointer_(sTracker); return *sTracker; }

4 bool PictureRadioButton::Track(Tracker& tracker) { bool result = false; Action theAction = tracker.GetAction(); switch (theAction) { case kButtonDownAction: { NRect localRect; NPoint point; bool needDraw = false; GetLocalRect(localRect); tracker.GetPoint(point); if (fButtonDown) { if (localRect.Contains(point)) { if ((GetItemStyle() & kRadioButtonAllowNoneSetStyle) == 0) SetBooleanValue(true); else { SetBooleanValue(false); fButtonDown = false; } else { if (localRect.Contains(point)) { if ((GetItemStyle() & kRadioButtonAllowNoneSetStyle) == 0) SetBooleanValue(true); else { SetBooleanValue(true); fButtonDown = true; } Invalidate(); Update(); result = true; break; } return result; }

5 bool PictureRadioButton::Track(Tracker& tracker) { bool result = false; Action theAction = tracker.GetAction(); switch (theAction) { case kButtonDownAction: { NRect localRect; NPoint point; bool needDraw = false; GetLocalRect(localRect); tracker.GetPoint(point); if (fButtonDown) { if (localRect.Contains(point)) { if ((GetItemStyle() & kRadioButtonAllowNoneSetStyle) == 0) SetBooleanValue(true); else { SetBooleanValue(false); fButtonDown = false; } else { if (localRect.Contains(point)) { if ((GetItemStyle() & kRadioButtonAllowNoneSetStyle) == 0) SetBooleanValue(true); else { SetBooleanValue(true); fButtonDown = true; } Invalidate(); Update(); result = true; break; } return result; }

6 bool PictureRadioButton::Track(Tracker& tracker) { bool result = false; switch (tracker.GetAction()) { case kButtonDownAction: { NRect localRect; NPoint point; bool needDraw = false; GetLocalRect(localRect); tracker.GetPoint(point); if (fButtonDown) { if (localRect.Contains(point)) { if ((GetItemStyle() & kRadioButtonAllowNoneSetStyle) == 0) SetBooleanValue(true); else { SetBooleanValue(false); fButtonDown = false; } else { if (localRect.Contains(point)) { if ((GetItemStyle() & kRadioButtonAllowNoneSetStyle) == 0) SetBooleanValue(true); else { SetBooleanValue(true); fButtonDown = true; } Invalidate(); Update(); result = true; break; } return result; }

7 bool PictureRadioButton::Track(Tracker& tracker) { if (tracker.GetAction() != kButtonDownAction) return false; NRect localRect; NPoint point; bool needDraw = false; GetLocalRect(localRect); tracker.GetPoint(point); if (fButtonDown) { if (localRect.Contains(point)) { if ((GetItemStyle() & kRadioButtonAllowNoneSetStyle) == 0) SetBooleanValue(true); else { SetBooleanValue(false); fButtonDown = false; } else { if (localRect.Contains(point)) { if ((GetItemStyle() & kRadioButtonAllowNoneSetStyle) == 0) SetBooleanValue(true); else { SetBooleanValue(true); fButtonDown = true; } Invalidate(); Update(); return true; }

8 bool PictureRadioButton::Track(Tracker& tracker) { if (tracker.GetAction() != kButtonDownAction) return false; NRect localRect; NPoint point; bool needDraw = false; GetLocalRect(localRect); tracker.GetPoint(point); if (fButtonDown) { if (localRect.Contains(point)) { if ((GetItemStyle() & kRadioButtonAllowNoneSetStyle) == 0) SetBooleanValue(true); else { SetBooleanValue(false); fButtonDown = false; } else { if (localRect.Contains(point)) { if ((GetItemStyle() & kRadioButtonAllowNoneSetStyle) == 0) SetBooleanValue(true); else { SetBooleanValue(true); fButtonDown = true; } Invalidate(); Update(); return true; }

9 bool PictureRadioButton::Track(Tracker& tracker) { if (tracker.GetAction() != kButtonDownAction) return false; NRect localRect; NPoint point; GetLocalRect(localRect); tracker.GetPoint(point); if (localRect.Contains(point)) if (GetItemStyle() & kRadioButtonAllowNoneSetStyle) SetBooleanValue(fButtonDown ^= true); else SetBooleanValue(true); Invalidate(); Update(); return true; }

10 bool PictureRadioButton::Track(Tracker& tracker) { if (tracker.GetAction() != kButtonDownAction) return false; NRect localRect; NPoint point; GetLocalRect(localRect); tracker.GetPoint(point); if (localRect.Contains(point)) SetBooleanValue(!(GetItemStyle() & kRadioButtonAllowNoneSetStyle) || fButtonDown ^= true); Invalidate(); Update(); return true; }

11 bool PictureRadioButton::Track(Tracker& tracker) { if (tracker.GetAction() != kButtonDownAction) return false; NRect localRect; NPoint point; GetLocalRect(localRect); tracker.GetPoint(point); if (localRect.Contains(point)) SetBooleanValue(!(GetItemStyle() & kRadioButtonAllowNoneSetStyle) || fButtonDown ^= true); Invalidate(); Update(); return true; }

12 template inline bool doesLocalRectContainPoint(VisObj& vob, Tracker& tracker) { NRect localRect; NPoint point; vob.GetLocalRect(localRect); tracker.GetPoint(point); return localRect.Contains(point); }

13 bool PictureRadioButton::Track(Tracker& tracker) { if (tracker.GetAction() != kButtonDownAction) return false; if (doesLocalRectContainPoint(*this, tracker)) SetBooleanValue(!(GetItemStyle() & kRadioButtonAllowNoneSetStyle) || fButtonDown ^= true); Invalidate(); Update(); return true; }

14 C, C++ and STL are tools built by professional programmers for professional programmers Their effective use presupposes knowledge of the core areas of Computer Science

15 Core of Computer Science Data Structures and algorithms Theory of computation Programming Languages and Compilers Operating systems Computer architecture

16 Common machine architecture Reasons Ability to build diverse applications Ease to understand, analyze and extend Portability Features Byte-addressable memory Pointers Stack-based function call

17 C machine C abstracts from instructions C++ abstracts from data types STL abstracts from data structures They share the same fundamental machine model! In order to understand C++, in order to understand STL, one needs to understand C machine

18 The way C handles pointers was a brilliant innovation; it solved a lot of problems that we had before in data structuring and made the programs look good afterwards. Donald Knuth

19 Value semantics C has value semantics If you need pointer semantics – use pointers C++ extends value semantics with copy constructors, assignment and destructors STL extends value semantics on data structures and generalizes pointer semantics to iterators

20 Regular types requirements T a = b; assert(a == b); a = b; assert(a == b); T a = b; T c = b; mutate(a); assert(b == c); No sharing

21 Regular types advantages Pass to functions Return from functions Create temporaries on the stack Store in data structures Understandable to the compiler Copy propagation Common sub-expression elimination Understandable to a human EXTENSIBILTY

22 Sacred Cows Top-down design Object Orientation Design Patterns Template Metaprogramming

23 Learning from the greats Ken Thompson Simple, abstract Lions' Commentary on UNIX 6th Edition Linux is the best modern imitation Donald Knuth Methodical, meticulous TEX + Web Bjarne Stroustrup Persistent, evolutionary, pragmatic Design and Evolution of C++ Seymour Cray Efficient, minimal (Blaauw and Brooks, Computer Architecture)

24 Great Books Knuth, The Art of Computer Programming If you think that you are a good programmer … read Art of Computer Programming… Bill Gates Dijkstra, Discipline of Programming Abelson and Sussman, Structure and Interpretation of Computer Programs Hennessy & Patterson, Computer Architecture

25 Source code is the product Much more time reading than writing Code is the main communication channel Code is documentation Code is the asset Aesthetics of code

26 Software engineering Programs == Algorithms + Data Structures Good programmers Know many Use them properly 80% - 20% rule Occasionally (very seldom) invent new ones Professional standards Educational Quality Professional responsibility

27 Group engineering Design Ownership Clear Transferable Reviewed Responsible Code Ownership Clear Transferable Reviewed Responsible

28 Software economics Code as liability Depreciation Maintenance Organizational tax on code Lines Changes across releases Bugs Benefits Reuse Investing into design Continuous improvement of code base

29 We are heirs to a glorious tradition: Let us be proud of what we are