Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
hakunin
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
29 ms
·
391.
▲
Adventures in Ruby-esque type enforcement
(max.engineer)
4 points
by
hakunin
3y ago
|
0 comments
392.
▲
by
hakunin
3y ago
Frankly, parentheses was the last thing on my mind. I typically use them by default, and remove them in cases where it might make sense. Mostly I was thinking about stuff like arrangements of hashes, arrays, method arguments, naming of meth
393.
▲
by
hakunin
3y ago
I think in general it's almost impossible to cut out human consideration and still get auto-clarity. With an auto-formatter you gain a little speed and lose a little readability. I think most people are really arguing about whether thi
394.
▲
by
hakunin
3y ago
You’re right that if your goal is to write English-like code, then clarity may suffer. The same is true if your goal is to write consistent strict mechanical code. The only goal I think that makes sense, is to go for clear code based on sha
395.
▲
by
hakunin
3y ago
Problems like these often come from the pressure to ship fast, and not writing code 2-3 times to find a good way to express something. If you're going to rush through abstracting things away, I'd rather you duplicated. If you will
396.
▲
by
hakunin
3y ago
While those decisions are completely meaningless as far as performance or correctness of your program goes, they do have value for readability. One way to deal with them is of course to install something like standardrb and never think abou
397.
▲
by
hakunin
3y ago
While this talks mostly about data warehousing, oftentimes denormalization is useful for everyday web app data storage. If your web app (usually on Postgres) is mostly frequent reads and rare writes (most web apps are) — there's no exc
398.
▲
by
hakunin
3y ago
We had a use case at one of former jobs where we had to lookup entries in hundreds of megs of static key/value data (vendored with the app), but it didn't have to be super fast and we didn't want to waste any RAM on it. Since
399.
▲
by
hakunin
3y ago
One advantage of the "Another Solution" brought up in the article is that the code you write to create JSON for your web pages can be in large part reused for your mobile API. Certainly mobile screens are shaped differently, but n
400.
▲
by
hakunin
3y ago
The first hard problem is to understand what to build. The second hard problem is to build it in a way that is clear and maintainable. I wouldn't discount the importance of clarity in the way you code. You might end up writing the righ
401.
▲
by
hakunin
3y ago
So far each new Apple financial product makes me research and re-evaluate my options. When they announced their credit card, I got into "cash back" (thankful that I did), and ended up always getting good percentages back on every
402.
▲
by
hakunin
3y ago
You know how it’s always easy to educate your colleagues when they make a sub-optimal architectural decisions that could bite them in the long run? How readily they accept your insight and proceed to rethink their mental models? No? Not eve
403.
▲
by
hakunin
4y ago
> It's not anti-science to take your health into your own hands. It depends on how exactly it was taken into one’s hands right? Can’t really know if it’s pro-science or anti-science until you see what a person is doing. Most people
404.
▲
by
hakunin
4y ago
I assume you're explaining the fear, because the opposite is true. You'd be lifting a barrier. The barrier is you doing all the legwork while having all the institutional knowledge. Business cannot afford you doing the legwork, yo
405.
▲
by
hakunin
4y ago
One mismatch I often see between engineers and management. Engineers: "I must not be doing the best I can, because I'm not keeping up with work. Gotta work faster, gotta do better." Managers: "engineers are professionals
406.
▲
by
hakunin
4y ago
I've had way more success than I probably should have using something I now call "empathy driven debugging". I almost never use a debugger, instead I try to imagine I'm the person who wrote this program, and imagine wher
407.
▲
by
hakunin
4y ago
The key to its success I think is controls. I could never feel comfortable with portable gaming because controls always felt clunky for games I like. This thing treats controls as the centerpiece, allowing seamless sharing of layouts betwee
408.
▲
by
hakunin
4y ago
I hate gym too (also mid 30s), and use the hate as a tool. I hate it so much, that nothing will stop me from going, because I'm always at the lowest possible desire level anyway. I don't care if the weather is bad, if my mood is b
409.
▲
by
hakunin
4y ago
Here’s a list of practices I call mindful code reviews. You shouldn’t unnecessarily extend the loop, but you also shouldn’t rush or auto approve. https://max.engineer/mindful-code-reviews
410.
▲
by
hakunin
4y ago
> he was nearly always saying things that I felt were a bit "off" One of such things is "screaming architecture". It is a good idea in theory, but only if you already know what the architecture should be. Most new pro
411.
▲
by
hakunin
4y ago
I couldn't fit this part in my tweet, but this is an important caveat.
412.
▲
by
hakunin
4y ago
Seems like an appropriate time to share my 4 reasons to leave a code comment: 1. An odd business requirement (share the origin story) 2. It took research (summarize with links) 3. Multiple options were considered (justify decision) 4. Quest
413.
▲
by
hakunin
4y ago
If you're basing on a lang-specific container like ruby, then it's the version of that container in the FROM line. Notice how ruby images come in various versions of OS ( https://hub.docker.com/_/ruby ). You ca
414.
▲
by
hakunin
4y ago
Ah, I accidentally lied by trying to reconstruct a vague memory, apologies. Now I'm remembering it in more detail. It wasn't lack of defaults, it was handling of defaults. Portrayal does a couple of smart things like evaluating de
415.
▲
by
hakunin
4y ago
> clean architecture has helped me basically not have that be an issue If you setup your Go app structure like a Rails app structure (basically what clean architecture is), then you have it covered. However, I believe you do have to set
416.
▲
by
hakunin
4y ago
Advantages of Rails over Go: 1. REPL. Huge. You can be insanely productive with it. If you're integrating with APIs and therefore dealing with complex nested data structs, you can explore them live. You can explore what's possible
417.
▲
by
hakunin
4y ago
Thanks for the suggestion. I actually explored switching to Attributes for a new Rails app, but 3 reasons made me come back to portrayal gem: 1) attributes don't support defaults. 2) I prefer not to set types on form object attributes,
418.
▲
by
hakunin
4y ago
True. I tend to stay away from gems that try to integrate into multiple parts of your app to provide some sort of comprehensive solution. The kinds of gems I recommend are: 1) libraries (you call into them when you need them) 2) mounted app
419.
▲
by
hakunin
4y ago
Not sure why you're downvoted either, it's a legit concern. One way to address it is by being very conservative and picky with gems. A good example is Hey's Gemfile (the app made by Rails creators): https://gist.gi
420.
▲
by
hakunin
4y ago
That said, there are similar objects one can make without using the "form" moniker, for API submissions for example. Granted, I also wish a solution was built-in.
More ›