HNHacker News
TopNewBestAskShowJobs

brendanmc6

490 karma · joined March 9, 2018

Elixir / Phoenix convert
submissionscomments
brendanmc6··on 1Password pricing increasing up to 33% in March
1password is by far my most recommended subscription to friends and family.

In a world where almost every single app or service I use has thrown me into a rage from enshittification or show-stopping bugs or both, where I can hardly even type this message because even iOS keyboards have regressed… 1password is actually a great service that makes my life objectively better.

I put them in an exclusive S-Tier with, surprisingly, Chase Mobile (in recent years), Signal, Google Sheets, and maybe an few others. They just work.

Since the rest of them ignore my 1 star App Store reviews and my desperate, detailed bug reports, the only power I have left is to support good software and recommend it to friends.

brendanmc6··on How I use Claude Code: Separation of planning and execution
Same, I formalized a similar workflow for my team (oriented around feature requirement docs), I am thinking about fully productizing it and am looking to for feedback - https://acai.sh

Even if the product doesn’t resonate I think I’ve stumbled on some ideas you might find useful^

I do think spec-driven development is where this all goes. Still making up my mind though.

brendanmc6··on Improving 15 LLMs at Coding in One Afternoon. Only the Harness Changed
You’re absolutely right! This isn’t your average engineering advice— it’s like painting the reader a vivid tapestry of the author’s mind.
brendanmc6··on Denial of service and source code exposure in React Server Components
> Honestly it is kinda nice.

It's extremely nice! Coming from the React and Next.js world there is very little that I miss. I prefer to obsess over tests, business logic, scale and maintainability, but the price I pay is that I am no longer able to obsess over frontend micro-interactions.

Not the right platform for every product obviously, but I am starting to believe it is a very good choice for most.

brendanmc6··on Ask HN: How does one build large front end apps without a framework like React?
The big win for me has been the built-in PubSub primitives plus LiveView. Since the backend is already maintaining a WebSocket connection with every client, it's trivial to push updates.

Here is an example. Imagine something like a multiplayer Google Forms editor that renders a list of drag-droppable cards. Below is a complete LiveView module that renders the cards, and subscribes to "card was deleted" and "cards were reordered" events.

```

  defmodule MyApp.ProjectLive.Edit do
    use MyApp, :live_view
    import MyApp.Components.Editor.Card

    def mount(%{"project_id" => id}, _session, socket) do
      # Subscribe view to project events
      Phoenix.PubSub.subscribe(MyApp.PubSub, "project:#{id}")
      project = MyApp.Projects.get_project(id)

      socket =
        socket
        |> assign(:project, project)
        |> assign(:cards_drag_handle_class, "CARD_DRAG_HANDLE")

      {:ok, socket}
    end

    def handle_info({:cards, :deleted, card_id}, socket) do
      # handle project events matching signature: `{:cards, :deleted, payload}`
      cards = Enum.reject(socket.assigns.project.cards, fn card -> card.id == card_id end)
      project = %{socket.assigns.project | cards: cards}
      socket = assign(socket, :project, project)
      # LiveView will diff and re-render automatically
      {:noreply, socket}
    end

    def handle_info({:cards, :reordered, card_change_list}, socket) do
      # omitted for brevity, same concept as above
      {:noreply, socket}
    end

    def render(assigns) do
      ~H"""
      <div>
        <h1>{@project.name}</h1>
        <div
          id="cards-drag-manager"
          phx-hook="DragDropMulti"
          data-handle-class-name={@cards_drag_handle_class}
          data-drop-event-name="reorder_cards"
          data-container-ids="cards-container"
        />
        <div class="space-y-4" id="cards-container">
          <.card
            :for={card <- @project.cards}
            card={card}
            cards_drag_handle_class={@cards_drag_handle_class}
          />
        </div>
      </div>
      """
    end
  end
```

