HNHacker News
TopNewBestAskShowJobs

sb8244

1,554 karma · joined December 2, 2013

submissionscomments
sb8244··on Why Erlang?
The argument here is that the system can get itself into a state that is irreparable (and perhaps very difficult to track / debug).

By crashing and having it start into a good state, the system will at least be operational again.

sb8244··on Use Phoenix Channels
Yes, that's a fair point. I should have written BEAM/OTP because they're separate things. BEAM enables the process model, but the implementation of things like networking is in OTP. I'm not sure how far deep the actual process implementation goes, (is it in BEAM or OTP?) I think it's BEAM but I could be wrong. I'm not really going that low in the stack.
sb8244··on Use Phoenix Channels
For those coming into this that aren't of an Elixir background, here's some of the things that make BEAM (Erlang VM that Elixir is built on) interesting for soft real-time features:

  * BEAM provides out-of-the-box capability to network nodes together. This is extremely important in real-time flows because server A may originate a message that needs to get pushed to a user connected to server B + C (2 tabs open). The capability to both connect + send messages between nodes is built in.
  * The process model in the BEAM provides a really natural fit for WebSocket connections. Each connection is its own process, and other processes are spawned off of that for various needs. The benefit here is that a failure in one process (connection drop, code error, crash, etc) won't affect other users. It's not an issue of whether the code is written well to prevent it, it's just intrinsic to the runtime. State is also stored per-process, which is convenient when it comes to writing your application.
Phoenix itself has a really nice abstraction over WebSockets (Channels, which this post goes in depth on). I won't say too much since the article does, but it's just really enjoyable to work with. Also, Phoenix LiveView is built on channels, so knowing channels provides some benefit there.

If it's interesting to you, I wrote a book that basically walks you through "I don't know anything about Elixir" to building a demo "sneaker drop" store https://pragprog.com/titles/sbsockets/real-time-phoenix/

sb8244··on Show HN: Open by Design
It's not explicitly labeled as CC on the license page, but maybe it's still considered CC due to the wording: https://openby.design/license.html

An asset is typically the final rendering of something, not the source that was used to develop that asset (image of design on Dribbble vs the Figma / Sketch files used to produce it). It's common for renderings to be made available online—although usually not explicitly licensed—but I more rarely see source made available.

sb8244··on Show HN: Open by Design
For sure, I get that. It seems like that implementation (HTML/CSS) is separate from the design here, which is totally cool. The designs are open-source and openly licensed, but the implementation is not. That seems fair given their business.

The website mentions how the design world is closed off and they wanted to open this to do something about that. The attitude of "the implementation should also be open-source" seems like it reduces their efforts on the design side.

sb8244··on Show HN: Open by Design
I'm a little confused by this comment.

The assets are downloadable, open source in that you have access to the raw design asset, and are usable without attribution or payment. What about this is not open?

sb8244··on Anna Kiesenhofer: Mathematician, amateur cyclist, Olympic champion
I'm just about to watch this, very excited to see it play out. I'm listening to the very start of the race right now and it's very funny how things work out:

"[The smartest racer will win, not just the strongest. Well who are we kidding, you need a good bit of luck too.]"

That's certainly true given the sheer luck on display (peloton lost track of breakaway) and how smart Kiesenhofer is. I also think it's interesting how much she dislikes riding in the peloton. She's 10ft off the back in the starting roll-out.

sb8244··on Apple sued by teen wrongly accused of shoplifting by unreliable facial-rec tech
IMO, the operators of the AI are part of the production execution of that AI. There were not proper constraints in place to prevent this from happening, and it wasn't fixed after the first time(s) that it occurred.

Sure you can argue that the pure tech worked as designed, but the system includes the human element as much as the tech element.

sb8244··on Give me /events, not webhooks
Yea, you're right. I am reading the advocacy as "if you need real-time, then support long-polling."

I see the value in this, but I actually disagree with the article in terms of that being the best solution. Long-polling is significantly different than polling with a cursor offset and returning data, so you wouldn't shoe-horn that into an existing endpoint.

