HN user

reggieband

2,802 karma
Posts0
Comments458
View on HN
No posts found.

I don't care about the formatting, I care about the available data types. JSON is just easy to use since it includes arrays/hash-tables and it is already supported by a large number of tools.

If you look at the Attr type definition you can see they support many primitive types including Int, Float, Bool, String, Duration, and Time. So if I had a record type, like a customer I could do:

    slog.LogAttrs(slog.ErrorLevel, "oops",
        slog.Int("customer_id", 123456), 
        slog.Float("customer_balance", 12.42)
        slog.Time("customer_updated_at", ...))
But I would prefer a structured data type there. Something more like:
    { "customer": {
        "id": 123456,
        "balance": 12.42
        "updated_at": ...
        }
    }
In fact, I'm not sure how I'd go about supporting arrays as Attr except with keys like "item_0", "item_1", etc. Or maybe serialize it into a representation like comma separated values. But now I'm coupling my log to a custom serialization/deserialization - I'd rather just use JSON once again since most tools will know how to handle it.

I see some asking for stack support in the logs, and that is something I would be looking for. Often when an error happens on a server it might be inside some generic utility. At least with a stack, you might realize that all of the calls to that utility function are coming from the same location a few steps up the stack. In my experience that can significantly speed up identifying the root cause of issues.

I'm not sure I like the way they are handling attributes either. One pattern I strongly discourage on projects I work on is formatting data into the log message. When I've had access to decent log aggregation tools (e.g. Splunk, Datadog) I like to generate reports on error messages. That is usually possible with regex magic but in my experience it is much much cleaner to have a static unchanging message for all messages. I then store all additional details in a separate part of the log line. I tend to prefer JSON for those details since it is well supported and even parsed by default by many tools. Another benefit of JSON for those additional details is that it is supports arrays and hash-tables. The attribute system proposed here doesn't seem to have that same hierarchical attribute support.

IMO, unified, clean and consistent logging is one of the most underrated techniques for maintaining long running services.

I am reminded of the story of the fat cat that I recently read in a Brothers Grimm collection. In case it is not familiar to you:

A cat and a mouse decide to team up and store up some surplus food for hard times. They agree during abundant times to both put a little extra fat into a shared pot. They then store the pot in a safe place. The cat, however, is overcome by hunger even in the abundant times. Every few weeks the cat sneaks to the pot and takes just a little bit, maybe just a few licks at a time. Over the course of a couple of years of sneaking and small stealing the cat manages to completely deplete the pot. Then hard times hit, as both expected. The cat and the mouse both go to the pot together to divide their savings. But when they lift the lid they both gasp in surprise that the pot is empty. The mouse slowly realizes what must have happened. The cat is guilty but won't stand being accused and so it turns on the mouse and eats it.

My whole life I had heard of the rich upper-classes described as "fat cats" but I didn't really understand the message until I read the story. From at least 2008 we were supposed to be saving for the next crisis. Yet here we are at the next crisis and low and behold the pot is empty.

The reason we fall for this over and over again is that the short-term memory of civilization is shorter than the cycles these things happen over.

Originally when I started out in the gaming industry in the early 2000s. There were close to zero code tests written by developers at that time at the studios I worked for. However, there were large departments of QA, probably in the ratio of 3 testers per developer. There was also an experimental Test Engineer group at one of the companies that did automated testing, but it was closer to automating QA (e.g. test rigs to simulate user input for fuzzing).

The most careful programmers I worked with were obsessive about running their code step by step. One guy I recall put a breakpoint after every single curly brace (C++ code) and ensured he tested every single path in his debugger line by line for a range of expected inputs. At each step he examined the relevant contents of memory and often the generated assembly. It is a slow and methodical approach that I could never keep the patience for. When I asked him about automating this (unit testing I suppose) he told me that understanding the code by manually inspecting it was the benefit to him. Rather than assuming what the code would (or should) do, he manually verified all of his assumptions.

One apocryphal story was from the PS1 days before technical documentation for the device was available. Legend had it that the intrepid young man brought in an oscilloscope to debug and fix an issue.

