Re: Re: Why is 'else' demanded?
zhanghongliang <[email protected]> Thu, 13 Jun 2013 11:39:30 +0800
| Newsgroups | gmane.comp.programming.refactoring |
|---|---|
| Message-ID | <[email protected]> |
May the explanation is forceful as below:=0D =0D refactoring starts with "structured programming" (the=0D paradigm shift in the 1980s where "if - go to" statements were replaced=0D by "while", "repeat" and "if-then-else" statements in a lot of=0D languages). The return statement is not part of a structured program.=0D =0D the above drawn from the reply mail by Willem Bogaerts<[email protected]>=0D =0D =0D =0D =0D Best regards,=0D ZhangHong-liang=0D =0D =0D =0D =E5=BC=A0=E7=BA=A2=E4=BA=AE =0D =0D M:18640223030=0D DL: 010=EF=BC=8D82870058=0D =E4=B8=8A=E6=B5=B7=E9=9B=B7=E8=85=BE=E8=BD=AF=E4=BB=B6=E6=9C=89=E9=99=90=E5= =85=AC=E5=8F=B8 (ShangHai Raxtone Limited Company)=0D =E5=8C=97=E4=BA=AC=E5=B8=82=E6=B5=B7=E6=B7=80=E5=8C=BA=E4=B8=AD=E5=85=B3=E6= =9D=91=E5=BD=A9=E5=92=8C=E5=9D=8A=E8=B7=AF11=E5=8F=B7=E5=8D=8E=E4=B8=80=E6= =8E=A7=E8=82=A1=E5=A4=A7=E5=8E=A6201=E5=AE=A4 (Room 201, Buliding HuaYi con= trol, No.11, CaiHeFang Road, Beijing , China)=0D Fax:82870098=0D =0D =0D From: Carfield Yim=0D Date: 2013-06-10 23:34=0D To: refactoring=0D Subject: Re: [refactoring] Why is 'else' demanded?=0D =0D I think one reason is C have if-else and quite a number of languages base= =0D on C.=0D =0D On Mon, Jun 10, 2013 at 3:02 AM, =E5=BC=A0=E7=BA=A2=E4=BA=AE <zhanghonglian= [email protected]> wrote:=0D =0D > I have a problem. Why is there always else key word in a language? Since = I=0D > can use return to stop the process of a flow. I hate to see else statemen= t=0D > and I see I can never use else statement that only increase the complexit= y=0D > of program.=0D >=0D > A if statement stands for a condition that should be unique, and it shoul= d=0D > has no relation with anything else. So a language does not need else and = it=0D > should not appear in a program.=0D >=0D > Sent from my iPad=0D >=0D >=0D > ------------------------------------=0D >=0D > Yahoo! Groups Links=0D >=0D >=0D >=0D >=0D =0D [Non-text portions of this message have been removed]=0D =0D =0D [Non-text portions of this message have been removed] ------------------------------------ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/refactoring/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/refactoring/join (Yahoo! ID required) <*> To change settings via email: [email protected]=20 [email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/