HNHacker News
TopNewBestAskShowJobs

andriamanitra

240 karma · joined May 5, 2022

submissionscomments
andriamanitra··on Britain's railway privatization was an abject failure
Talking about "trains in Europe" as one thing doesn't really capture the complexity of the system – it varies a lot between different countries and operators. For example Swiss trains (SBB) are extremely reliable but Deutsche Bahn is famously unreliable.
andriamanitra··on Ask HN: How does one stay motivated to grind through LeetCode?
Don't think of it as a grind! I play some Leetcode almost daily purely for my own enjoyment. The problems are actually pretty fun for the most part. They can force your mind to think of a problem in ways it isn't used to which is rewarding in and of itself. And looking at how others have solved the same problem afterwards can teach you all kinds of nifty tricks, especially in programming languages you're less familiar with!

If Leetcode is just a means to an end for you you're probably not going to have a good time.

andriamanitra··on FFmpeg to Google: Fund us or stop sending bugs
As much as I hate to be on Google's side I think they're doing a reasonable thing here. Valid bug reports are valuable contributions on their own, and disclosing security issues is standard practice. Not disclosing them doesn't help anyone. Security through obscurity is not security. If neither FFMPEG nor Google dedicate resources to fixing the issue in 90 days, making it public at least ensures that it gets visibility and thus has a higher chance to get fixed by a third party.

I'm sure Google could (and probably should) do even more to help, but FFMPEG directing social media rage at a company for contributing to their project is a bone-headed move. There are countless non-Google companies relying on FFMPEG that do much less for the project, and a shit show like this is certainly not going to encourage them to get involved.

andriamanitra··on Date bug in Rust-based coreutils affects Ubuntu 25.10 automatic updates
I think you're completely missing the point. The problem being solved is not that coreutils is bad and thus they should be rewritten, the problem is that coreutils is not specified well enough to make new implementations straight-forward. Thus a new implementation written from scratch is tremendously valuable for discovering bugs and poorly documented / unspecified behavior.

For a business it's often fine to stop at a local maximum, they can keep using old versions of coreutils however long they want, and they can still make lots of money there! However we are not talking about a business but a fundamental open source building block that will be around for a very long time. In this setting continuous long term improvement is much more valuable than short term stability. Obviously you don't want to knowingly break stability either, and in this regard I do think Ubuntu's timeline for actually replacing the default coreutils implementation is too ambitious, but that's beside the point—the rewrite itself is valuable regardless of what Ubuntu is doing!

andriamanitra··on Scripts I wrote that I use all the time
A subprocess (git) can't modify the working directory of the parent process (the shell). This is a common annoyance with file managers like yazi and ranger as well—you need an extra (usually manual!) installation step to add a shell integration for whichever shell you're using so the shell itself can change directory.

The best solution for automatically cd'ing into the repo is to wrap git clone in a shell function or alias. Unfortunately I don't think there's any way to make git clone print the path a repository was cloned to, so I had to do some hacky string processing that tries to handle the most common usage (ignore the "gh:" in the URL regex, my git config just expands it to "git@github.com:"):

https://github.com/Andriamanitra/dotfiles/blob/d1aecb8c37f09...

andriamanitra··on Iceland reports the presence of mosquitoes as climate warms
Climate has absolutely nothing to do with this discovery. All of the other Northern countries, many of which are colder than Iceland, already have mosquitoes (Greenland has lots of them!). Culiseta annulata is well adapted to cold climate. And it's not even particularly cold in Iceland at this time of year – the mosquitoes may not even have needed to survive a winter yet!
andriamanitra··on When if is just a function
You may not want a fresh scope for control flow as you often want to use variables from the outer scope inside the if statement. Imagine you wanted to do something like this with your if statement implemented with a function (this is how the syntax would look like using a block argument in Ruby):

    state = "inactive"
    if_func(condition) {
        state = "active"
        activate_button.disabled = true
        deactivate_button.disabled = false
    }
