HNHacker News
TopNewBestAskShowJobs

oftenwrong

15,024 karma · joined April 22, 2012

sfir6i2z@mailer.me
submissionscomments
oftenwrong··on Java in the Small
Also, see this project that is in a similar space as Coursier:

https://github.com/bowbahdoe/jresolve-cli

https://github.com/bowbahdoe/jresolve

oftenwrong··on Frood, an Alpine Initramfs NAS
This went over my head in some spots, but I learned a few things while looking up some of things mentioned. I respect the deep knowledge reflected in making this work, especially in such a seemingly elegant way. I see the appeal of a minimal and mostly stateless system, but I do not yet have the confidence to maintain something like this.
oftenwrong··on 1B nested loop iterations
Shenandoah was deemed production-ready in OpenJDK 15, but G1 remains the default collector in 23.
oftenwrong··on Ask HN: Best Resources for a New Dad?
It would be hard to compile a comprehensive guide on such a vast topic. It would be more like an entire library. Consider that there are many areas where cultural differences preclude concensus.

The closest thing available is probably public health guidelines. These are reliable, evidence-based resources that have been carefully crafted to be useful to all people. For example:

https://www.nhs.uk/conditions/baby/caring-for-a-newborn/

Of course, the context of a public health guideline is limiting. The average person cannot be given the whole, messy truth. The public health guidelines are a way to simplify that complex landscape, and provide a guide that is easy for that average person to follow correctly and safely.

Breastfeeding often does not come as naturally as one might think. A newborn's brain may be barely developed enough to do it. It is not unusual for new mothers to enter a state of negative thinking as a result of breastfeeding difficulties (or anything else, really). A lactation consultant can help a great deal. They can provide advice on technique, and they can act as a coach/therapist.

The postpartum period may be difficult for the mother. Try to be a keen observer, and don't hesitate to ask your doctor for advice on how to proceed if it seems like things are not going well.

On a related note: seek help. In the context of the entire history of human parenthood, it is very unusual for the two parents to be the only direct caregivers of a child. If you have a support network that would help you, make use of it. This could be family, friends, neighbours, or people from some other community group you are a part of. Hire someone to help if you can. This is not just about helping hands; it is also valuable to receive outside input and emotional support. For example, someone with parental experience knows that caring for a newborn is typically straightforward and easy in many respects, whereas a new parent on their own may find it overwhelming and frightening. Even just having someone at your side will help make you feel more at ease. It is also very nice to have a reprieve.

I recommend this series of articles on baby sleep, sleep training, and more:

https://www.bbc.com/future/article/20220131-the-science-of-s...

https://www.bbc.com/future/article/20220322-how-sleep-traini...

I also recommend this subreddit as a jumping-off point for more evidence-based resources (the typical caveats about information from social media apply):

https://www.reddit.com/r/ScienceBasedParenting/

oftenwrong··on Don’t look down on print debugging
I still use a debugger for much of my print debugging needs by setting non-suspending breakpoints. This is useful because it allows me to change the printing dynamically, set breakpoints in library code, attach to running processes, and more.
oftenwrong··on Monorepo – Our Experience
An approach I've used is to use https://github.com/newren/git-filter-repo (amazing, versatile tool) to put the tree into a subdirectory, and namespace its tags, and then merge that into another tree with --allow-unrelated-histories. I built a tool for an employer that automated this process for the purpose of consolidating an excessive number of repositories.
oftenwrong··on Monorepo – Our Experience
This is generally seen as a feature. Most developers won't need to confront the messy reality of the deployed "world". They can work within the relatively pure world of the code history. Of course, some will have to do the work of actually producing releases, performing deployments, and operating the systems.
oftenwrong··on Writing secure Go code
This Spring hater (me) thinks that's a fair summary. It also eliminates much of the safety the compiler can give you for free. You will only find out during Spring init, or even later, that your program is broken.
oftenwrong··on Rewrite It in Rails
I once worked for a startup that used Rails for building their web app. I would say around 50% of all development was in Rails. For things that demanded more performance or correctness on complex tasks, there were some Java services and some Postgres sprocs.

Our user-friendly and featureful website was a big part of our appeal. A lot of the non-Rails functionality was the unseen "secret sauce".