I did not say that I know any developers who've never let a bug or performance issue enter production. I'm contrasting two extremes among the developers I have worked with for effect. Well written programs and well unit tested programs are orthogonal concepts. You can have one, the other, both or neither. Some people, often in my experience TDD zealots, confuse well unit tested programs with well written programs. If I could have both, I would, but if I could only have one then I'll take the well-written one.

Also, since it probably isn't clear, I am not against unit testing. I am a huge proponent for them, advocating for their introduction alongside code coverage metrics and appropriate PR checks to ensure compliance. I also strongly push for integration testing and load testing when appropriate. But I do not recommend strict TDD, the kind where you do not write a line of code until you first write a failing test. I do not recommend use of this process to drive technical design decisions.

I could write an entire blog post on my opinions on this topic. I continue to be extremely skeptical of TDD. It is sort of infamous but there is the incident where a TDD proponent tries and fails to develop a sudoku solver and keeps failing at it [1].

This kind of situation matches my experience. It was cemented when I worked with a guy who was a zealot about TDD and the whole Clean Code cabal around Uncle Bob. He was also one of the worst programmers I have worked with.

I don't mean to say that whole mindset is necessarily bad. I just found that becoming obsessed with it isn't sufficient. I've worked with guys who have never written a single test yet ship code that does the job, meets performance specs, and runs in production environments with no issues. And I've worked with guys who get on their high horse about TDD but can't ship code on time, or it is too slow, and it has constant issues in production.

No amount of rationalizing about the theoretical benefits can match my experience. I do not believe you can take a bad programmer and make them good by forcing them to adhere to TDD.

1. https://news.ycombinator.com/item?id=3033446

It's such a tiny thing, but my pet peeve is exclamation marks in error messages.

"Something went wrong!" is something I see a lot of engineers do. I don't usually call it out but it bugs me whenever I see it.

TikTok scares me in the same way that DALL-E scare me.

DALL-E is very, very good, but still obviously flawed. But behind the flaws I know it will get better. Like the original iPhone vs. the crazy powerful phones we have now. Or the original 3d games like Doom or Duke Nukem 3d compared to modern PC graphics. Or the insane quality of modern movie CGI. In 5 years or 10 years this AI tech to generate incredible images will advance at a similar pace. (Shout out to GPT-3 in this space as well)

I don't think we fully understand how TikTok is connecting to our subconscious but it is doing it in a way that most people agree is unsettling. And we are at the very beginning of this journey. There is no way to predict if this is going to be good or bad without us doing it. And every company now realizes that it is both easy to achieve and tremendously effective.

This makes me wonder if a future job description will be the equivalent of an AI whisperer. Someone who learns how to prompt AI so well that it becomes their job.

I once interviewed with a crypto exchange and after getting the offer I noticed it was for contract and not full-time as had initially been offered. I went back to them and said I had a similar compensation offer for full-time from another company and if they wanted me to consider contract with them then they would have to raise the offer. Their response was an offer to pay me directly in bitcoin.

I love this idea and I could see myself using it in 1:1 meetings with my direct reports.

One of the advantages of getting older is the experience one gains. It is often the case that I can relate a current situation to one that has occurred in my past. This can help me make good decisions by anticipating expected similar outcomes to the most obvious approaches.

Yet the other side of this is I can find myself droning on about old war stories to junior engineers. What I mean to be well-intentioned advice can turn into a monologue. This is especially true when I am giving advice "off-the-cuff" in response to situations brought up in 1:1 meetings with direct reports. I might struggle finding the best way to communicate my experience. This can cause me to rephrase the same idea several different ways in an attempt to clearly convey my thought.

I feel this kind of tool could help me focus more on listening to the people I manage.

I don't know if it is the same word but it reminds me of a joke a Brazilian friend told me when we were discussing how it can be hard to translate jokes. He mentioned that someone who shits a lot is a common insult in Brazil.

