HNHacker News
TopNewBestAskShowJobs

flakes

731 karma · joined August 11, 2023

submissionscomments
flakes··on The hidden complexity of scaling WebSockets
> As an example, with a goroutine you have to be careful to handle all errors, because a panic would take down the whole service.

Unless you're the default `net/http` library and simply recover from the panic: https://github.com/golang/go/blob/master/src/net/http/server...

flakes··on Google's Results Are Infested, Open AI Is Using Their Playbook from the 2000s
Its hit or miss for me. This week I was googling how to use libarchive and the AI generated responses at the top of each query were either incorrect or hallucinations of methods that don’t exist.

I don’t mind playing with AI to help scratch together some code, but I do that using better models. Whatever model google is using for search results is too crappy for me to consider trusting.

flakes··on Cognitive load is what matters
I still want to let the author have the final say on if they decide to accept or reject the change, or modify it further. Editing the branch directly might cause some rebasing/merge conflicts if they’re addressing other peoples comments too, so I don't typically edit their working branch directly unless they ask me to.
flakes··on Cognitive load is what matters
> The documentation comments gets nitpicked to death with mostly useless comments about not having periods at the ends of lines > End up having to explain every little detail throughout the function

For these cases I like to use the ‘suggest an edit’ feature on gitlab/github. Can have the change queued up in the comments and batch commit together, and takes almost no additional time/effort for the author. I typically add these suggestion comments and give an approve at the same time for small nitpicks, so no slow down in the PR process.

flakes··on Are Immutable Linux Distros right for you?
I think the point they’re getting at, is that there are typically a lot of delta states in between pre-upgrade and post-upgrade states when using package managers. With immutable distros, the upgrade becomes more of an atomic operation than what is offered by more incremental package manager updates.

It also means you can completely leave out the package manager from the target machines, as it’s only used to bootstrap creation of the single deployable unit. Implementing that bootstrapping step is where nix and friends are helpful in this setup.

flakes··on A New Logo for Perl
Its called Raku now, as the language differences in the experimental Perl 6 were enough to warrent it being spun off as a separate project. Perl 5 is still getting updates for quality of life improvements
flakes··on BlackSheep: Fast ASGI web framework for Python
FastAPI uses uvicorn which is ASGI, but you can choose to implement endpoints as either async or sync. I have implemented servers using both styles. Very pleasant to work with, and everything is type hinted, which is a must for me in any serious Python project.
flakes··on Dell is posting unsigned updates to their website which fail to install
You should read the official wiki. https://wiki.freebsd.org/Myths#FreeBSD_is_Just_macOS_Without...

> Darwin - which consists of the XNU kernel, IOkit (a driver model), and POSIX compatibility via a BSD compatibility layer - makes up part of macOS (as well as iOS, tvOS, and others) includes a few subsystems (such as the VFS, process model, and network implementation) from (older versions of) FreeBSD, but is mostly an independent implementation.

flakes··on Amazon S3 Adds Put-If-Match (Compare-and-Swap)
You have just re-invented IPFS! https://en.m.wikipedia.org/wiki/InterPlanetary_File_System
flakes··on Bottles of OOP now available in Python
There are some valid cases where extends really can help, and IMO the language would feel limited without it. Maybe if the language designers had their time back they could have taken an approach like Golang with nested structs and syntactic sugar for calling their attributes/methods.

The main reason I see new devs opt for extends, is because that was 99% of the content in their Java 101 programming course, not because it exists in the language. Imagine how many more `friend`s we would have in cpp if that was crammed down everyone's throats? :)

flakes··on 99 Bottles of OOP now available in Python
The common toolkits today (spring boot, google guice, etc) are much more focused on composition over inheritance, by injecting arguments and implementing pure interfaces rather than extending base classes. Older legacy Java frameworks and bad teachers are more at fault than the Java language itself IMO.
flakes··on Is the 80 character line limit still relevant? (2008)
I care less about the length of the code, and more-so about the cognitive load. As the business logic grows, and the lines of code increases, the assignment of variables tend to get further and further away from their usage. What was once simple to read, now requires back-tracking as you read to double check exactly what they are.