What would this take in a React SPA? Well of course there are tons of great tools out there, like Cloud Firestore, Supabase Realtime, etc. But my app is just a vanilla postgres + phoenix monolith! And it's so much easier to test. Again, just using the built-in testing libraries.

For rich drag-drop (with drop shadows, auto-scroll, etc.) I inlined DragulaJS[1] which is ~1000 lines of vanilla .js. As a React dev I might have been tempted to `npm install` something like `react-beautiful-dnd`, which is 6-10x larger, (and is, I just learned, now deprecated by the maintainers!!)

The important question is, what have I sacrificed? The primary tradeoff is that the 'read your own writes' experience can feel sluggish if you are used to optimistic UI via React setState(). This is a hard one to stomach as a react dev. But Phoenix comes with GitHub-style viewport loading bars which is enough user enough feedback to be passable.

p.s. guess what Supabase Realtime is using under the hood[2] ;-)

[1] https://bevacqua.github.io/dragula/ [2] https://supabase.com/docs/guides/realtime/architecture

brendanmc6··on Ask HN: How does one build large front end apps without a framework like React?
I've abandoned Next.js and React for Elixir / Phoenix. I am able to build a perfectly pleasant user experience with just a sprinkle of vanilla JS via Phoenix hooks.

The fact that I have been able to build a multi-user collaborative editor experience without a single additional dependency is incredible. I previously worked for a well-established and well-funded React team who had this feature on their roadmap for half a decade but still find it too daunting to implement.

Phoenix was a great reminder that a lot of the "frontend engineering" we find ourselves doing as React developers just isn't necessary with the right backend. It's HORRIFIC to look back at all the yakshaving I've done in my career already. Wrangling types (GraphQL, codegen libraries), wrangling queries and data-fetching (react-query, SWR, server components), fiddling with middleware (serverless functions, getStaticProps, CDNs). I've seen teams outright abandon testing because the hours they invested just weren't catching any of the bugs that mattered.

I'm not doing any of that anymore. I'm spending that time refining the core data model, improving test coverage, thinking about go-to-market and making money.

Phoenix may not be a good choice if your product has reached that level of maturity and product-market fit where you really should care about "microinteractions", fine-tuned animations, or advanced use-cases for an SPA like offline support and highly-optimistic UI. But I would argue that even mature products don't truly need these things. Just look at the GitHub UI. I've spent a truly astronomical number of hours in that UI and never wished I had WYSIWYG text editing, or animated skeleton UIs, or the dozen other things that the React community tells us we need.

brendanmc6··on Ask HN: Best board games of 2022?
That sounds great, thanks for the recommendation!
brendanmc6··on Ask HN: Best board games of 2022?
I’m a huge fan of Eurogames but I regret buying Wingspan, it is an absolute bore. After 5 or 6 games it became kindof a meme in my family. “What shall we do now? A round of bird game?”

Beautiful packaging and pieces though! And it’s very cool that it works single player and two player. But nothing eventful at all happens, and nobody feels any compelling reason to rack up points.

So many other great games in the genre though.

brendanmc6··on Framework Laptops now have 4 Thunderbolt 4 ports
Since I assume some Framework product people are in here— my framework won’t go to sleep which is an absolute dealbreaker. Dead battery every time unless I fully shut it down. Forums are no help. Advice?

I’d love to support your mission and recommend this laptop to others, but you need to get the fundamentals working!

See my comment history for other similar reports from other (former) Framework owners.

brendanmc6··on Framework is now available in Australia
I'm almost ready to sell my DIY Windows framework and go back to mac. It won't go to sleep-- fans always spin unless I shut down completely. Forums aren't any help. Anyone have this issue? Other commenters have similar complaints here https://news.ycombinator.com/item?id=31433556

I really wanted to support this company because I believe in repairability! But repairability is meaningless the software doesn't work... I'm not a 16 year old enthusiast anymore, I don't have the time or patience to troubleshoot drivers, firmware, devices etc. etc. :(