The joke goes: A young man visits the family of his girlfriend for the first time. At one point the father of the girl pulls him aside and tells him that he is no good for his daughter. The father wants a rich man for his daughter. He tells the young man "you can't buy my daughter a nice house, you can't buy her a nice car, you can't buy her nice clothes, I bet you can't even afford to buy her toilet paper". Later, as the young man and girl drive home she notices he is upset. She asks if her dad maybe said something to him. He said, yes, he told me you are a big shitter.

I know this is a crazy thought and not inline with a lot of the blizzard hate - but why don't games like this allow more gifting style mechanics?

I consider the Twitch gift sub market. And I consider that weird crypto game Axie Infinity. It seems we are only considering the purchasing power of whales that want to flex. What about whales that want to collaborate. Whales that want to demonstrate their generosity.

I remember a reddit post about a guy who had a rich friend that would constantly take him on wild adventures that the poorer friend couldn't afford. The rich guy didn't care about spending the money and the poor guy was good company.

I think an interesting monetization mechanic would be a game where the pay-to-win aspect was in the recruitment and outfitting of other players. So as a poor player I could have the opportunity to earn high-level gear based on the spending of a whale whose campaign I was joining.

I have fear that the cathartic pessimism we sometimes enjoy ironically is turning into a chronic fatalism. It's like a habit that has become an addiction. I think the author was in a discussion that started as a fun catharsis for all involved and then devolved into an addictive argument that the author felt they needed to win.

There is a cliché which goes: "Expect the best. Prepare for the worst". Articles like this only seem to get the second half of that while clearly violating the first half. A well balanced response to crisis is benefited by both.

I think the author is not actively aware of the importance of expecting the best, both of the world and of their colleagues. I feel their arguments are weak due to this imbalance.

I've been thinking about a life-sim type game with a rogue legacy type spin.

Basically you get N actions per day (3, 5, 7, whatever works) that depend on your characters age. You might start as a baby in some random family archetype (poor/rich, dumb/smart, lazy/athletic, etc.) and after a few years you get control of the daily decisions your character makes at a granular level. Like, study in the morning, play in the afternoon, watch TV in the evening. These are more "influences" and your character can kind of rebel. Like if it gets too stressed because you are forcing it to study/work all the time then the character has a stress break and maybe gets drunk in the evening.

As the character gets older the available tasks change. As a toddler its games and light-learning, as a pre-teen it is school and sports/hobbies, as a teen it is education and social activities, as a young adult part-time jobs or university, as an adult marriage, raising kids. Perhaps as you get older you get more actions e.g. N actions per day increases.

Eventually you get to retirement then death and then you can choose one of your kids to continue the legacy. Or you can start over with a new random kid in a random family.

The gameplay would be simply choosing one of a few options available to your character at each time step. So you have N time steps per day and M available actions. The M actions are chosen in a weighted random manner from a set based on your characters abilities which changes over time, maybe some light RPG skill tree system. Could possibly be managed with a "card" system as well and would possibly shoe horn into Slay the Spire type mechanics. Overtime both positive abilities and negative abilities compound. Like, if you have too many "curse" cards in your deck, maybe your only options for an evening decisions are "drink alcohol", "ruminate on past failures", "argue with spouse".

In some sense, think of it like the day-to-day mechanics in Persona 5 mixed with the character building of The Sims. The goal of the game is to make many lifestyles possible. e.g doctor, lawyer, rockstar, president, social worker, janitor, game developer, soldier. The more difficult job types (e.g. CEO of a massive corporation, Senator) might take multiple generations to work towards.

This is a fair criticism of how I chose to tell the story. The line you quoted was supposed to refer to the character introduced in the second paragraph and not to a generic stereotype of aged man.

I can see how my choice of wording created an implication that people who have grey beards are old and that it is this oldness that contributes to their unwillingness to learn. The familiar cliche of "you can't teach an old dog new tricks".

