Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news.misty.com!news.iecc.com!.POSTED!nerds-end From: Kaz Kylheku Newsgroups: comp.compilers Subject: Re: OOP vs imperative, was Hello v1.0.3 distributed programming language available (alpha) Date: Wed, 10 Sep 2014 04:58:37 +0000 (UTC) Organization: Aioe.org NNTP Server Lines: 28 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-09-008@comp.compilers> References: <14-09-005@comp.compilers> <14-09-007@comp.compilers> NNTP-Posting-Host: 2001:470:1f07:1126:0:676f:7373:6970 X-Trace: miucha.iecc.com 1410361366 52316 2001:470:1f07:1126:0:676f:7373:6970 (10 Sep 2014 15:02:46 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Wed, 10 Sep 2014 15:02:46 +0000 (UTC) Keywords: OOP, design Posted-Date: 10 Sep 2014 11:02:45 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:1374 On 2014-09-10, glen herrmannsfeldt wrote: >> Hello is a general-purpose, object-oriented, imperative, protocol-agnostic >> language for distributed applications. ... > For that reason, I tended to think of imperative as exclusive > from object-oriented. Not that you can't, or shouldn't, write > imperative programs in OO languages, but that it wouldn't be > used as a term in the description. (Or, why is it that vol. 2 > isn't called "Non-Object Oriented Languages"?) ... Popular object orientation, like in Java, C++, Python, and whatnot, is thoroughly imperative. Objects have state, and support methods which mutate state. This changing state is central to the collaboration among objects in OO designs; OO is the organizational tool for managing the complexity of all that state. It is possible to have functional object-oriented programming; everything is a constructor or non-mutating accessor. An example of this is the treatment of numbers in the Common Lisp Object System (CLOS). You cannot mutate an integer, ratio, floating-point number or complex number. However, they belong to classes linked by inheritance, and methods can be easily written in the object system which specialize over various kinds of numbers. They just return new numbers constructed based on their arguments.