Hacker News new | ask | show | jobs
by jacobolus 2557 days ago
Is this really that common a term in computer programming? I can’t say I see it used with any regularity. Maybe it’s a common term in some specific programming subcultures? Apparently it’s a deprecated Java class, https://docs.oracle.com/en/java/javase/11/docs/api/java.base... and something in RxJS (which I had never heard of before doing a web search just now) https://www.learnrxjs.io/concepts/rxjs-primer.html

The term “observable” used as a noun in a programming context seems to me very clunky and vague. YMMV.

I am much more familiar with the term “observable” in physics. https://en.wikipedia.org/wiki/Observable

4 comments

RxJS is just one of several implementations of ReactiveX, it goes well beyond JS:

http://reactivex.io/

The Java class and many other occurrences grew out of the name of the Observer/Observable design pattern[1] in the "Gang of Four" "Design Patterns" book.[2]

1. https://en.wikipedia.org/wiki/Observer_pattern

2. https://en.wikipedia.org/wiki/Design_Patterns

The Go4 call this a “Subject” rather than an “Observable”. As far as I can tell the only occurrence of the word “observable” in the Go4 book is:

> Other user interface toolkits that employ this [Observer] pattern are InterViews [LVC89], the Andrew Toolkit [P+88], and Unidraw [VL90]. InterViews defines Observer and Observable (for subjects) classes explicitly. Andrew calls them "view" and "data object," respectively. Unidraw splits graphical editor objects into View (for observers) and Subject parts.

I work primarily in .NET and Angular and it’s a well known term in both of those. Especially confusing with RxJS observable as they are related to JavaScript too.
It's a concept in larval.