In many languages you would need to wrap `state` in something that can be passed by reference, and make the function take multiple parameters. For example in JavaScript it would turn into something like this mess:

    let state = ["inactive"];
    if_func(condition, ({state, activate_button, deactivate_button}) => {
        state[0] = "active";
        activate_button.disabled = true;
        deactivate_button.disabled = false;
    }, {state, activate_button, deactivate_button});
andriamanitra··on When I say “alphabetical order”, I mean “alphabetical order”
The so-called "natural" sort makes sense for version numbers and enumeration (without zero-padding) but I'm more often dealing with file names with a datetime (like in the article), a hexadecimal hash, or just randomized string of characters that includes numbers. In those cases "natural" sort makes it harder to find the file you're looking for.

Even when files are enumerated it's pretty rare to have more than 9 parts and no zero-padding, whereas there are almost always multiple consecutive digits in the use cases for which "natural" sort is not a good fit for. It just feels like a bad default, at least for a programmer's workload.

andriamanitra··on A critique of package managers
I don't find the argument very convincing. If anything you should have more time to carefully vet your dependencies when you don't need to spend time manually doing the tedious bit. Making things more difficult than they need to be just to introduce friction is a ridiculous proposition.
andriamanitra··on Rv, a new kind of Ruby management tool
I go between different languages a lot so having a command line interface that is consistent with the one I use in Python (uv) would definitely be appreciated. I mostly use Ruby for single-file scripts with no dependencies, which means I don't do projects often enough to remember how to use bundle/gem/rvm/whatever. It seems to me like `rv` is not quite ready to fully replace them just yet but I'm excited to see where the project goes.

I'm also excited about `rv tool` because I've been having to re-install rubocop and ruby-lsp gems every time the minor version of the system Ruby is updated. It's just a few commands every year (and I'm sure it's a skill issue) but having things "just work" with a single `rvx rubocop` command will be sweet.

andriamanitra··on Rv, a new kind of Ruby management tool
In theory it would be nice to have one tool for all languages but I think it's never going to be practical because programming languages can be different in arbitrary ways. I can't imagine how the same tool could ever be ergonomic for managing projects written in C++, Scheme, Haskell and Bash for example. Mise (and other tools for managing development environments like Flox and asdf – I prefer Flox myself) only implement a subset of the features of languages specific tools like cargo/uv/rv. For example cargo can do all of this out of the box (and you can also extend it with more subcommands):

* manage dependencies

* format and lint code

* publish package on crates.io

* open the project documentation

* install binaries

* build/run the project

* run tests

* run benchmarks

Uv/rv don't (yet?) do all of that but they also manage Ruby/Python versions (which is done separately by rustup in Rust).

andriamanitra··on It’s not wrong that "\u{1F926}\u{1F3FC}\u200D\u2642\uFE0F".length == 7 (2019)
> For example, there is nothing wrong with an programming language that only allows ASCII in the source code and many downsides to allowing non-ASCII characters outside string constants or comments.

That's a tradeoff you should carefully consider because there are also downsides to disallowing non-ASCII characters. The downsides of allowing non-ASCII mostly stem from assigning semantic significance to upper/lowercase (which is itself a tradeoff you should consider when designing a language). The other issue I can think of is homographs but it seems to be more of a theoretical concern than a problem you'd run into in practice.

When I first learned programming I used my native language (Finnish, which uses 3 non-ASCII letters: åäö) not only for strings and comments but also identifiers. Back then UTF-8 was not yet universally adopted (ISO 8859-1 character set was still relatively common) so I occasionally encountered issues that I had no means to understand at the time. As programming is being taught to younger and younger audiences it's not reasonable to expect kids from (insert your favorite non-English speaking country) to know enough English to use it for naming. Naming and, to an extent, thinking in English requires a vocabulary orders of magnitude larger than knowing the keywords.

By restricting source code to ASCII only you also lose the ability to use domain-specific notation like mathematical symbols/operators and Greek letters. For example in Julia you may use some mathematical operators (eg. ÷ for Euclidean division, ⊻ for exclusive or, ∈/∉/∋ for checking set membership) and I find it really makes code more pleasant to read.

andriamanitra··on The attr() function in CSS now supports types
Unfortunately it's not widely available yet. [1] If it was supported by all majors browsers it would be nice for that one project I have that still generates a .html bar chart using style="height: ${height}px;".

