Better HN
topnewbestaskshowjobs
Log inSign up

oftenwrong

15,025 karma · joined Apr 22, 2012 (14y ago) · 2,479 submissions

sfir6i2z@mailer.me
Submissions

121.

Git Trailers (2024)(alchemists.io ↗)

3 points · by oftenwrong · 1y ago · discuss

comment 1y ago · link · parent

Not sure if this fits, but JDK 24 includes a new API, java.lang.classfile, for classfile manipulation.

https://openjdk.org/jeps/484

comment 1y ago · link · parent

Rich Hickey on HttpServletRequest?

https://www.youtube.com/watch?v=aSEQfqNYNAc

comment 1y ago · link · parent

In small companies, cloud also provides the ability to work around technical debt and to reduce risk.

For example, I have seen several cases where poorly designed systems that unexpectedly used too much memory, and there was no time to fix it, so the company increased the memory on all instances with a few clicks. When you need to do this immediately to avoid a botched release that has already been called "successful" and announced as such to stakeholders, that is a capability that saves the day.

An example of de-risking is using a cloud filesystem like EFS to provide a pseudo-infinite volume. No risk of an outage due to an unexpectedly full disk.

Another example would be using a managed database system like RDS vs self-managing the same RDBMS: using the managed version saves on labor and reduces risk for things like upgrades. What would ordinarily be a significant effort for a small company becomes automatic, and RDS includes various sanity checks to help prevent you from making mistakes.

The reality of the industry is that many companies are just trying to hit the next milestone of their business by a deadline, and the cloud can help despite the downsides.

comment 1y ago · link · parent

>Lightweight Java has always been a thing for those who appreciate Java-the-language but despise Java-the-ecosystem.

I always disliked Java until I was converted by some developers of that group in a past job. I suppose it is fair to judge a language by the overall flavour of its ecosystem, but it is a bit disappointing. I wish more people could see how simple and _good_ it can be when you use the JDK itself, and not go through other overcomplicated systems to use it. For example, Spring Boot is basically a massive pile of hacks (regardless of whether you consider it good or bad), and Java only really serves as an underlying support technology for it.

comment 1y ago · link · parent

Also, see this project that is in a similar space as Coursier:

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

https://github.com/bowbahdoe/jresolve

127.

Bazel 8.0(github.com ↗)

137 points · by oftenwrong · 1y ago · 46 comments

comment 1y ago · link · parent

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.

comment 1y ago · link · parent

Shenandoah was deemed production-ready in OpenJDK 15, but G1 remains the default collector in 23.

comment 1y ago · link · parent

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/

comment 2y ago · link · parent

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.

comment 2y ago · link · parent

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.

comment 2y ago · link · parent

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.

comment 2y ago · link · parent

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.

comment 2y ago · link · parent

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.

comment 2y ago · link · parent

This is one of the interesting benefits of https://www.unison-lang.org/ . A codebase of immutable functions inherently cannot have merge conflicts.

comment 2y ago · link · parent

https://openjdk.org/jeps/8312611

comment 2y ago · link · parent

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.

139.

The Hose Clamp Story [video](youtube.com ↗)

2 points · by oftenwrong · 2y ago · discuss

140.

MTA Open Data Challenge(new.mta.info ↗)

221 points · by oftenwrong · 2y ago · 77 comments

141.

Urban Roadway in America: The Amount, Extent, and Value(tandfonline.com ↗)

2 points · by oftenwrong · 2y ago · discuss

comment 2y ago · link · parent

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

comment 2y ago · link · parent

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.

144.

Grenfell Tower Inquiry Phase 2 report(grenfelltowerinquiry.org.uk ↗)

2 points · by oftenwrong · 2y ago · discuss

145.

JetBrains Workspaces aims for benefits of monorepos without the downside(devclass.com ↗)

1 points · by oftenwrong · 2y ago · discuss

comment 2y ago · link · parent

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.

comment 2y ago · link · parent

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.

comment 2y ago · link · parent

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.

comment 2y ago · link · parent

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.

1
456
83