lect-2-programs-behaviors-ambiguity-intro

lect-2-programs-behaviors-ambiguity-intro - 4/1/2011 New...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
4/1/2011 1 CSE503: SOFTWARE ENGINEERING PROGRAMS, BEHAVIORS, AMBIGUITY David Notkin Spring 2011 Neurosis is the inability to tolerate ambiguity. --Sigmund Freud New Study of Obesity Looks for Larger Test Group International Obfuscated C Code Contest http://www.ioccc.org/2004/hoyle 503 11sp © UW CSE • D. Notkin 2 #include <stdio.h> #include <stdlib.h> #include <math.h> #define _ ;double #define void x,x #define case(break,default) break[O]:default[O]: #define switch(bool) ;for(;x<bool; #define do(if,else) inIine(else)>int##if? #define true (--void++) #define false (++void--) char*O=" <60>!?\\\n"_ doubIe[010]_ int0,int1 _ Iong=0 _ inIine(int eIse){int O1O=!O _ l=!O;for(;O1O<010;++O1O)l+=(O1O[doubIe]*pow(eIse,O1O));return l;}int main(int booI,char*eIse[]){int I=1,x=-*O;if(eIse){for(;I<010+1;I++)I[doubIe-1] =booI>I?atof(I[eIse]):!O switch(*O)x++)abs(inIine(x))>Iong&&(Iong=abs(inIine(x )));int1=Iong;main(-*O>>1,0);}else{if(booI<*O>>1){int0=int1;int1=int0-2*Iong/0 [O]switch(5[O]))putchar(x-*O?(int0>=inIine(x)&&do(1,x)do(0,true)do(0,false) case(2,1)do(1,true)do(0,false)6[O]case(-3,6)do(0,false)6[O]-3[O]:do(1,false) case(5,4)x?booI?0:6[O]:7[O])+*O:8[O]),x++;main(++booI,0);}}} Why is this program distasteful? Because… Indentation? Documentation? Behaviors? Structure? Reasoning – loops, invariants? Fixing it? Changing it? Programs have three immediate audiences The computer The developers The users Given that this program compiles and executes as intended, the computer is perfectly happy Under almost no conditions are the developers happy with this program What about the users? 503 11sp © UW CSE • D. Notkin 3 Software engineering… 503 11sp © UW CSE • D. Notkin 4 …is primarily concerned with the ―happiness‖ of the software engineering team and with the ―happiness‖ of the users The ―happiness‖ of the computer (performance, etc.) is material, but less so We will focus more overall on the software engineering team than on the users – due largely to my knowledge and interests The developers need to be able to – at reasonable cost, whatever that means – understand, reason about, fix, change, enhance, etc. the program
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4/1/2011 2 Performance: quotations 503 11sp © UW CSE • D. Notkin 5 Michael Jackson Rule 1: Don't do it. Rule 2 (for experts only): Don't do it yet. Bill Wulf More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason – including blind stupidity. Don Knuth We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. 503 will not discuss
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/24/2012 for the course CSE 503 taught by Professor Davidnotikin during the Spring '11 term at University of Washington.

Page1 / 12

lect-2-programs-behaviors-ambiguity-intro - 4/1/2011 New...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online