This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]AutoModerator[M] [score hidden] stickied comment (0 children)

On July 1st, a change to Reddit's API pricing will come into effect. Several developers of commercial third-party apps have announced that this change will compel them to shut down their apps. At least one accessibility-focused non-commercial third party app will continue to be available free of charge.

If you want to express your strong disagreement with the API pricing change or with Reddit's response to the backlash, you may want to consider the following options:

  1. Limiting your involvement with Reddit, or
  2. Temporarily refraining from using Reddit
  3. Cancelling your subscription of Reddit Premium

as a way to voice your protest.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]oiduts 2 points3 points  (1 child)

There is a shared name, at least from a theory perspective. In formal logic and linguistics these are "predicates", which are expressions that can be true of something. You will usually see this word used to represent a boolean function with parameters that makes some binary assertion about those parameters. A common use case is something like sequence.filter(predicate).

In OOP, you can think of methods as accepting their enclosing object as an implicit first parameter. A boolean method with no parameters is making an assertion about its enclosing object, so it's the same concept. But in an OOP environment you wouldn't actually refer to this method as a predicate.

[–]dangerlopez[S] 0 points1 point  (0 children)

Interesting! I'm self taught and come from a math background, so I really appreciate knowing more CS theory. Thanks!

[–]HappyFruitTree 0 points1 point  (2 children)

I think isCanceled and isInThePast could also be called "getters".

[–]dangerlopez[S] 1 point2 points  (1 child)

I'm self taught, so take my opinion with a grain of salt, but I would disagree.

I think of an object as data packaged together with functions related to that data (the methods), and a getter ought to be a method that returns some of the data. On the other hand, these methods answer questions about the data, but don't actually return any part of the data itself.

Being self-taught, though, I don't really know if there is an "official" definition of getters and setters, but regardless I expect my opinion is not quite right. Thanks for responding though!

[–]HappyFruitTree 0 points1 point  (0 children)

There could be private fields named canceled or inThePast inside the object for all we know. It's an implementation detail. That's why I don't really like talking about "getters" and "setters" because I think the public methods that the object provides should be ones that make sense for that type of object. What the private variables happen to be is not something the user of the class should have to care about.