Better HN
topnewbestaskshowjobs
Log inSign up

hakunin

2,515 karma · joined Mar 4, 2010 (16y ago) · 549 submissions

https://max.engineer, mastodon:ruby.social/@maxim, x.com/hakunin, bsky.app/profile/max.engineer

meet.hn/city/43.1009031,-75.2326641/City-of-Utica

---

Submissions

comment 1y ago · link · parent

I completely disagree. By writing the code, the author gains understanding of the hidden details of the problem. The reviewer gets to explore a full solution that accounts for those details, and provides tests. With the context still fresh, it's a great time for a new pair of eyes to explore, ask questions (which should lead to clarifications in the code), and think of ways to simplify and untangle the solution further while keeping the tests passing. In fact, it can take more time to keep assuming and discussing what the solution might be than to write the code and iterate on it. In an asynchronous/remote work environment, iterating on PRs is not only okay, but probably the most effective way to collaborate.

comment 1y ago · link · parent

It's probably a version of that. But since data is assumed sorted, memory requirements almost never grow beyond one item per stream.

comment 1y ago · link · parent

I don’t think that can happen because all those functions assume the streams are consistently sorted.

comment 1y ago · link · parent

Lazy enumeration can also save memory, because you aren’t storing entire collections during intermediate steps, and it works with infinite/unknown size collections. Such as streaming data.

Some examples:

I wrote a utility gem a while ago that lets you lazily intersect, union, etc various potentially infinite streams of data. https://github.com/maxim/enum_utils/

I also used lazy enumeration for traversing the wordmap in my no-RAM static storage gem. https://github.com/maxim/wordmap/

comment 1y ago · link · parent

I think you don't really know what you want if you don't know why you want it. Learning to understand oneself is a huge part of one's personal growth. When you don't know the "why", it's easy to be mistaken about what you actually want, and push for a superficial projection of it, not the real underlying thing. (And therefore lose out on relationships you didn't know you'd be happy with.) But we speak in generalities of course.

comment 1y ago · link · parent

Only issue is that when you get what you want, you might be convincing your partner(s) to settle for something they want less. Perhaps the mindset of "best I can get" and finding an acceptable compromise is the way to go.

comment 1y ago · link · parent

Yeah I realized, but preferred to keep my own format.

comment 1y ago · link · parent

And here I thought "Yay, I can find more people in my area." Nope, it's just me, like I suspected.

comment 2y ago · link · parent

I remember reading this jwz post[1] in 2012 where he said he never uses tabs at all, and realizing that I can use a combination of windows and tabs. So now I just have each window contain a bunch of tabs for one topic. If it's WIP, the window stays open or minimized, if it's a long term thing, I convert it to Safari's tab group. Not sure why more people don't use multiple windows, it's way more convenient than just having hundreds of tabs in one window.

[1]: https://www.jwz.org/blog/2012/04/why-i-use-safari-instead-of...

comment 2y ago · link · parent

Weirdly, I like ligatures only in Elixir, and no other language (Ruby, Go, Javascript, etc).

comment 2y ago · link · parent

Dupe https://news.ycombinator.com/item?id=42024246

comment 2y ago · link · parent

Prospective and retrospective analysis are fundamentally different. It’s easy to point to successes and failures of the past, but that’s not how we predict the concrete future potential of one specific thing.

comment 2y ago · link · parent

How do you write a test for code clarity / readability / maintainability?

comment 2y ago · link · parent

> You probably went through Ecto 1 -> 2 -> 3 and Phoenix was migrating to contexts.

> But I also have to say there was a lot of FOMO in relation to OTP back then: people felt they had to build these amazing supervision designs, otherwise they were not using the language correctly.

Exactly!

Contexts really threw me off, because I couldn't figure out how/why would I set a boundary up front, if I'm not even sure how the app is going to turn out.

comment 2y ago · link · parent

Here’s my anecdote.

I built 3 production projects in elixir around 2015-2018, and it was a blast to learn and work with. Those were interesting projects that were a great fit for the stack. One was March Madness bracket game which required a huge throughput on day one, and another was a football game audience play calling each play from their phone as the team is playing live at the stadium. This one needed a lot of timing coordination and poor connection handling. I even put out an open source fast/customizable leaderboard on top of ETS.

However, I didn’t feel the need for this stack on most projects, and if I’m totally honest, I never got good at the novel way of building applications in it.

While it was very enjoyable, everything felt a little awkward. Even 3 years in I constantly felt that I’m not doing it right, and I’m fighting the language to do data transformations in a purely functional style. I never got used to writing Ecto queries, and always had to look up their syntax. Plus, there didn’t seem to be a good architecture story, just isolated praise of OTP. And Phoenix further fueled the confusion, making it hard to understand whether I’m supposed to reason about my app like a Rails app (just build controllers, models, and views) with no regard for processes, or I should orchestrate some creative supervision trees, that I can’t even tell how they would be arranged in a typical web app. Going back to Ruby on Rails was kind of back to super productive comfort zone after a bit, and I just continued staying there.

I’m still looking back at Elixir with nostalgia, wondering if I’m going to have a chance to go back to it and really make it an extension of my arms/brain like Ruby had become. And whether I can do all that amazing supervision-based architecting I keep theorizing in my mind. I loved Dave Thomas’s vision (and agreed with his controversial takes) and really wished I could get as good as Sasa Juric at really deeply reasoning in this framework. Maybe one day.

comment 2y ago · link · parent

I responded to another thread under this comment, but can you give me some examples?

comment 2y ago · link · parent

That's not at all my experience. There's a one-line integration between almost everything under the sun and Rails (business/traffic analytics, performance/profilers, error notifications, logging, object storage integration, I could probably go on). Many other frameworks don't even have the general capability of doing one-line integrations.