sb8244··on Give me /events, not webhooks
What about supporting fast lookup of the event endpoint, so it can be queried more frequently?

I think that a combo of webhooks / events is nice, but "what scope do we cut?" is an important question. Unfortunately, it feels like the events part is cut, when I'd argue that events is significantly more important.

Webhooks are flashier from a PM perspective because they are perceived as more real-time, but polling is just as good in practice.

Polling is also completely in your control, you will get an event within X seconds of it going live. That isn't true for webhooks, where a vendor may have delays on their outbound pipeline.

sb8244··on Lachlan Morton completes 5,510km Alt Tour, beating peloton to Paris by five days
oof, I remember trying some runs in the sand before and had to stop much sooner than I would've liked. It really worked my calves in a way that I was not used to.
sb8244··on Lachlan Morton completes 5,510km Alt Tour, beating peloton to Paris by five days
I suspect you're exactly right. I actually wish he would've said why the sandals specifically helped him because my immediate reaction was also, "what?"

Here's the article about it that has a picture of his sandal setup: https://cyclingtips.com/2021/06/lachlan-morton-just-rode-two...

sb8244··on Lachlan Morton completes 5,510km Alt Tour, beating peloton to Paris by five days
It's certainly easier on the joints, although you're right about injuries. Knee pain regularly takes out professionals. Really important to know when to stop pushing.

Lachlan did a full 10-12 hour day in sandals because he was having knee pain starting.

sb8244··on Onboarding to Elixir
I'm the author of Real-Time Phoenix. I appreciate the commenter's kind words.

If you ever need any help with content in the book, or a sounding board for Phoenix questions, feel free to DM me on the forums. I appreciate your points and generally agree with them, even the not-so-good ones.

sb8244··on “Great resignation” wave coming for companies
I resigned from my company of 7 years back in April. I gave up life-changing amounts of money in order to leave.

I got super burnt out over the last year and there was not really another option imo. I had been working on my own company on the side and I feel immensely more recharged working on it. For people that have been sitting at home and not spending their salaries for the past year, that might be an appealing option.

sb8244··on Good and Bad Elixir
> That said, I think this advice is particularly useful for people building libraries more so then people working on applications

This is a good point that I hadn't really thought about previously. I agree with your thoughts much more when I consider the different needs between libraries and applications.

sb8244··on Ask HN: Are you satisfied with Elixir or do you regret choosing Elixir?
The thread is literally "Are you satisfied with Elixir?" A big piece of that is me having brought it to a SaaS company and from 0 usage to 50% service coverage. So yea, I am curious what they'll do in 2 years—that was my point. It's a point that you're not qualified to constructively opine on.

I wouldn't care if someone else posted your comment, but you've been downing (non-constructively) on Elixir in this thread and other posts you've made on Hacker News.

sb8244··on Ask HN: Are you satisfied with Elixir or do you regret choosing Elixir?
Sorry, have you worked with the former employer I'm mentioning? I'm talking about a specific use case that has specific needs and challenges. Blanket comments like yours aren't really helpful or necessary.
sb8244··on Ask HN: Are you satisfied with Elixir or do you regret choosing Elixir?
I'm very bullish on Elixir as a language, but I temper that with the reality that I don't think it will become a mainstream language (in the next few years, at least).

I picked up Elixir probably 4-5 years ago when a co-worker kept recommending it and wanted to explore it more. We finally got the approval to do a microservice in it that was well-suited for it. Over time it became one of the two "blessed languages" alongside Ruby, and was probably adopted by 40% of teams. Our monolith was still Ruby, so a lot of teams had to use Ruby.

I found that people could pick up the language fairly quickly, but it would take a few stumbles on OTP before things started to click there. People generally seemed to like learning it, though. Maybe they were just being polite.

For me, Elixir has been the most fun I've had programming since I started. It allows me to more consciously design my systems because I don't really feel limited by it—this is why I'm bullish on the language. I enjoyed programming in Ruby, but felt limited to doing things a certain way.

There's also still a ton of opportunity in the community (which is excellent as it is, imo). For example, I wrote a book with Pragmatic that I don't think I would've been able to write in the Ruby world. If you're the type of person who likes exploring, figuring things out, and documenting afterwards, then you could make a nice name for yourself in the community.