What I actually hope to communicate is that there is a hubris which leads some to believe their skills do not require updating. The caution is that sooner or later this hubris may lead to sudden downfall. People may call on you in their time of need and you will fail. And this failure is not because of your age, your intelligence or your willingness to work hard. You will fail because you became overly comfortable with a passed status quo and you let your skills get out of date.

I see a trend of well-written, evidence backed articles where large, well funded sites are making a case to deprecate jQuery. These fact-based investigations into problems faced by their dev team result in a reasoned decision to remove a dependency that no longer justifies its cost. I encourage everyone to introspect if their defense of jQuery is on an equal technical footing to these types of investigations.

When I first started programming I was pretty lucky to get a job at a games company. My first lead was a veteran who had shipped a lot of AAA titles and he loved his war stories. He was personally interested in performance and he would often cite hardware timings for specific cpu instructions.

One story he told a couple of times was about some grey beard who was before his time. The grey beard was once a legend in the company, often helicoptered into projects at the last minute to help them squeeze out the last bit of performance. His secret was he had a mental library of assembly language tricks applicable to the hardware of his day. But every few years his tricks were less and less relevant as hardware changed and compilers advanced. One day the grey beard was helicoptered into my leads project and everyone expected him to get them some gains. However, this was new hardware and none of his old tricks worked.

I think of this story whenever I see jQuery popup on Hacker News. There is always a strong contingent of devs who swear by this library. But to me, they are like the old grey beard who didn't update his knowledge as the times changed. At one time jQuery allowed them to be the hero and "Get Things Done" faster than their competition. But times have changed.

Argue with me if you must but take stories like this one for what they are worth. The writing is on the wall for jQuery. I was writing websites before jQuery existed, during the reign of jQuery and still today. If some candidate mentioned proficiency with jQuery during an interview I would be polite but internally I would note that the person might be out of touch. Not a red flag, but a yellow flag that I would follow up on. Nothing worse than bringing on a guy who claims to be senior/experienced and it turn out his old tricks won't work because they are no longer appropriate.

The amount of money a reseller is willing to pay for his goods to appear in a curated list is likely to always be higher than the amount of money a consumer is willing to pay for access to a curated list.

That suggests that a platform that aligns with the needs of the advertiser is likely to earn more revenue than a platform that aligns with the consumer.

For this reason I find it hard to see a dominant "boutique search" company that is funded by anything other than advertisers.

I watch a lot of YouTube and a fair amount of Twitch. Sooner or later every creator talks a bit about their anxiety working in that content creator grind.

On Twitch, taking a day off may mean losing hundreds of subscribers. Streamers are cautious about taking bathroom breaks since they can lose thousands of viewers during a short break. YouTube ruthlessly punishes creators that don't upload on a consistent schedule. I imagine TikTok and Instagram are similar.

My guess is that Kottke has been living under a similar stress for 24 years. That has got to wear a person down.

I think this is partially due to meditation being strongly associated in Western culture with New Thought [1] type movements. This diverse movement is the inspiration for most of the modern self-help ideology. As the quotes from William James in that article mention, the basis is "Mind-Cure", or the idea that thinking the right thoughts leads to physically healing the body.

Many people in Western culture get into those Eastern (Taoist, Hindu, Buddhist) practices for the purpose of self enhancement. People will meditate to control anxiety, to improve focus or to increase performance in some aspect of their lives. Very often the goal is one of personal improvement, or managing some kind of idealized growth/flourishing of the individual.

Most people here would probably deride the outlandish New Age ideas that grew out of the original Christian Science underpinnings of New Thought. But I find the basic premises of new thought to be the spiritual zeitgeist of the current age.

1. https://en.wikipedia.org/wiki/New_Thought

I wanted to keep my post short so I didn't list all of the ways I feel we express this tendency. Others mentioned podcasts and talk radio but Youtube and Twitch are great examples. There is no denying that people who watch creators like Mizkif are feeling like they are part of a group of friends. Ludwig called it out most famously in his parasocial video [1]. It is so well known it is already a hackneyed meme.