brendanmc6··on Ask HN: Accepting ETH payments on my website
Paying with ETH is the easy part— few lines of javascript using Ethers.js

The hard part is managing wallet connections, and then automating what happens after payment is complete.

For wallet connections I use web3modal.

For reconciling the purchase after payment, no clue. I use coingate for crypto checkouts for this reason. There are probably backend libraries out there to help you track and respond to transaction events on a given address. Let me know what you find!

brendanmc6··on Show HN: I made a puzzle game in HTML5
Same here. Game breaking bug on level 5. iOS Chrome. Swipe up a few times on a column and a circle disappears.
brendanmc6··on Storybook: UI component explorer for front end developers
I'm on my second team that's tried and failed to implement this (well, I consider the current setup a failure, the leads apparently don't?).

Extra work for no benefit, broken builds, type and lint ignores everywhere, demos always out of date or incomplete.

If your designers are skilled and organized, you don't need this. "But my team doesn't have skilled or organized designers!" ... well then you probably have bigger problems, messing with Storybook is the last thing you want.

brendanmc6··on Ask HN: Has web development become insane or am I stuck in my ways?
I ditched firebase cloud functions for Next's /api/ functions. I put all the db stuff and checkout and webhook stuff behind those endpoints. At first I just loaded the entire firestore library on the client and did authenticated reads/writes directly... But I wouldn't do that again, made my app too heavily intertwined with firestore's api.
brendanmc6··on Ask HN: Has web development become insane or am I stuck in my ways?
I came late to the software and web development game. I just wanted to prototype a tool I needed and ended up becoming a full time developer.

After grasping HTML and CSS basics, prototyping my heavily interactive tool seemed impossible with JS alone, until I learned React. React solved real problems for me. Create-react-app with a firebase backend got me VERY far with zero formal education.

But I struggled with SEO, load times, and needed a sprinkle of server-side logic. Next.js solved those problems, and more.

As my prototypes grew into products, complexity was hard to manage. Refactors were impossible, even with small, modular components and well tested functions. Enter TypeScript. The single most important tool in my toolbelt. I refuse to work in plain JS now.

I'm several years in now, at my 2nd full-time dev gig and working on my 3rd side-business. My stack is Typescript, Next, vercel, firebase. Both at work and at home. Hardly any third-party dependencies needed beyond these (stripe, coingate, mapbox). I write most my CSS by hand with css grid because its the least verbose way I've found so far. I auto-format with Prettier.

I can use types and tests across my stack, I can enforce bespoke auth/permissions behavior, all kinds of queries, media upload, pretty much everything I'll ever need outside of real-time collaboration. I can build and maintain profitable products by myself. I've done it.

This also happens to be a very popular stack. What's insane about it? Every alternative I've looked at looks way less sane. Multiple languages and repos for one app? No thanks. Managing server instances and databases migrations myself? I hope I never have to. Software is fun, but I like making products more. JavaScript just happens to be the best way I've found so far.

brendanmc6··on Ask HN: How can I, a programmer, help with the fight against climate change?
This is something I've thought a lot about, as I got two degrees in environmental studies, but ended up becoming a programmer because it pays more and is fun. I promised myself I'd never 'sell out' and would at least work on something loosely related to climate. So far so good.

So as far as programming jobs, the most interesting would be working for a company that is explicitly focused on climate:

- Carbon markets are growing fast. Here I'll plug the company I co-founded, [Offsetra.com](http://offsetra.com/). It's a competitive space, and a unique one, but I 100% believe in it and I know it will play a significant role in global emissions reductions. Lots of room for web and app development.

- Carbon accounting is also growing. A fantastic space where software and automation can solve problems and lower costs. I helped build a very simple tool, carbon.fyi, which led to a truly astonishing amount of attention, media & impact. I'd like to keep building more tools in this space.

- Hard core engineering. New energy tech, battery tech, materials, or efficiency improvements. Surely room for software, but requires specialization.

- Fun moon-shot startups like the ones you see here from YC. Most tend to be focused on Direct Air Capture. I'm not so excited about that, but some people are.

Not strictly climate-focused, but still super relevant:

- The broad ESG, consulting and green-investment space (includes carbon accounting, but also non-financial reporting, investing, venture capital etc.). Basically 'helping companies go green'. Billions of dollars in this industry, plenty of room to improve process and automate.

- GIS. This is where I ended up for my day job. Geographic Information Systems. Building or using the software that governments, consultants, and researchers use to understand the planet. From hardcore lowlevel programming, to machine learning, web-dev, design and more. Huge and important industry. Caveat: the fossil fuel industry also loves GIS.

- Transit, mobility, urbanism. Love this field. I worked for a wonderful mobility startup and interviewed with many others. Even Google is involved in this space, of course through Google Maps, but also Sidewalk Labs.

Other things I can think of... climate modeling and academic research, social organization/activism and politics.... NGOs definitely hire developers, especially web and frontend. I've interviewed with Vizzuality, Environmental Defense Fund, and some others I forget.

DM me, I'd love to connect.

brendanmc6··on Atlantic Ocean currents weaken, signalling big weather changes: study
Before any of that we need a heavy carbon tax. "We" being every developed country. A tall order... but absolutely vital.
brendanmc6··on Slate – A completely customizable framework for building rich text editors
I've been building out a very feature-rich editor for the last few months using Slate. Looked at all the alternatives and fell in love with Slate's model over all others. It's been great so far, far better than the old Quill editor I've been tasked with replacing. My only complaints are related to documentation, and a few footguns if you misuse the provided utilities, or get too crazy with your rendered react elements.

Test-driven development is not my usual approach to coding, but it's extremely beneficial (and easy to do) with slate. Especially for the recursive normalizer, which has grown very complex and fragile but plays an extremely important role in my editor.

I worry about long term maintenance of the library, only a small trickle of contributions come in. But in practice its been a perfectly stable library.

RTE in the browser is a full-time job even with a library like slate. Be warned!

brendanmc6··on Advertisements literally being forced into your eyesight
I come to the beach in SoCal to surf and relax in the company of seals birds and dolphins. There are still plenty, but often accompanied by:

- airplane banner ads

- squadron of some extremely expensive military craft going nowhere for no reason

Funny how as I kid I used to think those would be cool jobs. How jaded and bitter I've become!

Oh and all the willpower it took for me to not raise two middle fingers at that duo of parasailers who kept buzzing and dive bombing the lineup. At least they were out there for fun not profit.

brendanmc6··on Shell ordered to cut CO2 emissions by 45% in landmark climate case
> the temperature will go up a couple degrees. Who cares! We're engineers

Sorry, this is one of the worst takes on climate I've ever seen on HN, and the bar here is very low...

Take time to actually study the problem and you will come to the same conclusion: it can only be solved with government intervention. The most efficient government intervention would be a carbon tax set at the estimated social cost of carbon, but that (being a tax) is also extremely politically unpopular.

So we are left with less efficient policies, like outright bans, court orders, expensive subsidies, and emissions caps.

brendanmc6··on Ask HN: How are you implementing membership/auth for your SaaS or other project?
Firebase Auth is my go-to, but I don't consider myself an expert as I only work with TypeScript and React/Nextjs. I still have to do some hands on work managing the user session, and relating users to other related records in Firestore. And their prebuilt UI components can be problematic. And of course I have to keep user data in sync with payment state by handling Stripe events.

I'd love to find something even more hands-off for my next project...

brendanmc6··on Vercel Serverless Functions vs. Cloudflare Workers
Wow this was extremely informative for me! Cleared up a cacheing concern I had. Thanks for sharing.

I've had good success using the free tier of Vercel functions to handle the low-traffic storefront and user accounts for offsetra.com - Just wrapper functions around stripe and firestore. It's a godsend for independent, unskilled, time-constrained front-end devs like me!

brendanmc6··on Write Simply
Your examples are plain assertions. "do this."

Paul's are more convincing, even though he doesn't assert anything. He just provides the rationale.

brendanmc6··on Simple and privacy-friendly alternative to Google Analytic
Loving the Plausible paid/hosted version, just upgraded yesterday. Exactly what I need and nothing more. Totally painless. As a dev I really cant think of anything I dislike! I don't do any A/B testing or social engineering nonsense, I just want to know where people are clicking from and when.

Being able to create password protected links for my colleagues is really nice though!

brendanmc6··on CryptoArt WTF Ecological Cost Calculator
This is inspired by & using emissions data from the calculator I helped build: https://carbon.fyi

Read our "learn" page for a brief introduction and a little more info. Let me know if you have questions. Unfortunately I'm about to head for the desert so I'll see if some colleagues are available to reply on my behalf :)