[1] https://caniuse.com/mdn-css_types_attr_type-or-unit

andriamanitra··on Helsinki records zero traffic deaths for full year
> So they hurt quality of life by making it more painful to get anywhere, taking time away from everyone’s lives. You can achieve no traffic deaths by slowing everyone to a crawl. That doesn’t make it useful or good. The goal should be fast travel times and easy driving while also still reducing injuries, which newer safety technologies in cars will achieve.

Like others have pointed out making road speeds faster barely makes a dent in travel times. The absolute best way to reduce travel times is to build denser cities, which incidentally means less parking, narrower roads, and, most importantly, fewer cars. In a densely populated area it's impossible to match the throughput of even a small bike path with anything built for cars. Safety is just a bonus you get for designing better, more efficient, more livable cities.

andriamanitra··on The anti-abundance critique on housing is wrong
Just off the top of my head I can think of plenty of functional reasons why residential floor space cannot be analogous to cars.

Most importantly location matters. Space and buildings are not something that you can easily ship from one market to another to balance supply and demand. Space is inherently limited and replacing existing buildings with new more efficient ones is also problematic when you have people happily living in those old buildings, especially in high demand areas. Construction work takes time and in the meanwhile the displaced families will create even more demand.

There are practical limits on how densely you can pack floor space before it becomes prohibitively expensive, unsafe, or simply impractical. As you build higher the costs grow exponentially while the livable space per floor keeps decreasing due to the tapered shape of the building and need for larger structural core and more elevators. Above certain height you will be forced to target wealthier residents which means either offices or large luxury apartments that are anything but space efficient.

Construction is extremely capital intensive. A building takes a large upfront investment, and it takes a long time for it to pay off. With cars the cost of making more is marginal once you have an assembly line in place so it's significantly easier to re-invest profits into ramping up production.

Renting real estate makes more sense than renting automobiles because real estate is more expensive, less liquid, and better at holding its value over time. Owning a house is more difficult even when it would make financial sense to do so (not everyone can get a mortgage, or commit to living in the same city for an extended period of time).

> for better or worse we have chosen to place almost no limits on the quantity and density of cars

Even worse, most places have chosen to place a lower limit on the quantity and density of cars through parking mandates. It is absolutely insane that we are still wasting space on parking even in densely populated urban centers where it's impossible to accommodate everyone commuting by car.

andriamanitra··on Australia widens teen social media ban to YouTube, scraps exemption
It's not too much effort to find µBlock Origin filter lists that hide them. The only time I see YouTube shorts is when I deliberately navigate to the shorts tab on a channel page.
andriamanitra··on The EU could be scanning your chats by October 2025
It's always a minority pushing the weakening of encryption, which is why the proposals have never made it very far. What separates Europe from the US is that our political system is way more diverse and involves many more political groups (some of which have extreme opinions). This naturally means more diverse proposals, and lower chance of a given proposal becoming a reality. Especially so when compared to the US where it seems one person with the support of one political party can seemingly implement any crazy policy they think of on a whim.

I think it's probably a good thing to explore a wider range of ideas, even if many of the ideas suck and end up being scrapped.

andriamanitra··on I tried vibe coding in BASIC and it didn't go well
> Language evolves, words change, and AI means what it means now. It turns out it’s actually really useful to have an abstraction above the concept of LLMs to talk about the broader set of these types of technologies

I agree that "AI" can be useful as an umbrella term, but using it when referring specifically to the "LLM" subset of AI technologies is not useful. A ton of information about the capabilities and limitations of the system is lost when making that substitution. I understand why marketing departments are pushing everything as "AI" to sell a product but as consumers we should be fighting against that.

andriamanitra··on Phrase origin: Why do we "call" functions?
Depends on the language! If "if" wasn't a keyword, in Ruby that would be calling a method that takes one positional argument and one block argument, such as `def if(cond, &body) = cond && body.call`. In PureScript that could be a call to a function with signature `if :: Boolean -> Record () -> _`.