Consider this contrived example:

    margin = (price - cost) / price
You can be reasonably sure what is being calculated, but it's hard to be exactly sure unless the surrounding context is very small. Having longer names allows you to keep more context for a line in isolation, meaning (personally) I require less backtracking while reading.

e.g. the above could be rewritten as the following, removing a lot of ambiguity:

    retail_margin = (retail_price - wholesale_cost) / retail_price
I find 80 character limits much too small in these cases. 100-120 characters is the sweet spot for me. I can still have 2 split panes of code on a single screen at once, and write more expressively without excessive linebreaks per statement.
flakes··on Epic Allows Internet Archive to Distribute Unreal and Unreal Tournament Forever
Why do you assume they didn't?

> I still boot it up to play occasionally

flakes··on Facebook building subsea cable that will encompass the world
When I was in school, I interned at a company that specializes in communication systems used to send data over these submarine cables. There is a huge market in terminal stations that send and receive over these cables. The terminal stations that communicate over the lines cost in the 50-100 million dollar range, but the cables themselves can cost upwards of a billion. Being able to maximize the efficiency of existing cables is a necessity.

A large factor for the efficiency, is how “thin” you can make channels in the cable via frequency of the light. Multiple signals can be sent over a single fiber line if they use different frequencies. One system I was working on at the time was constructing 88 channels at 100gbs for a total throughput of 8.8tbs.

Another very interesting aspect, is that service providers might share a lease of the same underwater cable, not actually owning the cable themselves. The companies enter an agreement on the frequency ranges assigned to them. Any mess ups in settings can cause disruption in your neighbor on the cable, resulting in millions of dollars of fines.

flakes··on Diagram as Code
Depends how it's implemented. It seems very similar to Apache Airflow in API, and similar to the many Argo Workflows Python wrappers.

This pattern when implemented with context vars in the context managers is a pretty nice way to reduce the boilerplate, without the downsides of traditional globals. The state can be safely contained to just the with block.

Usually these types of APIs also allow usage without it, using the context vars only to populate arguments not explicitly provided.

flakes··on Interview gone wrong
A lot of languages have no boolean primitive to begin with. Often in older languages, the values for `true` and `false` are aliases for `0` and `1` respectively. Perl and earlier versions of C, Python, and JavaScript are notable.

Perl is probably the most awkward due to context-sensitive casting. e.g. the string `"0"` in a boolean context evaluates as an integer, and the boolean interpretation for `0` is false.

flakes··on We're forking Flutter
Who is "we" in all of this?

Not even visible on the github org https://github.com/Flutter-Foundation

> This organization has no public members. You must be a member to see who’s a part of this organization.

flakes··on Show HN: HN Update – Hourly news broadcast of top HN stories
Totally agree.

There used to be a commercial that would play on Canadian TV stations. It showed the view of a river, once with calm and tranquil sounds and then played again with ominous sounds like from a horror movie. When you are presented the river with tranquil sounds, you are happy and calm. When you are presented the river with eerie sounds, you dislike it. The message at the end of the video was to inform Canadians to think more critically about the media they consume, and to question if they are being led down a forced narrative rather than being given facts to question for themselves.

When I see modern day Reddit, Instagram, Facebook, etc, almost all of the videos are backed by music which is trying to bias the user. It makes me uncomfortable.

flakes··on S3 as a Git remote and LFS server
moto server for testing S3 is pretty great. It’s about the same experience as using a minio container to run integration tests against.

I use this, and testing.postgresql for unit testing my api servers with barely any mocks used at all.

flakes··on Making the Python back end for my new webapp
I've found that when mixing the two types of routes, it can be quite easy to accidentally introduce blocking paths which freeze up the main event loop, especially if mixing async dependencies with sync ones.

