5 ms·
I think implicit conversions is the other billion dollar mistake in computing. It just shows up as a subtle source of mistakes in so many places. JavaScript, My
by ulrikrasmussen 3y ago
I think implicit conversions is the other billion dollar mistake in computing. It just shows up as a subtle source of mistakes in so many places. JavaScript, MySQL, YAML, Excel, PHP, just to make a few off the top of my head, have all caused countless bugs and security exploits due to implicit conversations of data which can be interpreted in multiple ways, and where the system happened to pick the wrong one.
- atoav 3y agoYou can do implicit conversion. In system tou build for yourself and where you are the source of the known input data. Excel is the polar opposite of that.
- lmm 3y agonull is really another special case of the same problem - allowing a nullable type to be implicitly coerced to a nullable one, or rather a general lack of type safety.
- tyleo 3y agoI was also just thinking this… but really only realized it reading the grand-post. Probably the general rule is simply, “you get more bugs when expectations don’t match reality”. Example: 1. (null) This value can’t be null 2. (article) This value won’t be converted into a date 3. (misc) This API can be called frequently
- lmm 3y ago> Probably the general rule is simply, “you get more bugs when expectations don’t match reality”. That's too vague to be useful. You might as well say "you get bugs when you write wrong code". Whereas framing it as a lack of type safety points towards an actionable solution.
- eyelidlessness 3y agoI think this is too strong a take. The general rule, as stated, can be useful as a way to think about systems, interfaces, architecture, etc in broad strokes as a vector for expectations which might fall victim to this pitfall. Being general, it isn’t prescriptive about the solution… but then, type safety isn’t always (and isn’t the only) solution. It’s a way to think about problems where you explicitly scrutinize the expectations they promote and their corresponding realities. You might arrive at type safety as a measure to align those, but you might also consider a variety of other concerns in the same thought process. It’s only unuseful if the problem you’re applying it to is itself vague, or if you’re unprepared to do the thinking involved in understanding a more specific problem and what expectations you’re addressing in solving it.
- hiddencost 3y agoA billion dollars isn't really that much money. You see billion dollar mistakes all the time at big companied
- throw_pm23 3y agoA billion here, a billion there, soon you are talking real money.
- makeitdouble 3y agoI think these are billion dollar mistakes only because they've allowed for trillions in improvements in the first place. People choose these system with loose conversions over and over again because it's an advantage up to a point. Of course it becomes a liability when expanded too much and used in now critical systems, but IMHO the tradeoff usually ends as a net positive. Which is why, over and over we build more of these systems, and they fare better in the market than the stricter ones.
- jjk166 3y ago> People choose these system with loose conversions over and over again because it's an advantage up to a point. The world is full of antipatterns that people implement with little, no, or flawed analysis. They do not fare better in the market, they propagate the same way entropy does.
- dacryn 3y agoit would be so easy to just implement an opt-out function, but Microsoft doesn't want to. There doesn't have to be a tradeoff if you make it optional.
- cedilla 3y agoAn opt-out doesn't solve the problem, because one person in the chain of custody if an excel file who hasn't opted out would be enough to destroy the data.
- acdha 3y agoOnly if the option was implemented as a user preference which isn’t stored in the file. The right way to do this would be to add the flag as a file header, and give people a UI control to set it by default. That way you’d always see spreadsheets as the person who gave it to you did, and you would create new ones with your preferred behavior.
- makeitdouble 3y ago
- Waterluvian 3y agoIt’s so awful in JavaScript that they made new comparison operators that don’t do it. And now it’s pretty much universal that you set == and != to be linting errors and just never use them. They’re good for professional and hobby code golf though.
- l72 3y agoExcept for when you to `var != null` to make sure var isn't null OR undefined since those are two different things in javascript and undefined will implicitly be converted to null here.
- shaan7 3y agoCall it cynicism but I think humans just prefer things to be implicit. I've been annoyed by how people do not want to be specific, but then rant about how someone did not understand exactly what they wanted. A certain CEO says that we won't need programming languages because you will be able to program AI systems with natural language. Well, the problem with natural language is not that we do not have the tech, it is that natural language is too imprecise. People will, again, end up being dissatisfied by the output of AI systems and blame it on the tech, while the problem just remains that as humans we kinda suck at being explicit about what we want.
- nbadg 3y agoThe thing is, most of the time, you can actually have both. You just have to spend the time to build systems that way. To use the example from the article: spreadsheets could use strongly-typed columns, but guess the column type automatically based on the values entered. When things go right, it'd be just as easy as today, but if things go wrong, you always have an escape hatch: with a little more work, you can manually specify the column type. Problem solved. That gives you the increased productivity you want for the happy case, without the frustration of trying to find a workaround for the corner case. This kind of approach needs more architecture work at the beginning of a project, but it's almost always feasible. That being said, I think your frustration is warranted, although I think it's much more pervasive than tech. At its core, I think the problem is that, in your example, the CEO and the programmer are having two different conversations without really realizing it. The CEO wants a problem solved, but the programmer wants the tools to solve the problem themselves. The CEO thinks that ML should be able to solve their problem, but the programmer sees that ML as a tool has serious limitations, and won't help solve under-specification. And then they both end up talking past each other. It seems that a lot of (at least western society) is built around the idea that when someone asks for help, what they "really" want is, metaphorically, to be given a fish for dinner, instead of learning how to fish. That's the CEO in your example; the presumption is "I want help" means "solve my problem", not "make it easy for me to solve my problem myself". It's one of my biggest frustrations, because it inherently robs you of agency and in many cases can be downright condescending -- for example, when I was working as a mechanical engineer, there were shop floor guys ignoring the tolerances I specified on my drawings because they assumed I was over-specifying them, because they lacked the context of the rest of the design, and weren't willing to sit down to hear the bigger picture. But when I had to send the parts back for re-work, they acted like it was my fault. Anyways, this is all a really long-winded way of saying, I think this is largely a social problem, not a technological one. But I don't think it's inherent in humans; I think this is something we've learned as a part of our culture.
- tambourine_man 3y agoWhat's the first billion dollar mistake in computing?
- papichulo2023 3y agoFunny how you left out Java witch had the biggest fuck-up