I think this approach worked well. Most of what you need for a web app is commodity functionality. Correctness is not even particularly important in many cases. The Rails ecosystem has a lot of useful tools that make it easy. For example, there are multiple options for automatically adding a comprehensive admin panel. This let our non-technical admins manually accomplish CRUD tasks in the web app's domain. This allowed us to avoid overengineering. We could implement something that covered 80% of cases, and manually handle any edge cases or things that happened infrequently. An example is locking user accounts when a person left a customer's company; they could just email us and an admin would manually go in and check the "locked" box for the user. This allowed us to move very fast on new web app features, and focus on other aspects of the system.

There were downsides, of course. One of the big pain points was upgrading Rails itself, and dealing with dependency hell at times with various libraries. You also have to know many things about how Rails works, which involves a lot of quasi-mysterious and implicitly-performed things. For example, I recall frequently coming across function calls, and then I would look for the function definition, only to find that it was a function that doesn't exist in the code and was generated at runtime by Rails.

oftenwrong··on We shrunk our Javascript monorepo git size
This is one of the interesting benefits of https://www.unison-lang.org/ . A codebase of immutable functions inherently cannot have merge conflicts.
oftenwrong··on Sneak Peak at StableValue and SegmentMapper in Java [video]
https://openjdk.org/jeps/8312611
oftenwrong··on Show HN: Kotlin Money
The JSR 354 API can provide access to exchange rate services via the ExchangeRateProvider interface. The reference implementation (Moneta) includes a few implementations of ExchangeRateProviders that connect to online services to look up exchange rates.
oftenwrong··on Sapling: Source control that's user-friendly and scalable (2022)
These massive companies do employ a significant reliance on test automation. This approach is paired with sophisticated build tools and supporting infrastructure to make it possible to meaningfully test proposed changes, and ensure that they do not break any downstream projects.

edit: This comment I made recently is relevant, since it speaks to the motivations for using a monorepo and trunk-based development within a business: https://news.ycombinator.com/item?id=41293123

oftenwrong··on Sapling: Source control that's user-friendly and scalable (2022)
Seems like an approach that is superficially similar in architecture to what Google uses:

Piper <-> Mononoke

CitC <-> EdenFS

Obviously, the immense scale of these companies constrains the possible solutions. I would be interested to know what design decisions are different between them.

oftenwrong··on Stripe's Monorepo Developer Environment
The monorepo vs many-repos discussion often hits upon so many implied factors, but it's only really about how source code is stored.

It doesn't necessarily indicate much about the deployment model. You can have many separately releaseable things in one repo, and you can have one independently releaseable thing based on the sources of many repos.

Monorepos enable, but don't require, source-level co-evolution. Or maybe a better way to put it would be: many projects can have a shared history. Many-repos require independent source-level evolution. In the open source world there is no real choice: every project wants to be independent. The authors of a given project can do what they wish with it.

One weird thing to think about is that monorepos can accomodate many-repo style workflows. You can still develop projects completely independently within a single repo. Of course you can store separate projects on separate revisions, which would be weird. An even weirder approach would be having all projects in a given revision, but have totally independent builds, no single-version policy, no requirement for atomic compatibility, et cetera. These are all things that are often imposed for monorepos, but that are also not requirements. Basically, you can treat each project as independent even if their sources are stored together. I don't think there are any reasons to actually do this, of course.

oftenwrong··on Micro-libraries should never be used
The key point is "If ... the registry is available", and the dependencies contained therein. We take on risk by relying on NPM to always be there and always provide us the dependencies we have already invested in. I'm arguing that organisations should take a more defensive stance against dependencies becoming unavailable. If you depend on it, keep a copy of it somewhere that you control.
oftenwrong··on Stripe's Monorepo Developer Environment
To put it in the most general terms: It provides the same value that using a VCS has for a project, but applied to the entire company.

In a standalone project, would you accept a change that is incompatible with other code in the project? For example, would you allow a colleague to change a function in a way that breaks the call sites? No, you probably would not.

The attitude within monorepo shops is that this level of rigour should be applied to the entire company. Nobody should be able to make a change anywhere if it would break anything elsewhere, or they should only be permitted to do so with intention. There are caveats to this, but that is the general idea.

oftenwrong··on Micro-libraries should never be used
The primary cause of the left-pad incident was that left-pad was removed from the npm registry. Many libraries depended on left-pad. The same could have occurred with any popular library, whether micro or not.

