Hacker Newsnew | past | comments | ask | show | jobs | submit | more piano's commentslogin

> Sure, you can’t in the general abstract case, but my exact point is that you can do this in practice, for programs which we actually write.

No, it can't be done with testing even for practical everyday programs, precisely because you never know how much your program is crossing into the "abstract general case" and which parts of it are more general than you think. Very often the cause of bugs is precisely this - that some part of a program behaves in a more general / less restricted way than the programmer thought.

It can be done with formal verification, but that's a whole another story.


> The previous poster is correct. Software cannot be proven to be bug-free.

Yes, it can, that's what the whole formally verified software branch is about. Of course, even with formally verified software, there can be failures caused by external factors such as faults in hardware etc. But some piece of software itself absolutely can be proved to be correct (ie. bug-free). It just takes special approaches such as programming languages amenable to formal proofs (eg. Idris).

Software is usually written in bug-inducing ways and using languages that hinder formal verification not because provably bug-free software is impossible but because it is typically too costly and difficult to write.


The thing that's always bothered me about this argument is the translation between proof and code+underlying system. Bugs can still be introduced there. Certainly significantly fewer bugs in the final result, but I don't think I'd be confident in calling it proven 100% bug-free.


In languages with termination analysis and dependent types, the source code _is_ the proof and it's verified by the compiler. Basically when such a program compiles, it's proved to be correct according to the specification.

Of course this still leaves space for bugs outside the program itself which still may influence it, such as bugs in the operating system or firmware or the like. Which may be prevented by having a formally verified OS too :)

But even in such a case, there might still be hardware errors (electrical noise, for example). Which is why for example spacecrafts or critical industry machinery double or triple their whole architectures. In such case the formally verified software runs on eg. three instances simulatenously and these instances cross-check each other's results all the time. When a hardware fault occurs (a bit randomly flipped in memory for example), they find out they're not matching and re-calculate.

That's as close as you can get to zero bugs.


The thing about Electron - and the thing that Electron fanboys either don't realize or don't care - is that with Electron, the company/vendor wins at the expense of users, who have to put up with their "application". No one really likes Elecrton apart from the vendor/developer and the most fanatic fanboys. Everyone else at best doesn't mind Electron.

If an Electron "application" is decent, people typically like the features or the online service to which it's tied but its Electron base is something that people more or less tolerate, depending on the degree it irks them. It's just a huge tradeoff, that's all. It reminds me of some Java or Python desktop applications, it's a similar kind of tradeoff.

Hopefully it'll pass just like the previous fads.


The other bonus of Electron (from a user perspective) is it lets companies release software for Linux too. For maybe the first time in history, Linux now gets a release for all these major mainstream services/companies -- I can now have VSCode, Slack, etc. on Linux and they work well. I've been on Windows and Mac for years and in recent years using Linux finally feels modern and viable. I'm not sure if VSCode/Slack would even create a Linux client if Electron wasn't available.

Disclaimer: Not an Electron fanboy, I don't even develop Electron apps. I do enjoy using a Linux dev laptop, however, and am not a hardcore vim/emacs guy.


Yeah, typically users are mildly annoyed by electron applications because they either don't fit into the basic style of the OS or suck away RAM. They stay because of the service, something that is provided (the walled garden usually)

Which is why electron is so popular. I'm sure the whole "it's way easier to whip something together that kinda works" is correct in the short term. You whip something up and rely mostly on the hype and viral marketing to drive your app.


Yep, no one likes Spotify. No one likes Slack. People are just putting up with them. Except not really, a few loud mouths complain, most users are totally happy.


I never said people didn't like Spotify or Slack. In fact, I said the exact opposite. Please read the comment properly and try to understand, don't just skim checking for "the right" opinion.


They really should cut the middle man.

What surprised me reading that wiki page is that apparently the metric system was opposed in the US based on religious reasons. That is mind-boggling.


Is there any compelling reason why the US should switch to the metric system for daily use?

Metric is already used universally in science and engineering, which seem to be the main fields in which consistency across countries matters. I completely agree that in physics, chemistry, engineering, medicine, etc., it is important to use standard units. But what harm is it doing in practice if in everyday life, Americans say things like "I weigh 180 lbs" instead of 81 kg?

