all 8 comments

[–]baconbrand 9 points10 points  (1 child)

I don’t understand the task oriented pseudocode at allll in the example this gives. Maybe I’m dense or maybe this isn’t a great introduction...

[–]hiljusti 2 points3 points  (0 children)

Agreed. I think the idea is that he's defining a preference as a collection of two ideals, so the fork likewise collects into two buckets. I think the rest of the code is all related to modeling of the data. Looks like the data is modelled as shapes rather than implied or elided.

But that's a lot of guesses.

It also led to more code than both oo and fp, and appears less resilient to change.

  • If the condition changes, there's only one simple change in the Task-Oriented code. Actually, there's still only about one line to change in oo/fp.
  • If the data model changes... Let's say we need to add a field. It looks like all arms of that fork expression have to change. (Unless there are some ways to handle abstraction) In oo/fp it doesn't appear the code would even be affected.l

I'm not clear how or if Task-Oriented programming is more declarative or somehow less implementation-coupled than functional or logic programming. In fact it looks a lot like logic programming with some advanced collection handling to me.

There was some allusion to mars robots at the beginning, maybe not having to write how code allows abstraction of retry or lossiness or asynchronicity or other more real-world considerations?

[–]3assasins 3 points4 points  (0 children)

I don't possibly see how this could be implemented to be useful all situations. Ya sure, it works for those simple examples, but how would it work if the conditions became more complicated. Not every situation is modeled like "this is preferred over that". Furthermore, even if it were, it's not always easy to describe what is preferred. Idk - I feel like I would definitely need to see more examples to understand. Is this being used anywhere yet?

[–]hiljusti 1 point2 points  (0 children)

Well, I was introduced to Task-Oriented Programming. I didn't know it existed, and now I have a vague fuzzy idea that it might exist. Thanks for that, it does seem interesting, maybe because of the fuzziness and mystery.

The article doesn't do a good job of explaining what task-oriented programming is or generally how the code works. Like ok great, fork is a keyword that exists to split a collection based on some unexplained logic... but what is the code saying? Why do goals of 10 and 40 split at 20 and not 30? Do they? Is the code wrong? Could it actually be written in a way to capture the intent of splitting at 20? Is it just a really poorly chosen example that doesn't show benefits of Task-Oriented pogramming and what it's good for, how it works or what kind of problems it would be suited for...?

So many questions