HN user

bcoughlan

299 karma
Posts3
Comments108
View on HN

I've been thinking the same: the smaller the codebase, the better AI performs. So a way to scale AI is to modularize your architecture to maximize the number of leaf nodes in the dependency tree, and split out separate libraries where it makes sense.

It is huge for token usage also, Claude grepping the codebase for context it doesn't have is the main consumer of input tokens from what I can see.

Perhaps we are putting human intelligence on a pedestal. I have often caught myself having a supposedly original idea only to find I inherited it from something I read months before.

We are mostly autocomplete with a mild capacity to synthesise new ideas. It’s the network effect of communicating that creates the feedback loops which amplify our collective intelligence.

Also if you think intelligent life has to have a regard for truth, not just a regard for self, tune in to any news channel.

Something an older and wiser programmer taught me, is to think of the infrastructure costs as a per-user cost. These numbers look enormous next to my bank balance, but if you save 500k per year to service 1 million users, it's nothing to your bottom line.

Meanwhile there's the opportunity cost of moving. All of the people who put effort into this migration, who could otherwise be building something revenue-generating. I think that's why in many companies cloud costs are a problem, but never enough to make it high up the backlog.

I’m talking youtube-dl and VLC player. No YouTube logos, no concept of what YouTube even is.

Even the sidebar of recommendations is a dark pattern for a 3 year old. Unlike Netflix etc where you have to exit the video to browse something else.

I considered doing the same but in the end decided I don’t want to use a platform I have to fight against, while still letting them build brand recognition to my kid.

So I downloaded a bunch of the videos on our desktop and blocked the site. Works for my 3.5 year old, not sure the plan when they outgrow it.

My approach for iPhone:

- Set time limits on apps. - Block App Store. - Set a Screen Time pin, then forget it.

Downside: if you need to install a new app, you need to do a iTunes backup, factory reset and restore the backup,. Also apps won't continue to update with this approach.

Worth it though. I don't miss wasting 10-20 hours a week on brain rot apps.

The solution at my workplace is a bot that opens PRs to bump dependencies and automatically merges if the tests pass.

It's taken a lot of workload off devs to meet security targets. But I worry it makes supply-chain attacks more attractive. If an attacker can compromise a package and it's instantly merged into the codebases of thousands of different companies that's a huge danger.

This was always my interpretation of "Flat is better than nested." from "The Zen of Python".

I often run into conflict with developers who believe in the single return statement. This is flatter but irks a lot of devs:

if (!condition) {

  return
}

more code

return

Starting with a monolith is nearly always great advice. However, monoliths tend towards spaghetti because it's too easy essentially to draw new lines on the architecture diagram by importing from anywhere.

To scale a monolith codebase without devolving into spaghetti you need to have a well defined layered structure for modules. The other aspect is being able to hide internal code to prevent it being imported by other modules.

I did a write-up a while ago about how we do this on my current project [1], and published the Maven enforcer rule and ArchUnit test example as an open source project [2].

[1] https://bcoughlan.github.io/posts/modulithic-architecture/ [2] https://github.com/bcoughlan/base-package-enforcer-rule/ https://github.com/bcoughlan/base-package-enforcer-rule/blob...

I stopped adding salt in my cooking when I had to cook for a young baby. Pleasantly surprised to find I didn't miss it much, and pretty soon my tastebuds reset and when I eat out everything tastes wayyy too salty.

I used to follow topics to try to answer questions. It's a great way to learn a topic in depth. But I find that the bulk of questions about {topic} have already been asked, and the stream of questions are like "How do I get {topic} to work with {other niche tool}?". The Venn diagram of people who know both topics is way smaller. If you want an answer, narrowing the question to a single topic really helps.

But I have asked a few questions, and the quality of answers have really declined, mainly because people are rushing to answer and not reading the question. They could address this by delaying voting on answers.

I have done pretty well with a combo of Nokia dumbphone for calls and texts, and a separate smartphone with no SIM as needed. I leave my smartphone at work or in the car when I want a break.

Only downside really is no WhatsApp but you can get a KaiOS phone that supports WhatsApp if it's essential.

Honestly the urge to constantly pull it out just passes after a couple of days. The boredom is intense but pretty soon you won't miss it and will enjoy other activities.

I also had good results with a very very cheap Android phone running Android Go. It was so slow that I just didn't want to use it for browsing. Downside is as a Dad I want to have a good camera within reach for special moments.

Overly granular tests are a scourge of our industry, unless you’re writing a widely used utility library. It leads to tests that become a useless burden for even mild refactoring.

Writing larger test cases that test the actual functionality is a game changer. With Testcontainers and good mocking tools you can spin up a real version of your app with external dependencies mocked and faked, and write test cases against the same input layer your user uses. If your test fails you can be pretty sure it’s because you broke something.

This is a layer between unit and integration tests that you don’t read much about. I call them “service tests” (coming from a microservices world).

Investment is still needed though to reduce the effort of implementing tests, like extracting common fixture code so that every test doesn’t need long winded setup code. Also snapshot testing libraries take the pain out of writing assertions.

I am speaking from the API based backend world so YMMV. Once you’ve worked this way it’s hard to go back. Any developer can come in and confidently make changes. You spend way less time investigating regressions and broken environments, so you can release more frequently (which takes a whole other layer of pressure off the team)

It depends on your use case. Starting with the spec can unblock other implementers, so that they can work with mocks while you build the implementation. And it can help prevent re-work by describing the API first and getting feedback.

Bigger orgs also have style guides for public APIs and you can use various linters/standardization tools to enforce this. Tech writers can work on the API documentation without making changes in your code. There are tools that can tell you if your spec changes would cause breaking changes to API clients, such as adding a required query parameter.

You might not need these things on your project, but for some users it makes sense to write the spec first.

Contrary to some others experience here I've had good results writing OpenAPI YAML and generating server stubs in Spring. Because it's generating strongly typed code we get a lot of guarantees that the docs match the implementation. For working with frontend devs it's a huge win over the lossy communication of word-of-mouth API docs.

It is definitely verbose to write and Moonwalk would help. Co-pilot helps a huge amount, but I do crave a DSL that's not indentation based.

I quite like the idea of viewing run cost as architecture fitness function https://www.thoughtworks.com/radar/techniques/run-cost-as-ar....

If your architecture has a high cost to develop, test and run when a cheaper architecture meets your needs, it's a sign that you have overengineered. In my experience there is an order-of-magnitude increase in complexity by adopting microservices that only starts to pay off when your org and user base are huge.

I think the majority of people have the same experience with screens. There's something inherently distracting about reading anything long on a screen. Idly drifting to easy dopamine-hit activities is perfectly normal. Also pro tip, send anything long to your Kindle to read.

I'm not saying ADHD isn't real, just that environment-induced distractions aren't it.

Or I can't read long articles with topics that are important for me but don't tickle one of my interests.

Can't concentrate on boring things - surely that's normal? It feels like they're casting the ADHD net wider and wider and from reading the internet I'm starting to question whether my behavior fits into the ADHD category. And part of me wants it to so that I have a label that explains and excuses me.

But how do you separate it from this boring hyper-specialized world of bullshit jobs? As someone said it's no measure of health to be well-adjusted to a sick society. I love Doug Stanhope's take on it: https://www.youtube.com/watch?v=kKyMvjPJdtM

I wish Git had more support for "linear" revisions in the main branches. It's great for continuous delivery where you can get a unique identifier that's also human-friendly.

I emulate this by counting the number of merges on main:

git rev-list --count --first-parent HEAD

But it's not that traceable (hard to go from a rev back to a commit).