CryptoArt.wtf and carbon.fyi have both helped spark a huge influx of artists into an "eco-nft" discord which has been really fun to be a part of, so much great debate and discussion going on.

brendanmc6··on What I Think of Bitcoin
Totally false. Reduced mining power doesn't reduce the number of blocks being generated. Block mining PoW difficulty increases or decreases based on a running average of past block times[1]. This, given the block size limit, is the very mechanism that caps transaction throughput.

Lower prices have always led to less transaction volume which has always made it cheaper and easier to get your own transaction confirmed.

"don't invest in something you don't understand", can I ask that you don't spread FUD about something you don't understand?

[1] https://bitcoin.org/bitcoin.pdf

brendanmc6··on Elon Musk’s $100M Gigaton Scale Carbon Removal Prize
I've been doing a lot of reading & thinking on this lately as I just finished building https://carbon.fyi

Your take is 100% correct, but we still opted to use Ethereum Gas units as our "emissions factor" because it represents useage of and relative benefit from the Ethereum network.

We are interested in raising money for carbon offsets, so if we ask the question of "who pays?" it wouldn't be fair to place the burden on miners when all users benefit from the security and stability that comes from mining.

I'd eventually like to develop a model that allocates emissions based on "unit of time held" which is a more accurate allegory for 'benefit' for speculative assets like Bitcoin (if we are honest about Bitcoin's purpose), and because of the macroeconomic reasons you mentioned.

