Hacker News new | comments | ask | show | jobs | submit login
Good Ideas, Through the Looking Glass (2005) [pdf] (ethz.ch)
36 points by bshanks 7 months ago | hide | past | web | favorite | 3 comments



As someone who struggles with object-oriented programming (OOP), I thought these thoughts by the author Niklaus Wirth on OOP were interesting:

> ...the careful observer may wonder...what was the essential difference to the traditional view of programming. After all, the old cornerstones of procedural programming reappear, albeit embedded in a new terminology: Objects are records, classes are types, methods are procedures, and sending a method is equivalent to calling a procedure. True, records now consist of data fields and, in addition, methods; and true, the feature called inheritance allows the construction of heterogeneous data structures, useful also without object-orientation.

> Was this change of terminology expressing an essential paradigm shift, or was it a vehicle for gaining attention, a “sales trick”?

As someone who thinks OOP is oversold, I think I agree with him. I've long felt that OOP dresses itself up in too many layers of terminology. That has a cost in the complexity of the resulting code written. Agree or disagree?


I also struggle with OOP and its layers of abstractions, but have seen some of the practical benefits, when wielded by experienced programmers, how it can provide a consistent conceptualization and order to a codebase. I also agree that there's cargo-culting and marketing that oversells the paradigm. Personally I'm a fan of functional programming, although that seems to be getting oversold as well..

When speaking of object-oriented programming, I think going back to its roots helps to clarify the idea:

Meaning of "Object-Oriented Programming" According to Dr. Alan Kay

http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay...


As usual, much of what Niklaus Wirth writes is over my head. But I agree with him that using the equal sign for assignment is an unfortunate choice. I remember being confused by it in my first programming class ages ago. I thought foo = 10 was a test and not an assignment, and, when the assignment was the first occurrence of foo, I remember being confused about how you could test whether it equaled 10 if it had yet to be defined. I got over the problem soon enough, but I'm sure I wasn't the first person to have it.

Wirth points out that Algol used := for assignment. That is also what Smalltalk uses, which leaves = for testing equality (and == for testing object identity). Of course, after using the equals sign for assignment for so long, I often stumbled when I was in Pharo.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: