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 2y ago · link · parent

Where does the "expense" come from? You either put glue code on top of existing APIs, having almost no optimization advantages, but still having to combine data (the comment I'm responding to). Or you create new endpoints, with more code reuse in them, and more optimization. How is the latter more expensive than the former?

And if you just talk about having 1 api for 3 front-ends, aren't you then forcing your front-ends to contain a ton of business logic to figure out how and what to display based on your API? You could've just given them what they need, but instead they're forced to weave together some insane tapestry from all kinds of "generic" endpoints you gave them? Isn't it expensive to maintain those front-ends?

comment 2y ago · link · parent

I'm honestly unclear, are you trying to say it's a bad thing? Where is the issue?

comment 2y ago · link · parent

This is not necessarily a good solution to duplication problem, because you're still forced to keep each endpoint isolated, and can't efficiently combine data acquisition from, say, a database. A much cleaner logic reuse is to do it in your programming language. Build an endpoint that returns exactly what's needed for this front-end view, and build another, generic API for others to consume, but reusing a lot of the logic under the hood on the backend.

comment 2y ago · link · parent

So then, are you building your backend API directly to meet the needs of your front-end? Or are you trying to keep it generic for all needs, but also serve the front-end? Are you telling the front-end team to download multiple resources from multiple endpoints when they need to render one thing? Do you have real life other consumers of your API? Are you juggling their requirements vs internal requirements? Is your backend team telling the frontend "it's not a good API design if we give you exactly what you need, so instead please pull these multiple resources?"

Can you adequately measure your page load performance when front-end is making many parallel requests to the back-end and not all of them are required to consider the page "loaded"?

There are countless architectural downsides associated with not just giving the front-end exactly what they need, and there has to be a very good upside for doing this. Front-end freedom is not one of them, because the freedom is minimal and mostly accidental. A good upside can be: you're building specifically an API for building your kind of web application, and you want to dogfood your own work. Otherwise, it seems an incredible amount of unnecessary contention and complexity.

That said, I don't disagree that it _kind of works_ the way you describe, but it could've worked a lot better if your API could just give the front-end exactly what they need. You could've designed it with the exact same process, and they could've worked off of mocks the same way. They just would have all the data sent to them in a much more streamlined fashion.

Disclaimer: I'm the author of https://max.engineer/server-informed-ui

comment 2y ago · link · parent

This article attempts to contribute something novel, rarely discussed, namely how to organize a long term refactor in a team. There are already many great posts and books focusing on the code part.

comment 2y ago · link · parent

Agree with all of this, and recommend this process for engineering tech debt: https://max.engineer/long-term-refactors

In short: maintain a list of long term refactors that everyone's gradually working on, without necessarily showing it in the ticket tracking system.

comment 2y ago · link · parent

Things don't have to be binary to be placed into 2 categories. They can also be bimodal to a varying extent. Most of the time that's what people mean.

comment 2y ago · link · parent

I think the opposite is true: it's infantilizing to treat the reader like they take things literally, or interpret things in the worst way. Most novel categorizations are there to give you a new lens through which you can analyze the world yourself.

comment 2y ago · link · parent

Been using Ikea Kivik sofa for >12 years across 2 moves. We bought it with white cover. Recently we needed to get a bigger one, and realized we can just add 2 chaises on the sides. Bought them, and all new upholstery - now it's like a brand new bigger couch of different color. Happy side effect is that those chaises came with metal brackets that reinforced the whole thing. Here's to another 12 years. Ikea is underrated.

comment 2y ago · link · parent

My god, that fits right in. Yes. Would love to find more pointers towards similar music. I didn't know this song (albeit sounds vaguely familiar), and it's instantly going on the playlist.

Edit: Half that album is going on the playlist. I definitely remember hearing erase/rewind, but never knew where it was from.

To reciprocate, here's little known, imo one of the most underrated records by KT Tunstall: https://www.youtube.com/watch?v=xWKj96zhCpw — the more you listen and hear detail, the more it grows on you.

Here's a little known Sting record of a famous song, that's my favorite rendition of it: https://www.youtube.com/watch?v=bqG7b5yNbGk

Both of these are on a softer side, but I like heavier-sounding stuff in the same vibe too. (Like Paranoid by Garbage) Most of those tracks in my library are Russian however. :(

341.

US School Shooter Emergency Plans Exposed in a Highly Sensitive Database Leak(wired.com ↗)

3 points · by hakunin · 2y ago · discuss

comment 2y ago · link · parent

I'm trying to identify the kind of music I like, and it's not particularly obscure, but I feel like it hasn't been made before and after 90s and early 2000s.

It's a range from mellow to energetic. On the mellow side we have trip-hop/lo-fi. Clear enough. Plenty of radios for this. On the energetic side we have complex beats like Prodigy. Seen a couple of radios. But in the middle, feels like there's nothing. I'm looking for bands like Garbage. KT Tunstall is similar. The only way I could describe it, is that it's jazzy/bluesy rock from 90s and early 2000s with cool/elegant sounding beats/bass. Quite a lot of Russian rock was like this too in that period. If anyone can identify what I'm talking about, give any pointers, I would much appreciate.

comment 2y ago · link · parent

With Ruby, you have many different, expressive ways of saying the same thing. Examples that come to mind off the top of my head: deciding to vertically align keyword arguments sometimes. Wrapping code differently to meet a line length limit. Breaking the rule of "never making a variable one letter long" in tiny, clear code snippets to make everything read better. Choosing to use double vs single quotes (single quotes signal that the string has no interpolation). Putting a space at the start/end of array and hash literals in some cases. Using .call() or .() or [] to call a lambda. There are many other little things like that. Each one seems insignificant, but together they replace all human consideration. And since Ruby is very concise and efficient (small amount of code gets a lot done), expressing your "hows", "whats", and "whys"[1] in the most readable way should be where you spend some of your time.

[1]: https://max.engineer/maintainable-code

comment 2y ago · link · parent

Because humans can break a rule in favor of readability, symmetry, clarity. Linter can't.

comment 2y ago · link · parent

Most counterarguments go something like "It's bad when everyone writes in their own style, that's why one style should be enforced." But this gets you right into the other extreme: code consistency is valued above comprehensibility. Now your code is harder to read because you format it mechanically, instead of using your own human consideration.

The right answer in my view is kind of what I think DHH is trying to get at: have enough rules to avoid straight up sloppiness and clear no-nos. Don't have any rules that might change based on human consideration.

comment 2y ago · link · parent

I am in the camp of using as little rubocop as possible, but still using it. I like it to address the drastic stuff like misalignments, mixed tabs and spaces, obvious sloppiness.[1] Still, it should allow most of the freedom. My preferences are posted in what I call a "narrative" Rails template[2]. It's a relaxed "standardrb", which I have since relaxed even further, but haven't updated the repo yet.

[1]: https://github.com/AuthorizeNet/sdk-ruby/commit/1972b153a893... [2]: https://github.com/maxim/narrative/blob/main/example_app/.ru...

347.

Long Term Refactors(max.engineer ↗)

2 points · by hakunin · 2y ago · discuss

comment 3y ago · link · parent

That’s exactly the kind of difference between json and jsonb that you gotta keep in mind. Object properties are unordered, but a json string is very much ordered. It’s the same sequence of characters and lines each time, unless you parse it and dump it again. So if you want to preserve an unmodified original json string for some (e.g. cosmetic) reasons, you probably want json.

comment 3y ago · link · parent

I wouldn't be too surprised if this happens on re-read, but it was definitely the right book at the right time.

comment 3y ago · link · parent

Thanks, will check it out.

comment 3y ago · link · parent

When I immigrated to USA, his books were my way of learning English in high school. I still (23 years later) consider Moon Palace one of my favorite books of all time. Paul has a way of making the real world feel somewhat magical, wistful, mysterious. The only similar feeling I got since then was when playing the game Disco Elysium.

352.

Long Term Refactors(max.engineer ↗)

1 points · by hakunin · 3y ago · discuss

353.

Long Term Refactors(max.engineer ↗)

2 points · by hakunin · 3y ago · discuss

comment 3y ago · link · parent

Been using this font for a while, but ultimately ended up switching back to Input Mono Condensed. It’s similar, but looks neater to me. And no cursive.

comment 3y ago · link · parent

This was an enjoyable light read. A window into solving a programming problem outside my day to day work, easy enough to follow, with a couple of fun concepts like "psychoacoustic model".

Thank you for sharing.

comment 3y ago · link · parent

In person you also have to worry about your stomach, your nose, your back, your BO, and in some cases, you still have to stare at some screen or whiteboard. Letting your eyes rest during a meeting seems a lot more manageable.

comment 3y ago · link · parent

Two unexpected extra use cases for stand-up desk:

1. If you like recording vocals/singing while standing, you can have your microphone on the desk, but bring the desk up. (Thanks to memory you can have multiple heights for i.e. spouse).

2. If you do physical activity (gym, running, etc) and come home sweaty, but don't want to shower right away: now you can use the computer without putting your sweaty butt down on your chair.

comment 3y ago · link · parent

It seems like they often work this way. Line up individual pieces, then release a product that ties them together. I.e. the Apple Silicon transition, the VR headset.

comment 3y ago · link · parent

Two things that I think are quietly brewing and will erupt:

1. Gaming scene. Apple could make new profits if they figured out a way to make most existing games playable on most of their efficient hardware. Seems like they are taking steps in this direction.

2. Private AI. Apple has been building their neural engine into every device, but is yet to fully unleash its potential. Rumors say they are working on this as well.

comment 3y ago · link · parent

Copying my comment from another article:

This time I used VSCode for nearly 2 months. Thought it's the end of an era, I'm not coming back to Sublime Text. I decided to push through and customize the configs just right for me, it was really becoming comfortable. Main reason why I wanted to switch is more active dev, more active extension community, and well integrated modern (some ML-backed) code writing and navigation tools.

I was wrong. After all the painstaking customization to bring it close to my ideal experience, while also getting used to things I didn't want to fight, I still had a bad time.

For one, the tab/cursor focus keeps going into weird places. I press a button, like ESC to switch to normal vim mode, and instead it does nothing, or something different, because turns out I'm not in the editor anymore. Keeps happening, maybe my own fault. The nifty AI tools integration is more of a nuisance — they jump in at bad times (with a delay), and their tab/enter functionality is weird, can never get it right. Most of my autocompletes have been unintentional. Maybe my own fault again, but felt super awkward. There is still no good vertical align plugin, despite such an active community (Sublime doesn't have one either, although they have one that gets me a bit closer). The language server stuff that worked badly in Sublime for my language also works badly in VSCode. The extensions, while numerous, are of questionable quality. I tried to stick to just a few well known ones.

After all the effort, I slowly came to realization that I'm back to not really using anything unique to VSCode, sacrificing more than I gained, being surrounded by lots of small moving details everywhere in the UI that make my experience more awkward than helpful, and occasionally getting my cursor stuck in weird parts of UI. I went back to Sublime.

1
111213
19