comment 2y ago · link · parent

Correction: you mean 2014, not 2024.

Do you think there is no criteria worth considering besides the size of the hiring pool? What if 2 hiring pools are sufficiently big, do you still pick the bigger one every time?

comment 2y ago · link · parent

You vastly underestimate what a 6yo can do. Case in point, one can understand the entire content of a book like Little Prince or Secret Garden, an entire plot of Marvel or Harry Potter movie, build 18+ yo lego sets, and play Theme Hospital and actually win levels. Animal sounds? Don't put speed limits on kids' learning.

Also, how would you listen to VHS tapes?

290.

Ask HN: Quality ad-free audio content for kids?

2 points · by hakunin · 2y ago · 3 comments

comment 2y ago · link · parent

Having read the article, the team just seems more experienced with frontend than backend dev. As somewhat an old school dev, I've been noticing these small fears and misunderstandings in the way FE devs think. Honestly, I believe it only takes a minor adjustment in thinking to understand how this stuff works, but I get it — many people at this point have never seen regular client/server approach in their entire careers. That said, I get the value of off-the-shelf React components, and ease of finding docs/help, so wouldn't discount that anyway.

comment 2y ago · link · parent

This is a good "what not to do". A while ago I wrote a "what to do"[1], which could serve as a good complement to this article.

[1]: https://max.engineer/mindful-code-reviews

comment 2y ago · link · parent

To be clear, this is Kamchatka Peninsula by the Pacific Ocean, located in the Ring of Fire[1].

[1]: https://en.wikipedia.org/wiki/Ring_of_Fire

comment 2y ago · link · parent

I can't escape Sublime Text's grip. The editor is incredibly smooth and gets out of the way like no other. (Tried a bunch of them). However, lately I started opening Zed on occasion just to ask ChatGPT to make a non-trivial edit on a bunch of code. The way Zed does inline AI assist is unmatched. That's why I can't wait for Sublime to gain this functionality, so that I can calm down and stay with it.

comment 2y ago · link · parent

It's really hard to be a good architect, because their job is not supposed to be to leave their mark. An architect is doing a great job when the codebase is boring, and everybody talks about business. That doesn't help the architect however, because people can't tell how it would've been had they not been there. "Our codebase is so simple and boring, why do we even need an architect". That's how you get the kind of architects that try to look impressive to the management.

There are a few things a business can do to get a good kind of architect.

1. Hire them to be hands on with code (give them secondary features or refactors, not major lifts, since shipping speed is not the priority). 2. Don't give them authority over devs, rather ask them to provide mentorship and demos. Their job is to excite devs about a clearly better approach, not to force their opinion. 3. Encourage devs to come to the architect for advice as needed. 4. Have the architect organize long term refactors[1] when needed.

Basically make them a developer whose audience is other developers, and the product of their work is developer buy-in/excitement over good practices and software design directions.

[1]: https://max.engineer/long-term-refactors

comment 2y ago · link · parent

I agree that this article is just a naive conversation trigger, and that complex front-ends will lead you down this path.

However, there's another path, which is where you keep things on the backend. Unless you're talking about very complex interactive experiences, the amount of front-end code can go from >100% of the backend code, to <5-10%. Backend always implements almost everything anyway, and the question is how much should front-end reimplement on their side too.

Every time I push for smaller front-end, I'm faced with how the team might get bored or not have enough to show on the resume.

comment 2y ago · link · parent

Ruby can parse itself, it has test coverage, vulnerability auditing, SQL auditing, static and runtime analysis and type enforcing tools…

Rails has an incredibly convenient REPL that's built into every dev error page, a one-line integration with every error, analytics, and log-tracking service under the sun, that will give you all of the insight into production runtime for basically zero effort.

You install Sidekiq or GoodJob in a couple of lines of code, and suddenly you have the entire background job system to tap into for any delayed or periodic workflows that can be offloaded, bundled with monitoring and administration UI.

All you need to do is learn how to do software design, but even there Rails starts you off with arguably the best design decisions you can make at early stage: focus on your entry points (controller actions for requests, rake tasks for CLI), and start extracting domain objects as you learn more about your domain.

Am I missing something? Where's the "hostility to tooling"?

comment 2y ago · link · parent

In our current project it's Stimulus/Turbo on the admin side (maintained by the backend devs), React on the end-user side (maintained by the front-end devs). I haven't met a single front-end dev who prefers the Rails approach. Even after trying to do some light convincing and demoing. They seem to be too committed to the React ecosystem in my experience. I can respect that, too much has been built for it already, and it's generally in high demand.

Plus, Rails story has no clear JSON boundary between back and front, which creates some discomfort (i.e. learning erb) as well. As a backend dev, I'm all-in on Rails in solo projects.

comment 2y ago · link · parent

I think the post is making a poorly-worded switch to talking about fragmentation in backend node packages.

comment 2y ago · link · parent

There's a bit of conflation between easy and simple here. Cloud is easy-ish, but it's not simple due to the proprietary abstractions you aren't meant to access. If things go wrong, you can't investigate past a certain point. Granted, clouds go to great lengths to make their own failures auto-handled for you, but that actually increases complexity in order to remain easy.

Running your own machine is definitely simpler because you can debug a problem all the way down to bare metal. Not easier, but simpler.

That said, the more I do this stuff, the more I want simple, not easy. Easy is good when you're on the happy path, but as soon as something goes wrong, you wish it was simple instead.

In an ideal world, all the guts are exposed, but in the clearest, most organized way possible, where you always have an option to go one level deeper if you want. This would be great to have in both software interfaces and software design (code).

1
91011
19