It's an interesting problem and discussion because unlike driving a car or eating meat, simply reducing consumption won't fix the problem, and yet we would all agree heavy users or benefactors of the network should bear more of the burden.

brendanmc6··on Email from Jeff Bezos to employees
> Why don’t non-MBAs manage to get to the top?

Because smart and talented people who are interested in business or administration tend to go on and study it. It’s self selecting. I think maybe you are imprinting “MBA” as some sort of personality? I know designers, coders and biologists with MBAs. It’s just an accreditation.

Every business has its roots or foundation with makers. But that doesn’t mean a chef should be running McDonalds, or a woodworker should be running Home Depot...

brendanmc6··on JavaScript Rising Stars 2020
Master typescript and you will be rewarded greatly! It is a fantastic tool with a very high level of adoption already. It makes React significantly easier to write and refactor. You won’t ever go back to plain .js!

Deno is not relevant enough, I would wager 99.99% of the existing projects you might find yourself working on in the next few years will be using node somewhere in the stack. It shouldn’t be hard to pick up deno when it eventually does show up.

brendanmc6··on London will be overwhelmed by Covid in a fortnight says leaked NHS briefing
Following your nonsensical logic there would be no difference in covid cases between states or nations. Obviously this is not true.

It is absolutely the government’s job to enact policy to slow the spread of deadly disease. It is also the job of governing leaders to encourage and educate citizens on how and why they should comply with these policies. This is where the USA is failing miserably.

We could discuss the tradeoffs and the details, that’s fair, but it’s totally irresponsible of you to say that this massive spike in cases was ‘inevitable’.

← PreviousPage 2 of 4Next →