Sometimes I feel smug looking down on people who become obsessed with the latest Kardashian drama or the British Royal Family or whatever celebrity culture. But then I turn a critical eye on myself and I'll realize I spend a lot of time watching YouTube videos on woodworking, small engine repair and outdoor activities. I don't do any of these things and I tend to watch the same creators over and over again.

Some people want to feel like they have hyper-crazy friends like Jake Paul who live wild fantasy lifestyles. I'm not certain that is different than me watching videos of some guy quietly building a log cabin on his own in the woods.

1. https://www.youtube.com/watch?v=WzyQbfh4t_8

People often say they will keep old TV shows like Friends, How I Met Your Mother or The Office on in the background. I think it simulates the feeling of having familiar social connections in ones life.

In Fahrenheit 451, the protagonist's wife Mildred "finds herself more involved in the "parlor wall" entertainment in the living room – large televisions filling the walls" [1]. She frequently calls the entertainers that appear on the screen her family. So this satirical observation is at least as old as that fiction.

I frequently wonder how AR/VR will play in this particular space. Cynically, I believe there is a killer app to be had there.

1. https://en.wikipedia.org/wiki/Fahrenheit_451

I argue that patterns learned on individual tests would apply to new tests. There are a set of patterns which have already been called out here. Translation, rotations, exclusions, logical and/xor on line segments and dots, etc. IME, most IQ tests sample from this set of patterns. Once you are familiar with that set you aren't really doing a first-order matching - instead you are going through your list of expected patterns and seeing if they apply to the particular question. This means you can breeze through the early questions drawn from that set using your memory and then save your cognitive time for the later harder patterns.