But I assume the comment you were replying to was not referring to the conditional syntax from C-like languages, instead referring to a concept of an if "function", like the `ifelse` function in Julia [1] or the `if` form in Lisps (which shares the syntax of a function/macro call but is actually a special form) [2], neither of which would make sense as one argument function.

[1] https://docs.julialang.org/en/v1/base/base/#Base.ifelse

[2] https://www.gnu.org/software/emacs/manual/html_node/elisp/Co...

andriamanitra··on When random people give money to random other people (2017)
I don't believe in the "fixed pie" view of the economy (does anyone..?) but wealth consolidation is still problematic because the ever-growing pie is rarely distributed among those who actually do the work, and concentrated power is a horrible way to run a free market economy. It leads to abuses that break the assumptions free markets are based on. Predatory pricing, regulatory capture, and buying out competition are examples from the vast toolbox only available to players who have accumulated significant wealth in the past. Slowly but surely the system gets skewed to reward past success and conniving over future success and hard work, which slows down progress and ultimately makes the world a little bit worse place for everyone to live in.

PS. I don't think it's a coincidence that both of your examples of creating wealth are typical "poor people" jobs. Obnoxiously wealthy people rarely create anything because they can simply pay someone else to do it, usually for a fraction of the value of their output.

andriamanitra··on When random people give money to random other people (2017)
I don't see how the failure of Soviet Union is supposed to disprove my argument – correlation does not imply causation. It was an incompetently managed and corrupt state. Collectively funding infrastructure projects and science is not something that only happened in the USSR, it was (and is) the norm everywhere. Consider all the innovations that spawned from (D)ARPA and NASA research projects for example. Taxpayer money through government contracts drives the entire military-industrial complex.
andriamanitra··on When random people give money to random other people (2017)
Most great things that require a large amount of money are funded mostly by collectives (historically the state and church, more recently companies) rather than wealthy people. SpaceX has certainly done some cool stuff (even before it started being funded by taxpayer money through government contracts), but I think the value of all of these billionaire-funded endeavors are a rounding error in comparison to all the infrastructure, science, education and healthcare that has been collectively funded. By limiting excessively wealthy people you give money a better chance to be allocated well.
andriamanitra··on When random people give money to random other people (2017)
This is a compelling argument but there is an upper limit of how much wealth can be intrinsically tied to a person. When we start talking about 8, 9, 10, 11, even 12 figures it's really hard to argue that the value of the wealth would diminish if it was distributed among more people. If anything I would expect people with more modest amounts of wealth to be more motivated to manage it (rather than hiring someone else to do it, at which point there is no intrinsic personal connection).
andriamanitra··on Square Theory
The obvious question to ask is could you take it to the third dimension and make a cube out of double-doubles? What about other shapes, perhaps a pyramid or a tetrahedron? Squares are simple enough that it's still easy to come up with examples, but I think a graph with higher edges-to-vertices ratio would be even more satisfying.
andriamanitra··on Rosettacode is down. Any ideas why?
According to a post few days ago on the Rosetta Code Discord they're trying to get the domain transferred from Network Solutions to "literally anywhere else" (sounds like they're not having a great time with that service provider). The alternate URL still works: https://rosettacode.miraheze.org/wiki/Rosetta_Code
andriamanitra··on CSS Minecraft
Not "still". That is not the same game that was on the website when I first got into Minecraft in 2010 but a JavaScript recreation made in 2019.
andriamanitra··on How to live on $432 a month in America
..in what National Weather Service described as "once-in-a-generation storm". Walking 2 km on a normal winter day (or even a mild blizzard) is not dangerous.
andriamanitra··on Finland announces migration of its rail network to international gauge
Rail Baltica will connect the Baltics to European rail network using 1435mm gauge. It is scheduled to be fully operational in 2030.
andriamanitra··on Finland announces migration of its rail network to international gauge
I hadn't considered throughput but that's a good point. Under normal circumstances even a few hours is meaningless but if you need to get lots of trains across the border in a short span of time it starts to accumulate.
andriamanitra··on Finland announces migration of its rail network to international gauge
I understand that but it is still economic: I highly doubt fixing a minor delay in material movement is the most effective use of these billions.
← PreviousPage 2 of 3Next →