The argument that the metric system makes unit conversions easier (e.g., the fact that it's immediately obvious how many meters are in 20 km, but not how many feet are in 12 miles) is true, but not very compelling to me. I virtually never find myself wanting to do these conversions in a non-scientific or non-engineering context, and on the very rare occasions where I need to, I can always look them up on Google.

A good comparison is degrees Celsius, which are just as arbitrary/unscientific (the standard metric unit is the Kelvin). Somehow people around the world get along fine using Celsius.


Why should there be any separation between science and daily life?

Think about it not for the benefit of the current generation who would be forced to burden the switch, but for the next generation who could reap the benefits.

I think one issue is that by growing up with US units and then using a second system for science and engineering, it can make American students studying those topics feel like they are in an unfamiliar territory and interfere with their intuition. Most will eventually overcome this through practice and become fluent in both systems, but it's still a barrier. Science becomes a Special Discipline requiring Special Language different than what your family uses at home. Like if all science were still done in French or Latin, and you needed to study those to read a paper.

Until you have met people who grew up abroad measuring their height in cm and their weight in kg, preparing food from recipes listing ingredients in grams and mL, to whom those units are completely natural for daily life and are also the same ones they use at work when designing machines and filling test tubes, it's easy to feel that US units simply "are" the units suitable for daily life, as though that were a universal truth and not just a local cultural oddity.

Not to mention the massive net costs of having suppliers worldwide making extra sets of almost identically sized components that nonetheless aren't interoperable. Screws with 3 mm and 3.175 mm diameter, etc.


> Science becomes a Special Discipline requiring Special Language different than what your family uses at home. Like if all science were still done in French or Latin, and you needed to study those to read a paper.

You realize this is still a problem for most of the world and needing to learn English, right? :P I'm hoping we can solve this in my lifetime with everyone knowing one standard language through education as a child, but as it stands the struggle is real for many of my fellow non native English speakers.

That said I agree with you, all these differences are a pain and I'm confronted with them way too often in my daily life.


> I'm hoping we can solve this in my lifetime with everyone knowing one standard language through education as a child

It seems like this is rapidly becoming the case in the Western world, and that that language is English.


Absolutely! America is very lucky to have come out on the right side of that lottery. But then it unnecessarily goes and handicaps itself by making measurements into a foreign language.


A good comparison is degrees Celsius, which are just as arbitrary/unscientific (the standard metric unit is the Kelvin). Somehow people around the world get along fine using Celsius.

You don't realize how arbitrary Fahrenheit and Celsius are until you try cooking at altitude. When I make breakfast in a particular town I frequent, it takes almost an extra minute to boil an egg.


My Jeep is a bizarre combination of metric and SAE. ISS needs to have two sets of tools[0]. NASA lost the Mars Climate Orbiter due to confusion over the units of measure[1]. Patients are given the wrong dosages[2].

It seems safe to say it's a point of ongoing friction, especially on things like international trade.

[0]: https://space.stackexchange.com/questions/12391/iss-nuts-and... [1]: https://mars.jpl.nasa.gov/msp98/news/mco991110.html [2]: https://www.chihaklaw.com/Articles/Confusion-over-metric-mea...


I already made it clear that I totally agree metric should be standard in engineering or scientific applications. I wasn’t aware that this isn’t the case in the US — thanks for the info. I believe it is at least 95% the case in the US and I think we should make every effort to get that to 100%.

I still stand by my argument that it does not matter much for everyday life.


Why have two separate sets of unit systems?


Well, the point I was arguing was "why not" have two separate systems ?

As for "why" to have them, well there isn't a good reason intrinsically -- if there were a way to magically convert the US to metric overnight, it wouldn't bother me. It just seems very unlikely and difficult in a country as huge and culturally diverse in the US. Especially since, by the standards of the rich/developed world, the US is pretty poorly educated, and also very difficult to govern (Obamacare, a law that would have seemed like a moderate reform, relatively simple to pass in any parliamentary system, is the most radical change in any area of policy enacted by the US federal congress in the last decade).

The thing a lot of people miss about the ultra-gridlocked US system is that there's a huge gulf between it being obvious to most people that "we should enact some policy" and anything actually changing. The best answer to "why doesn't the US do this or that" is often just "its political institutions can't".

Since it's so unlikely to change, and given my argument that it isn't a big deal in practice, I guess my main point is that we rationally-minded people should stop worrying/complaining about it so much.


> A good comparison is degrees Celsius, which are just as arbitrary/unscientific (the standard metric unit is the Kelvin).

Celsius is literally the same scale as Kelvin, just shifted so that 0c = water freezing.


Yes, and water freezing is a totally arbitrary value.

Fahrenheit is scaled such that 0 is about the coldest it gets where I live, and 100 is about the hottest. (Very approximately, but close enough). That strikes me as a lot nicer in practice (since 99% of the time people are talking about temperature, it’s related to weather) than something based on the physical properties of a particular substance.

Also water freezing at 0 and boiling at 100 is only valid for a specific, non-metric, air pressure.


Celsius is a particularly bad metric unit. It doesn't have enough units in the range most commonly encountered by humans, and it goes negative, which is also to be avoided in a good unit.

So you end up needing negatives, and decimals.


I've actually become quite fond of liquids being powers of 2 and lengths being broken fractionally. The base unit doesn't really matter (and you can always use decimal length, as is often done when building precision items).

So, for liquids,

2 tablespoon = 1 ounce 2 ounce = 1 jack 2 jack = 1 gill 2 gills = 1 cup 2 cup = 1 pint 2 pint = 1 quart 2 quart = 1 pottle ( ½ gallon) 2 pottle = 1 gallon

I find it much easier to switch units and do conversions in my head, especially when scaling recipes.

With respect to base-2 fractional length measurements, I just find it much easier to work with fractions than than with decimals. Half of ⅛ is ¹/₁₆ with next to no thought. I don't need to do division of 25 to get 12.5. It's a personal thing, but I find it nice.


Fractions are nice when the numerator is always 1. They're a pain when it isn't; sorting drill bits or buying material from McMaster Carr, you constantly have to sort out whether 17/64 is larger or smaller than 3/8, and by how much, and it becomes quite burdensome.


It's not immediate like it would be with decimals, but ⅜ -> 6/16 -> 12/32 -> 24/64 is still something I find I can do (and track) in my head with ease. Yeah, doing it repeatedly on a task would get a little tiresome. Also, who knows where the numbered and lettered series drill bits fit in without a chart.

The fractional system isn't perfect for all use cases by any means. (My understanding is that a lot of machining just deals with decimal inches directly.) I just find it convenient for many everyday tasks. I'm also weird, I guess, in that arithmetic on fractions feels easier than on decimals.

Thinking more about my original statement, a lot of it has to do with halving (e.g. finding a center) being a common operation for many tasks. It also helps that most things are sold in those fractional increments too :)