I used to do well at these pattern matching tests with consistent scores in the range 125 - 135. This one I hit 118 but I ran out of time around question 32. I got stun locked on a couple of the earlier easier questions. I wonder if this is due to mental decline as I get a bit older (I'm in my early 40s now).

I took it again with the benefit of knowing most of the earlier question patterns and got 133 on the second attempt. Pretty sure it wouldn't be too hard to bump that higher if I cared. In that sense, these tests are heavily biased towards people who take these tests. Once you know the tricks these tests are built on you do a second-order pattern match (which trick is the question using) which helps you find the answer. I would guess you could grind these tests leet-code style to get arbitrarily high scores.

People here report getting bored by these tests and I don't feel that at all. I actually get totally stress-focused and the time flies by almost too fast. Seeing the pattern is a dopamine hit that my brain craves.

When code running in a virtual thread calls a blocking I/O operation in the java.* API, the runtime performs a non-blocking OS call and automatically suspends the virtual thread until it can be resumed later.

How does it know that an operation is blocking on I/O? Is this limited to stuff baked into the language or standard library?

What is the mechanism of suspension and resumption? They mention elsewhere that any platform thread could pick up any virtual thread so I assume they must be storing the stack somewhere. Is there a cost transferring stacks on virtual threads across platform threads? Does this introduce new security implications if there are less OS level restrictions on memory access between platform threads?

What happens in cases where an application has user defined platform threads? How does the system determine what platform threads are available to the virtual threading system?

I think this is probably the right decision for Java and I agree with all of their motivations. I personally like the explicitness of async/await, however I assume Java devs are very familiar with threading in general. I believe this allows an easier path to migrating existing Java code.

The Kia Instrument 4 years ago

I've been thinking about how asmr relates to music quite a lot lately. Some people think it is just a weird thing, but asmr videos of people brushing onto mics are getting millions of views. I think it should rightly challenge our assumptions about what music is. I won't be surprised to hear these sounds filtering into popular music. In some ways it is similar to how harsh clipped digital distortion is fairly popular all over TikTok.

Also, I just found Olafur Arnalds from his music cribs tour on Spitfire Audio [1]. It seems he has collaborated with them on some virtual instruments. There are several videos of him on their channel including breakdowns of some of his music. The last couple of weeks I've been down a YouTube rabbit hole on these modern composers (mostly for film and television).

1. https://www.youtube.com/watch?v=FnKTwPDsDiU

I recall a Twilight Zone movie "Cat's Eye" and a sketch from that including James Woods called "Dying For a Smoke". The premise is a man wants to quit smoking so he goes to a firm called Quitters Inc. where he signs a contract. If they catch him smoking they will escalate the punishments against him. After a few relatively tame punishments for sneaking a cigarette, he gets caught smoking again and so they kidnap his wife and daughter. They force him to watch as the company tortures his family and then they insinuate even worse fates for his family if they catch him smoking again.

The sketch from the mentioned movie is a dark satire. It lampoons the kind of pseudo-logical thinking which simplifies problems by externalizing responsibility for our actions to external entities. Yet it is only when that external entity reflects the consequences of our action back on us that there is a chance we alter our behavior. However, once externalized we lose control of the process and in some sense become a slave to it.

I feel that dystopian sketch is a satire directly aimed at this kind of application.

I wonder what it is about music that makes people accept these simplifications. I imagine an alternate universe where an article on the optics of color is posted. Someone mentions that all light are frequencies, the color red is such-and-such frequency, blue is whatever Hz, etc. We observe that a color wheel creates some theory of adjacency, compliments of color etc. And some artists use this in their work to enhance the effect. Would an article like that warrant a comment section filled with a bunch of people acting like that gave them sufficient tools to understand the works of Da Vinci, Van Gogh, Picasso?

Pitch, melody and harmony are integral aspects to music but they are by no means sufficient to provide an understanding of music. Just as a purely mathematical description of the optics of color is not sufficient to understand painting. I would argue that the overwhelming majority of music you have enjoyed in your life was written with literally zero regard to these details. In my own opinion, music programs that raise these mathematical details above all others lead to the dullest and least inspired music.

I'm reminded of an interview I saw with Ayn Rand a long time ago. I can't find the exact interview anymore but I did find an interview where she describes the general idea [1]. It is a central tenant of Objectivism that we should be doing more for gifted children based on the assumption that gifted adults contribute more to society.

We see echoes of this philosophy in our culture of belief in 10x engineers. I see it in Jeff Bezos' management philosophy of doubling down on success or in Google's philosophy of killing off under-performing projects. It is the mantra of VC capitalism where we'd rather kill middling projects that are limping along in the hopes or redirecting capital to the one 100x return behemoth.

I find Rand's ideas repugnant myself but I always admired that she plainly and unabashedly spoke them. Nowadays people who believe that kind of stuff are much more subtle.

1. https://www.youtube.com/watch?v=Q1HD8KXn-kI

My dream is a high-speed train from Vancouver to Kelowna and Calgary, with an optional leg to Edmonton. Like a Rocky Mountain Express. I believe this would be a massive driver of economic growth for the West Coast of Canada.

What hurts my soul is that Canada has the wealth to afford it, the engineering chops to build it but we lack the political will. Even more I feel we lack the belief and the vision.

For my personal interest (probably no where near the majority) I am interested in these libraries primarily for use outside of a DAW. I mean, I already have a wealth of plugins for most conceivable purposes to use in one of the several DAWs I have installed. I am also in no hurry to move the kind of things I do in a DAW to a web based app. And frankly, none of the examples I've seen so far come within a country mile of the audio quality of the higher-end plugins I have.

I'm interested in these libraries to see how we can expand on musical creativity outside of DAWs. The first thing that comes to my mind was the cute HTML 5 game Friday Night Funkin'[1]. Or games such as Lumines [2] where the rhythmic music is integral to the gameplay. And other kinds of interactive media where advanced control of synthesized audio might enhance the experience. I think it would be interesting to give people a simplified/gamified interface to a suite of audio tools with the intent to unlock creativity, especially aimed at a very young age (e.g. toddlers and pre-teens). This is a place I don't think traditional DAWs will ever attempt to target and where web-first experiences tend to do extremely well. Being able to quickly develop and deploy "good-enough" audio effects that have an element of interactivity for those kind of products/experiences would be nice to have.

1. https://ninja-muffin24.itch.io/funkin

2. https://www.youtube.com/watch?v=hv4sCM5X96o