Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Maybe it's because I work on embedded system where I only have to worry about a single process, but I find observables really ergonomic.

"If/else" are a core construct in programming languages. Observables add "when", which I think is just as essential. Whenever someone describes an autonomous system, they will use "when X, do Y". So it makes sense to me that code follows that.

A lot of the time I just want to write a piece of code that and plug it into the system without having to worry about coupling or its effect on other parts of the code. Most of the time I don't have clear requirements, and need to stay flexible.

For example, new requirement to turn off the LCD after X minutes of inactivity, and turn it back on when the user presses a button? I just create a new component (instanced based on a configuration flag), plug it into the event bus reacting to ButtonPress events, and call it a day, without having to worry about something else breaking, often without even having to read existing code (except how to get notified of the event).

Even when modifying existing code, it's easier to replace an event, easy to find which components are depending on that event, etc.



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

Search: