MurphyA/hacker-news huggingface dataset:
by mceachen | 2025-05-17 16:57:29+00:00
Other posters correctly described _what_ this is, but I didn't see anyone answer _why_.

Using a Symbol as the method name disambiguates this method from any previously-defined methods.

In other words, by using a Symbol for the method name (and not using a string), it's impossible to "name collide" on this new API, which would accidentally mark a class as disposable.
by amluto | 2025-05-17 16:58:08+00:00
A small amount of searching suggests that dvh and svh have semantics on Mobile Safari that are, at best, confusing.

But I think this misses the point. Mobile Safari has a heuristically auto-hiding “toolbar”, and the heuristic is far from perfect, and the toolbar overlays the content, and Safari tries to offer some features that maybe let webpages move their content out of the way when hidden. And the result works poorly sometimes.

Fundamentally, doing a good job of having a control sitting on the section of the screen that shows content and mitigating the risk that the control obscures the content is hard.
by toast0 | 2025-05-17 16:58:42+00:00
> hand written Perl (please tell me nobody did this)

I've not had a need, but I wrote a just enough protocol code for TLS 1.3 in Erlang as a prototype, and it wouldn't be awful in Perl with pack/unpack; binary matching is a lot nicer in Erlang though. :P

Used that prototype to inform development of a Java implementation of TLS 1.3 protocol only (crypto and certificate parsing and verification through system libraries) to get consistent TLS 1.3 features on a very popular Android app. I think Google has a thing you can do to get a TLS 1.3 capable stack now, but not then.

With the TLS illustrated series [1] it would be easier than when I did it. The test vectors in the TLS 1.3 rfcs and drafts are very nice to have too.

[1] https://tls13.xargs.org/
by Rochus | 2025-05-17 17:00:33+00:00
Ok, I see, thanks; so it's the same version as implemented in OBNC posted above. It's the last version Wirth specified, and quite different from the versions used for the Oberon systems 2, 3 and 4 in the nineties. Personally I consider Oberon-2 the most useful version, but I still had to get rid of a lot of orthodoxies to really use it in my projects (see https://github.com/rochus-keller/Oberon).

Your Forth implementation is fascinating.
by breadwinner | 2025-05-17 17:00:45+00:00
Side effects are not allowed in functional style programming. Exceptions are side effects, it doesn't matter whether they are checked or unchecked exceptions.

https://jessewarden.com/2021/07/why-functional-programmers-a...

While composing methods in stream style is convenient, methods that can throw exceptions warrant more careful coding, so convenience should not always be the priority.
by zahlman | 2025-05-17 17:00:46+00:00
> If you have complex control flow, better to fit it on a screen in a single function, rather than spread throughout the file.

This part in particular seems like an aesthetic judgment, and I disagree. I find it more natural to follow a flowchart than to stare at one.

> A related pattern here is what I call “dissolving enum” refactor.... There are two branching instructions here and, by pulling them up, it becomes apparent that it is the exact same condition, triplicated (the third time reified as a data structure):

The problem here isn't the code organization, but the premature abstraction. When you write the enum it should be because "reifying the condition as a data structure" is an intentional, purposeful act. Something that empowers you to, for example, evaluate the condition now and defer the response to the next event tick in a GUI.

> The primary benefit here is performance. Plenty of performance, in extreme cases.

Only if so many other things go right. Last I checked, simply wanting walruses to behave polymorphically already ruins your day, even if you've chosen a sufficiently low-level programming language.

A lot of the time, the "bad" code is the implementation of the function called in the "good" code. That makes said function easier to understand, by properly separating responsibilities (defining frobnication and iterating over walruses). Abstracting the inner loop to a function also makes it sane to express the iteration as a list comprehension without people complaining about how you have these nested list comprehensions spread over multiple lines, and why can't you just code imperatively like the normal programmers, etc.

> The two pieces of advice about fors and ifs even compose!

1. The abstraction needed to make the example comprehensible already ruins the illusion of `frobnicate_batch`.

2. If you're working in an environment where this can get you a meaningful performance benefit and `condition` is indeed a loop invariant (such that the transformation is correct), you are surely working in an environment where the compiler can just hoist that loop invariant.

3. The "good" version becomes longer and noisier because we must repeat the loop syntax.

> jQuery was quite successful back in the day, and it operates on collections of elements.

That's because of how it allowed you to create those collections (and provided iterators for them). It abstracted away the complex logic of iterating over the entire DOM tree to select nodes, so that you could focus on iterating linearly over the selected nodes. And that design implicitly, conceptually separated those steps. Even if it didn't actually build a separate container of the selected nodes, you could reason about what you were doing as if it did.
by mrweasel | 2025-05-17 17:01:22+00:00
It just seems like it's happening way more often in JavaScript, but I've seen absolute horrid and confusing Python as well.

The JavaScript syntax wasn't great to begin with, and as features are added to the language it sort of has to happen within the context of what's possible. It's also becoming a fairly large language, one without a standard library, so things just sort of hang out in a global namespace. It's honestly not to dissimilar to PHP, where the language just grew more and more functions.

As others point out there's also some resemblance to C#. The problem is that parts of the more modern C# is also a confusing mess, unless you're a seasoned C# developer. The new syntax features aren't bad, and developers are obviously going to use them to implement all sorts of things, but if you're new to the language they feel like magical incantations. They are harder to read, harder to follow and doesn't look like anything you know from other language. Nor are they simple enough that you can just sort of accept them and just type the magical number of brackets and silly characters and accept that it somehow work. You frequently have no idea of what you just did or why something works.

I feel like Javascript has reached the point where it's a living language, but because of it's initial implementation and inherit limits, all these great features feel misplaced, bolted on and provides an obstacle for new or less experienced developers. Javascript has become an enterprise language, with all the negative consequences and baggage that entails. It's great that we're not stuck with half a language and we can do more modern stuff, it just means that we can't expect people to easily pick up the language anymore.
by collingreen | 2025-05-17 17:01:37+00:00
This sums it up. Article just declares that it's easier to understand intent from a code diff than from someone explaining their intent. No thoughts behind it or evidence or even a hunch, just "that thing experienced devs say is wrong because I said so".

To OP - an article explaining why you think the above could be interesting. If you take that on, post it! Also if you decide to do that please include some examples, especially config changes and small, confusing diffs that folks advocating for commit messages with intent use as examples of why it's important.
by Jtsummers | 2025-05-17 17:02:30+00:00
> Wouldn't this violate the rule?

The article is offering a heuristic, not a hard rule (rule of thumb = heuristic, not dogma). It can't be applied universally without considering your circumstances.

Following his advice to the letter (and ignoring his hedging where he says "consider if"), you'd move the `if (batch.length == 0)` into the callers of `setUpNeededHelpers`. But now you have to make every caller aware that calling the function could be expensive even if there are no contents in `batch` so they have to include the guard, which means you have this scattered throughout your code:

if (batch.length == 0) { return default } setup(batch)

Now it's a pair of things that always go together, which makes more sense to put into one function so you'd probably push it back down.

The advice really is contingent on the surrounding context (non-exhaustive):

1. Is the function with the condition called in only one place? Consider moving it up.

2. Is the function with the condition called in many places and the condition can't be removed (it's not known to be called safely)? Leave the condition in the function.

3. Is the function with the condition called only in places where the guard is redundant? In your example, `batch.length == 0` can be checked in `process_batch`. If all calls to `setup` are in similar functions, you can remove the condition from `setup` and move it up.

4. If it's causing performance concerns (measured), and in many but not all cases the check is unneeded then remove the guard from `setup` and add it back to only those call-sites where it cannot be safely removed. If this doesn't get you any performance improvements, you probably want to move it back down for legibility.

Basically, apply your judgment. But if you can, it's probably (but not always) a good idea to move the ifs up.
by mindslight | 2025-05-17 17:02:33+00:00
I wouldn't say this qualifies as regulatory capture. Regulatory capture is when an industry embraces the creation of regulations, as it cements the incumbents' position, raises the barriers to entry for new competitors, and precludes deeper regulation or longstanding causes of legal action. The "Fair" Credit Reporting Act itself is a prime example of regulatory capture.

This is more like the wholesale (continued) destruction of the US governments ability to regulate anything. Effectively abdicating our constitutional form of government - nominally democratic and aimed at protecting natural rights - in favor of unrestrained corporate totalitarianism based around the fallacy of individual consent.
by WalterBright | 2025-05-17 17:03:05+00:00
> In 1973, it decreed that factories of a certain size must allocate 20% of their surface area to green spaces.

This sounds like such a fine idea.

In my yard, I wanted to expand the parking space with some temporary parking, but didn't want ugly paving. With the generally wet weather, that meant mud and ruts. A contractor I talked to suggested "grasscrete".

https://grasscrete.com/

Mine is just using cinderblocks laid on their side. The vegetation grows up through the holes in the grasscrete, while the cinderblocks support the weight of the car without disrupting the vegetation. The holes let the water sink in instead of running off.

Over time, it has been colonized by native vegetation, and you can't even see the grasscrete. I've been very pleased with the results, and wonder why its use isn't common. It's rarely used for parking, which lets the vegetation recover.
by mmooss | 2025-05-17 17:03:44+00:00
The researchers themselves seem to disagree with your comment:

Researchers from the University of Rochester warned consumers to be cautious, especially as taurine is commonly used in energy drinks and dietary supplements.

... "The study states, “Since taurine is a common ingredient in energy drinks... our work suggests that it may be of interest to carefully consider the risks and benefits of supplemental taurine in leukaemia patients,”.
by Legend2440 | 2025-05-17 17:03:59+00:00
If you look at the learned gates, it does not directly extract the underlying rules of Conway's game of life. It has many more gates than are necessary and they have the same complex, uninterpretable structure you see in a neural network.

The training method they're using is the same as used for quantized neural networks. Your 'neurons' being logic gates doesn't mean you're doing logic, it's still statistics.
by nayuki | 2025-05-17 17:04:14+00:00
That is quite interesting. I took normal-speed medium-distance trains in Taiwan and there are many similarities to Japan. The ticket-checking gates to enter/exit the station are exactly the same models used in Japan. The tickets are similar to the ones used in Japan, but they have a QR Code printed on them and might not be magnetic. Even when you exit the station, the ticket gate will give back your ticket - unlike Japan!
by boxfire | 2025-05-17 17:05:57+00:00
Definitely out of date, e.g. the 3SUM subquadratic conjecture (probably 11) has been solved and improved on [1].

If it's not been already there's immediate application, e.g. problem 41.

[1]:https://link.springer.com/article/10.1007/s00453-015-0079-6
by Brian_K_White | 2025-05-17 17:07:22+00:00
One incomplete but easy to state counter "rule" to fling back in such cases is just: If the function isn't generic and re-used for other unrelated things, then it probably shouldn't be a seperate function.

Yeah only probably, there can sure be large distinct sub-tasks that aren't used by any other function yet would improve understanding to encapsulate and replace with a single function call. You decide which by asking which way makes the overall ultimate intent clearer.

Which way is a closer match to the email where the boss or customer described the business logic they wanted? Did they say "make it look at the 3rd word to see if it has trailing spaces..."?

Or to find out which side of the fuzzy line a given situation is falling, just make them answer a question like, what is the purpose of this function? Is it to do the thing it's named after? Or is it to do some meaningless microscopic string manipulation or single math op? Why in the world do you want to give a name and identity to a single if() or memcpy() etc?
by randcraw | 2025-05-17 17:07:51+00:00
> I don't think it's possible to generate an acceptable story without reasoning.

If I look back at any article, book, movie, or conversation that I liked, it always had this essential ingredient: it had to make sense, AND it had to introduce some novel fact (or idea) that led to implications that were entertaining somehow (intriguing, revelatory, amusing, etc).