To reformulate the statement made in the intro of this post: "maybe it’s not a great idea to outsource _any critical_ functionality to random people on the internet."

It has long been a standard, best practice in software engineering to ensure dependencies are stored in and made available from first-party sources. For example, this could mean maintaining an internal registry mirror that permanently stores any dependencies that are fetched. It could also be done by vendoring dependencies. The main point is to take proactive steps to ensure your dependencies will always be there when you need them, and to not blindly trust a third-party to always be there to give your dependencies to you.

oftenwrong··on Building data infrastructure that will last
There is a Greg Young talk about this called 'The Art of Destroying Software'
oftenwrong··on Null-Restricted and Nullable Types
Which of these is easier to search for in a book or web page? Which will allow for clearer oral discussion?

I prefer using long options in shell scripts for similar reasons. Easier for future maintainers to search for.

oftenwrong··on Null-Restricted and Nullable Types
>but this could still easily happen by mistake.

I have yet to see this ever happen, despite working in Java shops using Optional heavily since it was included in the JDK. I would guess that this is due to developers using better tooling. IDEs commonly provide warnings when returning null, or when violating a "soft" nullability assertion marked by an annotation. NullPointerExceptions seem fairly rare.

oftenwrong··on 1JPM: A Maven/Gradle alternative in a single Java file
Maven is the de facto standard for open source Java projects, and it still has a reserved seat at that table, but it falls short of what other build systems provide. For example, multi-module projects and incremental builds are more like bolted-on hacks in Maven 3 (I say this with great respect for the work put in by the maintainers). With rules_jvm_external, and other general usability improvements in recent years, Bazel is now quite easy to use. In a corporate context, I think Bazel is a better choice where Java is concerned. I do hope that Maven 4 will close the gap.
oftenwrong··on 1JPM: A Maven/Gradle alternative in a single Java file
Maven plugins and extensions can execute arbitrary code, so you should still exercise care when running an untrusted maven project.
oftenwrong··on 1JPM: A Maven/Gradle alternative in a single Java file
You can quite easily get by with the standard JDK tools (javac, jlink, etc) + a tool for fetching dependencies, such as https://github.com/coursier/coursier or https://github.com/bowbahdoe/jresolve .
oftenwrong··on 1JPM: A Maven/Gradle alternative in a single Java file
You can run multi-file source-code programs as of JDK 22: https://openjdk.org/jeps/458
oftenwrong··on I kind of like rebasing
The debate about whether to preserve the true history or clean it up is based on the limitations of git log. There is no reason we need to choose. Imagine you could `git summarise` a range of commits. Anyone who wanted a clean, straightforward history could read through the highest level of summarisation. If one wanted to dig deeper, they could peel away the summary and look at the log items below it.
oftenwrong··on Ask HN: Should orgs limit the number of languages/frameworks?
I agree with the other comments that are basically saying to be conservative about adding to your toolbox. Additionally, I recommend using technologies with existing heavy investment from the industry. For example, anything on the top of this list is a safe choice of language in general: https://survey.stackoverflow.co/2023/#most-popular-technolog... . This reduces risks from having to assume maintenance burden, hiring difficulties, finding support, integration with other technology, and more. Adopting some tool that is later abandoned is a frequent source of pain for small companies. Of course, there may be good reasons to stray from this guideline in some cases.
oftenwrong··on Why am I dreaming I have an exam I didn't study for?
It's probably not great to fill children's lives with almost endless anxiety, especially anxiety stemming from school. Don't we want them to enjoy learning, so that they are motivated, and so they learn to love learning in school and beyond it?

There are alternative models that are more considerate of student happiness, such as: https://en.wikipedia.org/wiki/Summerhill_School

oftenwrong··on Ask HN: Best tool for running a Linux desktop VM on a Apple Silicon Mac?
I would have to purchase a subscription.

Any experience with VMWare Fusion or Parallels?

The problem I had with UTM was that occasionally I would attempt to switch back to the guest, and I would find it "dead": unresponsive, no visual output. I sought help from the community on debugging the issue, but I could not determine what was occuring. My use case is perhaps not common, so not many people have run into the same issue with such a new project.

oftenwrong··on Ubuntu 24.04 (and Debian) removed libsystemd from SSH server dependencies
What's wrong with journald? I do not know much about it, aside from having to use journalctl to view logs occasionally.
← PreviousPage 4 of 34Next →