When a route is async, it gets scheduled on the main event loop, meaning that any blocking calls can block all requests in flight, and block unexpected things like start up and teardown of api handlers. `asyncio.to_thread()` can help here, but it's easy to forget (and there's no warnings in case you forget).

If you do mix the two, I would be very careful to monitor the timings of your requests to detect early if blocking is occurring. For adding these metrics, I suggest using something like statsd or open-telemetry libraries for adding reporting to the endpoints, which you can feed into telemetry dashboards.

flakes··on Making the Python back end for my new webapp
Yup, I use FastAPI for some large services, handling a few million requests per day. Great experience overall, and speed of development is significantly improved. You can feel confident something is going to work after writing code. With flask and django I was always second guessing if things are hooked together properly. One pitfall I would avoid though is mixing both sync and asyncio together. Ive found there are a lot of footguns in that type of setup. Use one or the other, but not both
flakes··on Tech CEOs are backtrack on RTO mandates–now, 3% want workers in office full-time
We’re doing a three day in office, two day work from home split. I think it works out pretty well.

I do see an advantage being in office with juniors and interns. I definitely learned a lot when I was junior being able to ask the senior staff questions without having to schedule a zoom meeting or wait slowly on slack replies.

5 day RTO would be insane tho.

flakes··on User returns after 100k-hours ban to continue conversation that got them banned
That game still exists?

Back in 2005 I figured out how to log in on multiple Habbo accounts at once. I would run casino rooms using the dice and use a mob of clones to make it look like real players are winning and betting big. If an actual real player ever bet and won, I would kick them, tear down the whole room, transfer the items to new accounts, and start it up fresh. I probably had a few dozen accounts banned.

flakes··on Let's stop counting centuries
A few months ago, my girlfriend and I missed a comedy show because we showed up on the wrong day. The ticket said Saturday 12:15am, which apparently meant Sunday 12:15am, as part of the Saturday lineup. Still feel stupid about that one.
flakes··on SSH as a Sudo Replacement
There's also a command argument that can be provided in the authorized keys setup, which can force connections with a particular key to hit an entry-point application.
flakes··on Monads are like burritos (2009)
> Also, other than Swift, I don't know of any programming language that let's me explicitly mention if a function could throw an exception.

Checked exceptions in Java. I both like and hate them.

They force the function to be explicit about what exceptions they can raise. If you call a function that raises a checked exception, you must either explicitly handle the exception, or mark that it is propagated up by adding the same exception to the calling method signature.

However, they cause a lot of pain for working with higher order methods (map, filter, flatmap, etc). Because they change the signature of the method (and therefore the interface it can satisfy), you need to use a lot of generic variants of higher order methods to accept them, or like a lot of libraries, you end up writing wrapper functions that convert the checked exceptions into unchecked runtime exceptions, such that they don't modify the method signatures. This then leads to a lot of weird code, and uncaught exceptions at runtime, taking down the application.

flakes··on Show HN: Getada: rustup-like installer for Ada's toolchain/package manager
> investment-induced loyalty

Would generally refer to this as a sunk cost dilemma

flakes··on Should you use upper bound version constraints?
> They are not checked at runtime at all. Type declarations are only used for static analyzing tools and not by the runtime.

This is the common usecase, but types certainly are used at runtime by many libraries. Frameworks like FastAPI use the type annotations to declare dependency injection which is resolved during application startup. In other cases like Pydantic, they are used to determine marshalling/unmarshalling strategies.

flakes··on My cat alerted me to a DDoS attack
Yeah 100%. I live in NYC, and before the quake, our golden retriever started crying and whimpering. A few moments later we felt the quake!
flakes··on M 4.8 – 2024 Whitehouse Station, New Jersey Earthquake
Both me and my girlfriend were working from home today. Randomly our dog started crying and a few seconds later we felt the quake. Was pretty wild. Lots of rattling of furniture and plates in the cabinets. I guess my dog must have noticed the more subtle rumbles beforehand.
← PreviousPage 3 of 6Next →