Would this be possible without the author having some idea of how reasoning works? Or of what facts are novel or could lead to surprise of some kind? No is the obvious answer to both. Until I see clear evidence that LLMs have mastered both logic and the concept of what knowledge is and is not intriguing to a human, I foresee little creative output from any LLM that will 'move the needle' creatively.

Until then, LLM-generated fare will remain the uninspired factory produce of infinite monkeys and typewriters...
by AStonesThrow | 2025-05-17 17:07:58+00:00
When I was 19, my parents sent me to see a therapist. This therapist's office was in the Children's Hospital, and it was already humiliating to walk into that place as a grown man and there is a waiting room with toys and building blocks for me to play with.

Anyway, the therapist gave me a few "pep-talk sessions" which did not seem oriented at all to helping me get better, or discern the root causes of my depression. The therapist proceeded to help me claim disability at work and get back into college. He also referred me to his next-door neighbor, the psychiatrist.

So I go home with my first SSRI prescription and start taking it. My mother soon exclaimed how much better I was acting. I was smiling and full of energy.

And it turns out that whether or not we are ingesting fluoride orally, people do act and feel better when they are seeing a therapist and getting attention. For a time there, I actually felt like people cared about my well-being and there were things being done about it.

Upon my diagnoses, the nurses would often regale me with stories about how the noblest politicians and artists were afflicted with the same things I was. This was cold comfort. They all insisted it was a chemical imbalance, and their own cocktail of chemicals was bound to offset this crazy wrong-headed chemistry that had gotten mixed up in my head (nevermind that most serotonin has nothing to do with the brain, and is mostly in your digestive system?)

Now there were many dark things I didn't know about the fluoride pills they had prescribed me. I suffered several disastrous interactions with alcohol before they told me it's not a good idea to drink. I had those "brain zap" withdrawal symptoms when I hadn't taken enough.

Thankfully, I did not experience the suicidal or homicidal tendencies which can come with taking SSRIs. Yes, homicide is a common reaction to being drugged. Before SSRIs, Charles Whitman loved his Dexedrine, and packed a goodly supply as he scaled the tower in Texas. The Columbine Kids, very intelligent boys, had all been referred to BH care and were all being medicated with SSRIs and other drugs at the time of their untimely deaths and egregious actions.
by mitthrowaway2 | 2025-05-17 17:08:16+00:00
It's a subtle but very impactful difference. Japanese faregates also typically have two sets of doors, allowing them to close in front of you whichever direction you are moving. So people can go through at a fast pace and very tightly spaced, and the door still closes in front of the correct person.

They also have the display screens located farther ahead so you don't have to stop walking to see how much fare you were charged.
by zahlman | 2025-05-17 17:10:35+00:00
> The problem is not just broken code, the problem is many different things like “how do I …?” or “I am trying to figure out how to …?” which is not about the broken code.

> > Or if you figured out that you need to do something specific, and came up with a clear, precise specification for it, and there isn't a clear way to break the task down further into logical steps.
Ask HN: What surprised you / did you learn as you built out your company?
by irf1 | 2025-05-17 17:12:09+00:00
I've struggled to find my voice on the internet as a founder. I don't write much or have a blog, outside the occasional normie tweets. I haven't built in public or promoted my work properly and I'm sure a lot of engineers and fellow founders struggle with this too.

Yesterday however, someone asked me "What surprised you / did you learn as you built out this concept?". For the first time, I felt unlocked! I felt like I can finally speak with authority and share something personal, true and insightful. I hope this prompt does the same for you, go ahead and share your answer below (and then share it on other platforms too!) Here's mine:

"One thing that surprised me while building this open source bounty concept is people considered it taboo to pay for open source contributions, like it ruins the OSS ethos (or its free labor market) and some people fought me.

One thing that I learned is companies loved to hire full-time the contributors they met (15 customers did) and helping these companies hire incredible open source engineers is higher value for everyone involved than simply solving a few issues."
by mdaniel | 2025-05-17 17:12:49+00:00
Also, the Zen of Python is supposed to be one obvious way to do something but ddg "python dependency manager" and have a good laugh. That actually becomes triple lol for when uv steps in and says "uh, your pip requirements.txt is unsatisifyable, what are you even?!"

