25+ yr Java/JS dev
Linux novice - running Ubuntu (no windows/mac)

  • 1 Post
  • 2.87K Comments
Joined 1 year ago
cake
Cake day: June 14th, 2023

help-circle














  • I love in a suburb of a Midwestern state capital.

    Here are my walking distances: (I’ll do my best to convert distances)

    • To the nearest convenience store: 3.2km
    • To the nearest chain supermarket: 4km
    • To the bus stop: 2.75km
    • To the nearest park: 1.5km (it’s a pretty decent park with a swimming/fishing pond)
    • To the nearest big supermarket: 12km
    • To the nearest library: 2.4km
    • To the nearest train station: 10km (this isn’t a commuter line, but a long distance city to city line). This is also where intracity buses are boarded.
    • To State Capitol: 13 km

    Of all of these, only the walk to the Capitol is shorter than the drive (by about 1.5km) due to walking paths. I’ve never walked it all in one go, but I have walked both halves of the trail.


  • I don’t think I would agree that just because something is public that it’s a public forum. I feel like the public has to own it as well. I looked it up and maybe it’s because I predate social media by rather a lot, but I think of it in the classical sense:

    Public forums are typically categorized into three types:

    1. Traditional Public Forums: Long-established spaces like parks or sidewalks, where people have historically exercised their rights to free speech and assembly.
    2. Designated Public Forums: Areas that the government intentionally opens up for public expression, such as town halls or school meeting rooms.
    3. Limited Public Forums: Spaces opened for specific types of discussions or activities but with certain restrictions on the subject matter or participants.

    The important factor being public ownership of the forum. I will concede that it has colloquially come to include public social media, but I think it’s important to distinguish that it’s not really the same thing at all as has been discussed through most of our history.

    Food for thought. I just think calling them public forums attaches too much importance to a profit seeking endeavor.



  • I would only note that for the vast majority of my experience these streams can only return up to a single match. Determinism isn’t really preserved by findFirst, either, unless the sort order is set up that way.

    Finding the first Jim Jones in a table is no more reliable that finding any Jim Jones. But finding PersonId 13579 is deterministic whether you findFirst or findAny.

    Perhaps you work in a different domain where your experience is different.


  • I try to prefer .findAny() over .findFirst() because it will perform better in some cases (it will have to resolve whether there are other matches and which one is actually first before it can terminate - more relevant for parallel streams I think. findAny short circuits that) but otherwise I like the first. I’d probably go with some sort of composed predicate for the second, to be able to easily add new criteria. But I could be over engineering.

    I mostly just posted because I think not enough people are aware of the reasons to use findAny as a default unless findFirst is needed.