> is that apparently the metric system was opposed in the US based on religious reasons.

As you will discover people often use religion as an excuse for things they anyway want to do. Usually they are people who only pay lip service to their religion.

Someone didn't want to use Metric. Religion doesn't actually have anything to do with it.

> That is mind-boggling.

It shouldn't be. I assume you are surprised that religion is involved in this, but actually it is not. If they were Atheist they would have the same objection, just using different words.

Basically you need to distinguish between people being people, and people acting in a certain way because of religion. This is an example of the former.


Well, you can’t suddenly replace the quarterpounder with cheese with a royale with cheese.


You would replace quarterpounder by hectogrammer. A quarter of pound is approximately a hectogram anyway.


> Hey can you give what is the rationale behind the JS hate?

JS has its overhead in terms of data and, more severly, performance. Many people tend to put unecessary JS stuff like custom scrolling, needless animations and needless interactivity, etc. This stuff more often than not just ends up getting in the way of normal browser function and is of questionable benefit or none at all.

> I am building a website that relies heavily on JS. What should I be aware to steer away from the JS hate?

Don't add any JS interactivity that only makes a website "look cooler"* and that's not actually critical to your website's functioning. For example, stuff like google maps needs javascript. Stuff like blog most likely doesn't.

Remember to try out how your website works on a device with weak hardware and slow connection. This will not only make it far more accessible for people with older hardware, it will make better for recent hardware as well.

*) today's expression would probably be "rich user experince" or somesuch, but the meaning is the same - it's just vanity


Thanks for the detailed answer. This makes much more sense.

I am building a web based chat bot, so it is essential as without animation, it kind of look bland and uninteresting. Although, I will try to check in weak hardware and slow connection. Although not IE previous versions though.