And let me just say what an absolutely stellar job the rustc authors have done with the error messages. Just out of this world thoughtful. I have not yet gotten on board with their compile time vs safety and insight tradeoff, but I can see why they chose those two axes
by riquefar | 2025-05-17 17:13:03+00:00
Hey HN,

I’ve always struggled to plan my week in a realistic way. I'd either pile up a to-do list and ignore it, or spend too much time manually moving blocks around in my calendar.

So I built SmartWeeking — a web app that takes your task list, and automatically distributes those tasks throughout your week based on your availability, so you can fit things you want to do in your busy week.

Technologies:

I built SmartWeeking using Go Language for the backend (it was something I wanted to learn), and I used TypeScript with the React framework to build the frontend.

What it does:

- Connects with Google Calendar (OAuth, no passwords collected)

- Lets you add tasks with estimated durations and priorities

- Generates a weekly plan by placing your tasks into free time slots

- Lets you tweak and regenerate the schedule as needed

Why I made it:

I’ve always had a packed schedule — between work, college, and other responsibilities, it felt impossible to fit in the things I actually wanted to do, like exercising, reading, or spending time with friends.

I needed a smart planner that could help me balance what I have to do with what I want to do — one that would automatically adjust when new events came up, so I wouldn’t lose track of my personal goals every time my week changed.

Try it:

It’s free to use (with a premium plan available later), no credit card or download needed. You can try it directly here: https://smartweeking.com

I’d love feedback on:

- Whether the idea is useful to you

- What’s confusing or could be better

- Any bugs, rough edges, or feature requests

Thanks for checking it out!
by soruly | 2025-05-17 17:13:04+00:00
Suica has a pretty large sensing distance (85mm). So it can "power up" the card at a distance before getting close to the reader.

To avoid large touch area causing accidental touches, places like vending machine requires you to keep your card within sensing area for up to 1 second before completing the transaction.

reference: https://www.watch.impress.co.jp/docs/series/suzukij/1316685....

Speed test between magnetic ticket / IC Card / Credit Card https://www.youtube.com/watch?v=gAQM5NNnCi4
Show HN: I built a knife steel comparison tool
by p-s-v | 2025-05-17 17:13:21+00:00
Hey HN!

I'm a bit of a knife steel geek and got tired of juggling tabs to compare stats. So, I built this tool: https://new.knife.day/blog/knife-steel-comparisons/all

It lets you pick steels (like the ones in the screenshot) and see a radar chart comparing their edge retention, toughness, corrosion resistance, and ease of sharpening on a simple 1-10 scale.

It's already been super handy for me, and I thought fellow knife/metallurgy enthusiasts here might find it useful too.

Would love to hear your thoughts or any steel requests!

Cheers!
by s1artibartfast | 2025-05-17 17:13:36+00:00
I guess I never saw it that way and struggle to think of example usage as a noun.

Human technology, human race, human rights, human error, human nature, human history, human power. Always an adjective.

I still cant think of a common noun usage, let alone an alternative noun reading for human resources. People don't say "hello human".

It is weird to see comments talking about "HR" as some euphemism or double speak. Maybe I'm the outlier, but I don't understand any other meaning besides managing the resource that is humans.

That covers lots of things- managing the liability, procurement, retention, firing, of the workforce.

Do people really think "HR" is the resource?
by fragmede | 2025-05-17 17:13:42+00:00
> Would you ever be able to... later have Claude actually use that framework?

Yes, subject to LLM token limitation. I've run into the second half of the problem, where the LLM doesn't know about the latest version of a library, or the new/modified API that version implements. So then the LLM isn't able to write working code for that API. However, if you add the latest docs into the context window, and ask it to generate code, the LLM is now able to generate working code that uses the new semantics.

The preceding steps to complete the example would then be for CoPilot (which is a frontend to various LLMs, including Claude) to generate the new framework, and then generate docs for this new framework.