Hiring is still a bit rough. If you're trying to scale to 50+ engineers then you're going to need someone skilled in training to bring the team up. Throwing them into the deep end won't work. I think smaller teams should generally not have as big of a problem? I'm curious to see how my former employer will maintain Elixir—grow or shrink adoption—over the next 2 years.

sb8244··on TailwindCSS JIT with arbitrary values
Ya I don't know how that will work out exactly. Changes so far haven't been bad for me but no experience with maintenance over time.

I will say that maintenance of hand rolled Sass has not been great overtime. It's really hard to tell what's in use and what's not.

sb8244··on TailwindCSS JIT with arbitrary values
Not really any advice here. I am using it for my product and it has been basically changing up the design as needed. It's pretty common for me to make use of grid-cols-1 and then something like md:grid-cols-2 or 3 to keep it single column on mobile and multi-column on desktop
sb8244··on TailwindCSS JIT with arbitrary values
Bootstrap 3, Sass, styled-components. I am sure there's more but that's the last few years of stuff

Before Tailwind with PostCSS, I'd probably hand roll some Sass-powered UI, or find a template to base it off of.

sb8244··on TailwindCSS JIT with arbitrary values
The big advantage of tailwind for me is that it solves responsive design better than any system I've used before. I'm not amazing at frontend styling (I get by), but I feel like a superhero with tailwind css and UI (worth the money)
sb8244··on After spending $57M on Facebook ads, I was kicked off
I don't want to read their content, but why should I (or someone else) get to make the decision of what others choose to read? I see lots of stuff shared on Facebook that I just can't believe people are into, but they are really into it. Good for them for finding enjoyment in it. If I don't want to see that content, I can mute the person to clean up my feed.

If the content doesn't violate any rules and people want to read it, then it has a place. If it does violate rules, then communicate those clearly. Given that, I think that this is most likely not an issue of rules violation but of Facebook not wanting the content on their platform (and not wanting to actually justify that).

sb8244··on What's good about offset pagination; designing parallel cursor-based web APIs
Thanks for this. It seems obvious reading it but I haven't thought about it this way before. I'm definitely going to explore these concepts!
sb8244··on What's good about offset pagination; designing parallel cursor-based web APIs
I agree. I am going to reflect on this and see if there's a way to support dump files long term in our app. We sorta support it today but it's ad hoc implementation since an export can range from a few hundred of a thing to tens of millions of a thing.

Is there any good literature or patterns on supporting dumps in the tens of millions or larger?

I wrote a sheets plug-in that uses our cursor API to provide a full dump into a spreadsheet. Our professional services team is in love with it, so I bet they'd love generic data export capability.

sb8244··on What's good about offset pagination; designing parallel cursor-based web APIs
> If they wanted to make it easy to get all the results

Speaking from experience...we want to make it easy but also want to keep it performant. Getting the data all in one go is generally not performant and is easy to abuse as an API consumer. For example, always asking for all of the data rather than maintaining a cursor and secondary index (which is so much more performant for everyone involved).

sb8244··on API pagination design
We have explicit cursors and classic pagination in our public facing API. Classic paging is such a thorn in our side, but almost everyone uses it for their v1 unless they ask us for guidance first. We have guides about why pagination is bad, and discourage it in our API rate limits, but it still persists.

Looking back, I would exclude classic pagination from a public API and go full cursor. Possibly include an optional total count that can be requested (counts are expensive in PG though).

sb8244··on Hotwire: HTML over the Wire
Yes there is a lot of stuff different here. I don't want to take that away. Just pointing out that websocket only is not accurate.
sb8244··on Hotwire: HTML over the Wire
It uses long polling over http. To be clear it's not restful http, but it's not websockets. I believe that Chris doesn't believe it's important for most people so there are no directions right now. Could be wrong there, I'm not Chris.

Page changes are still initiated by the client in LiveView (although can be server initiated)

LiveView is just channels under the hood. Once you consider that, long polling may seem more obvious

← PreviousPage 7 of 21Next →