> It's always been surprising to me that their isn't a built in "undo" to `rm`

Have a look at either the `trash-cli` package by Andrea Francia.


> But people need to feel productive quickly with a language, otherwise they'll drop it and move to something else which makes them feel that way.

Yes, I agree, but that's not the full picture. People want a language in which they can be productive quickly, but once they master it, they, or at least some of them, will then look into quality and performance. Languages like JavaScript or Python (and even Go to some extent) are popular and easy to pick up, but there's not much room for further progress. JavaScript is already stretched to its absolute limits when it comes to performance and it's still not performing very well. And when it comes to quality, well, TypeScript is a thing for a reason.

I don't believe Rust will ever be as much of a language for the masses as JS, but it has a good chance to become a niche language for those who need or want more performance and/or quality than they can get with langs like JS or Python.


> In Rust, if I want to write a similar thing, a HPACK decoder that returns both `io::Error` and `HPACK::DecodeError` for example, I need come up with another `Result` type that wraps both errors. This can sometime be tiring and makes the code inflexible (As one simple change to the `Result` may effect the entire call chain up and down).

Well there's stuff like error-chain to take care of the boilerplate...

Also, I believe you could define the equivalent of Go error in Rust as a trait and box it (ie. a trait object). It could be used much the same way as in Go with the additional benefit of Result being a sum type. I'm personally not a big fan of this approach but I guess it might work...


> you could define the equivalent of Go error in Rust as a trait and box it (ie. a trait object).

I know this basically how Go's error handling works (Put error data on heap and pass the reference), but I'm not fan of it (the put data on heap part of it) too :(

I will try out the error-chain, thank you for reminding me that.


The “failure” crate is an alternative to error-chain as well.


> This attitude is fine for personal projects, but it does not scale when working with other people.

True, but the same is true of Go, which may be surprising to people. Despite its claims, Go didn't solve this problem.

One reason is that larger projects typically start to invent their own abstractions on top of the base language and Go is no exception here, in fact, what with its lack of some common abstractions, built-in support for code generation, frequent use of external add-ons (like go vet etc.), Go very much encourages this. And so you're going to have to learn specifics of larger projects just like with "complex" languages. The solution to this problem is meticulous and somewhat restricted code style standard, but that's a solution that works with "complex" languages just as well, in fact, I'd argue that even better.

The other reason is that the Go language is not just the Go language. That is, what with the lack of abstractions for error handling, code re-use, etc., people end up following a bunch of conventions, styles, patterns and using external tools (like the already mentioned go vet). And so in effect the language becomes "the base" + "lore". This is of course true of any language. With Go and early Java, for example, this becomes more pronounced, since the base part is very small, larger parts need to be taken care of by the "lore". This is why Design Patterns become so popular in the Java world. And this why it's not good to have the base part too small, which is the problem of Go. Of course, the other extreme is equally bad - that is, when the base part is too large, which is the problem of C++, where now "lore" has to take care of deprecating/removing language features.

I feel like the authors of Go decided to do the opposite of what C++ does and thought that since C++ is horrendous, doing the opposite would yield a great result. But unfortunatelly that's not the way things work. You can't just negate someone's bad approach and expect great results.


This is the n-th time I'm reading a suggestion to help Venezuela using Bitcoin/cryptocurrencies. I wonder whoever came up with this and whether there's any save reasoning behind it or if it's just a cryptonerd fantasy. Venezuela has a very low average internet connection speed, reportedly one of the lowest in the world. Sources I've found say it's no better than 2 Mbit/s. On that speed, downloading the current Bitcoin blockchain would take about 18 days.

With such an internet infrastracture, is the country even capable of maintaining an up-to-date connection to the bitcoin network?


The full bitcoin blockchain from Satoshi's first transaction is huge, but that's for a "full node". A "lightweight node" needs much less https://en.bitcoin.it/wiki/Lightweight_node . The amount of internet connection needed is fairly minimal.

Ecuador moved to the US dollar in 2000 because their handling of their own currency wasn't working (and maybe because oil is often traded in USD?). Whether Venezuela uses BTC or some other currency sounds like a good idea at this point. The corrupt actors in their monetary system probably want people to keep using their bolivar though, because that's what the corrupt people stole, are holding, and printing.


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: