TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The Expressivity Limitations of Object-Oriented Programming

2 pointsby vitplisterover 1 year ago

2 comments

Khelavasterover 1 year ago
This writer really doesn't understand that functions and types are themselves objects..?
评论 #37999212 未加载
AnimalMuppetover 1 year ago
&gt; tl;dr: Writing software is encoding knowledge.<p>OK.<p>&gt; Knowledge takes the shape of propositions.<p>That seems a bit reductionistic, but I&#x27;ll ignore it.<p>&gt; Compressing rich propositions into is-a and has-a relationships does not lend itself to clarity.<p>And if the <i>only</i> way to put knowledge or propositions into OO code was in the form of an object hierarchy, there might be a point here.<p>The author goes on to say:<p>&gt; I’m not claiming is-a and has-a are the only types of abstraction available object-oriented languages. As a reader pointed out, most object-oriented languages have other types of abstractions which are not the object-oriented parts, like interfaces (responds-to), plain functions, and more.<p>OK, so despite the title, the actual point is, don&#x27;t try to encode all knowledge in the type hierarchy. Well, there may be some people who need to hear that, but the good OO programmers already know...