Language mavens: Is there a programming with "if then else ENDIF" syntax?

Steven D'Aprano steven at REMOVE.THIS.cybersource.com.au
Wed Nov 18 22:35:35 CET 2009


On Wed, 18 Nov 2009 09:33:38 +0200, Dotan Cohen wrote:

>> Is there any particular reason why this might be a *bad* language-
>> design idea?
> 
> It is about as far from OO as one could get. Whether or not that is
> "bad" depends on the use case.


That's crazy talk. IF...ENDIF is *syntax*, not a programming model. How 
is this hypothetical Python-like syntax not object oriented?

class Parrot:
    def speak(self):
        if self.name is None:
            name = "Polly"
        else:
            name = self.name
        endif
        return "%s wants a cracker!" % name


Syntax controls *how* you instruct the compiler, the programming model 
controls *what* you instruct the compiler to do.



-- 
Steven



More information about the Python-list mailing list