Better HN
topnewbestaskshowjobs
Log inSign up

randomdata

8,634 karma · joined Jun 23, 2011 (15y ago) · 7,679 submissions

Submissions

comment 2y ago · link · parent

If you are referring to test coverage, the standard Go toolchain includes that out of the box.

But in this case you don't need to know about what paths have been executed. It will be obvious that an error path was not handled when your program does not adhere to function that is documented.

comment 2y ago · link · parent

> Roads lead back to SQL because it became a de facto industry standard for "relation-like" stuff.

But what was in question is why SQL is the standard. Did it take that position because of its deviation? If so, that would suggest the theory doesn't just work. Without actually profiling, I suspect that the deviation allows some real-world optimizations to take place, enabling SQL databases to be faster than something with strict adherence to the theory. That would be a good reason why you might have to choose SQL over a strict alternative.

> Can you give an example of a query that cannot be expressed well in relational algebra

Seems not. CloudFlare blocked the submission, complaining that I was submitting a SQL query, which it thinks is a security concern for some reason...

In lieu, just think about what a relation is and how SQL is not relational. Even some of the simplest select queries you can imagine can demonstrate your request.

comment 2y ago · link · parent

> People call it a toy database.

Stands to reason. It is something you want to play with, not a figurine to leave on the shelf to forget about like some of those other database solutions.

comment 2y ago · link · parent

I don't follow. Errors are part of your functional specification. Not even a complete type system can avoid you needing to write tests to document the error conditions. We are not talking about writing tests to stand in where an incomplete type system may be lacking.

Assuming you don't hate other developers, and given the tests you would write in any language, how do you foresee missing an error branch? Again, not specifically trying to test for something that a sufficiently advanced type system would catch, just your regular level documenting that demonstrates to other developers that you don't hate them.

> then you can just as easily forget to add a proper test for that error condition

If an error condition is easily forgotten in the documentation, then who cares about the implementation thereof? It is obviously not important. In fact, it is arguable that your program is incorrect if you do handle the condition in such a case.

comment 2y ago · link · parent

> in the wild, a LOT of code has the archetypical 3 lines: if err != nil { return err }

The data collected during the "try" proposal evaluation told that is not true. It was occasionally found, but not all that commonly. Maybe there is "a LOT" if you are counting comments with made up example code on HN? But as far as actual codebases that are compiled and run go...

There is also a concern, if included just because, that it would encourage developers to start using `return err` where they shouldn't. Which, as you know, would lead to the errors becoming unusable.

> If more processing is needed

How about some concrete examples and how you see them being formatted? You might have a good idea here, but it's not clear what it would look like in something real.

> or just revert to the normal if syntax.

If it is only useful for `return err`, why bother? That would be like adding special loop syntax that is only for counting from 0-9. Yeah, maybe once in a blue moon you really will count from 0-9 and it'll be cool on that day, but in reality it's not general enough to warrant inclusion in a language.

That said, I do like that your idea does not need to be limited to errors. A lot of error-related ideas are quite flawed in that they only work for errors. In reality, all of the problems with errors in Go are also problems for every other type. The right solution to improve upon those problems will equally solve for email addresses and birthdays.

comment 2y ago · link · parent

In my experience, the roads lead back to SQL. It deviates from the relational model. It may even be that SQL was successful because it deviated from the relational model. Perhaps the theory doesn't just work?

comment 2y ago · link · parent

Yes. In fact, I am continually confused by how as soon as developers see the word "error" they forget how to write software. They can be perfectly competent developers when handling any other type, but as soon as "error" shows up on the screen all bets are off. It is bizarre.

Developers as a rule also seem to act strange if you suggest that they made an error. Perhaps the word "error" is triggering in some deep-seated emotional way? I wonder if, in software, we called errors "pineapples" instead if it would avoid triggering such emotions, allowing one to reason about errors in the same rational way they do all other values?

comment 2y ago · link · parent

Obviously in real code you need to return a new error each time, not simply pass on the error you received. In actual usage, it seems that one line is going to become painfully long, or span multiple lines in some way. Do you still think that is an improvement once you move past this contrived example?

comment 2y ago · link · parent

Propagation suffers from the leaking problem. Rust has solutions for that, but it's not clear how that translates to Go, hence why the "try" proposal failed. I'm sure there is some solution out there, but nobody has come up with a good one. It turns out if nobody does the work, the work doesn't get done.

Again, needing to be explicit about your intent to do anything with an error is faulty. The values are not dependent. Just because some languages have gotten it wrong doesn't mean they all should.

comment 2y ago · link · parent

At very least, unless you hate other developers for some reason, you need to document in your test suite what errors are returned.

How, exactly, are going to forget a necessary `if err != nil` without your test suite blowing up?

If you do hate other developers for some reason, why not leave out some `err != nil`s to really drive home your hatred towards them?

comment 2y ago · link · parent

The original comment questioned why the person in the article would be concerned about an employee receiving an email containing a request for a date. The answer is that they would have concerns because the worker is on the clock and it is costing them money to have their employee spend time dealing with the request (even if ultimately ignored).

Somehow that turned into my objection, which was illogical. It didn't make sense then and it makes even less sense that it keeps coming up. It has no relevance to the thread... or life in general.

comment 2y ago · link · parent

Not true. As zero values are to be useful, one should never have to observe the error state unless the error is significant to the caller for some reason. Sometimes the error is significant. Sometimes it isn't. That depends on what the caller's needs are. Summing the error makes assumptions about the caller that may or may not be true. That is a bad API design.

comment 2y ago · link · parent

While sum types would be a welcome addition in general, summing an error is logically erroneous. It is an independent state.

The question mark is interesting, but as the try proposal discovered, how do you solve the leaking problem? That doesn't have a good solution yet.

comment 2y ago · link · parent

That’s nice, but what does it have to do with the discussion?

comment 2y ago · link · parent

Sure. Is there pertinence to the question?

comment 2y ago · link · parent

> If I understand you correctly, your objection to asking people out at work is that it wastes company time?

No. Why would I have any feelings towards what other people do? That doesn't make any sense.

The quote is written from an economic perspective. If 'Emily' were real and a random person the author had never met, there would be no concern or attempt to stand in. Allison is concerned because they would have 'Emily' on the clock. It impacts Allison directly.

The cost in the case in the bot, despite being the exact same act, is so small it is immeasurable. As such, we get a 'funny anecdote' instead.

comment 2y ago · link · parent

Competition strategy. The more people you can convince that they shouldn't hit on women means fewer people hitting on women, which improves the chances for those who hit on women.

Same reason 'slut shaming' is a thing, which is the same thing, just from the other point of view. The more people you can convince to not accept the advances of others means more opportunity for those who do.

comment 2y ago · link · parent

> But I don't see it as morally repugnant.

It is not seen as morally repugnant, it is seen as economically repugnant. If you were the server admin for a business and an old lady came in off the street asking if you would help her fix her computer, it is likely your boss would step in to put a stop to that too. The employer doesn't want to pay you to do things for other people.

If the old lady came to your house instead, nobody would give a rat's ass. Likewise, if 'Emily' were a real assistant and people were asking her out on dates using her personal email address, that'd be her problem. But when someone is paying you for your undivided attention...

comment 2y ago · link · parent

Well, who could stand to with all those people out there constantly asking you for things?

comment 2y ago · link · parent

Nothing, really. The application not having an in-process web server, à la CGI, is what 'serverless' refers to.

Although CGI is a defined protocol. Serverless is a more broad term, not limited to any particular protocol.

comment 2y ago · link · parent

If you avoid writing the simple server you can assert your familiarity with serverless on your resume.

comment 2y ago · link · parent

> It's like, a fundamental misunderstanding of how power dynamics work

The misunderstanding is yours. Workers understand what you say just fine, but don't care about out-negotiating the company. They will never meet the CEO at the bar, so it means nothing to them. They want to be able to out-negotiate their neighbour so they can peacock dominance over someone they actually interact with.

The purpose of a union is to establish a brotherhood between metaphorical neighbours so that they don't try to be assholes towards each other. While that does, indeed, improve the overall worker position against the company, it hinders the power dynamic between them. And that's where you find the pushback.

It's much like you find in 'middle-class' neighbourhoods where you see households trying to outdo each either with nicer yards, or fancier BMWs, or whatever, all while racking up crazy debt to pay for it all. If they invested the money they pour into that stuff instead they would be way better off, but being better off isn't the motivation.

comment 2y ago · link · parent

> Do people forget that a 40 hour work week exists because of unions?

Is it still forgetting if it never happened? Both the idea of the 8-hour work day and weekends predate the first recognized union. The 40-hour workweek became the norm during the Great Depression by way of government initiative in an attempt to spread the work out across more people.

Unions have long supported the 40-hour work week, but are not meaningfully responsible for it. If showing support for something is necessary for something to exist, then you could probably say that just about everything exists because of unions...

Even still, we're talking nearly 100 (when it became common) to well over 200 years ago (when it was conceived). Even if unions actually were responsible, people are going to naturally ask "What have you done for me lately?". Where is the 10-hour workweek?

comment 2y ago · link · parent

Funny thing is that restaurant patronage has declined considerably in Canada in the past year or so. Even with many restaurants now operating at a loss (i.e. paying you to eat) to try and win back customers, they are failing to capture hearts and minds.

If people aren't eating at restaurants, it is almost certain they are getting their food at the grocery store instead. For all the mockery of Galen, it seems the marketing strategy has been unbelievably successful.

That's probably why he continued to cast himself even as the audience focus shifted to millennials and gen-z. Letting someone laughing at you for a few minutes is no big deal. Watching them love you when they show up at your store over and over makes it all worthwhile, I'm sure.

comment 2y ago · link · parent

Why's that? He has been doing the commercials for around a couple of decades, staring long before he was the one doing the casting. Even after taking that role in 2016, the previous commenter points out that the commercials continued to be well received until well into the 2020s. It was a successful formula for a long time.

Indeed, positive audience sentiment has an expiration date. He rode the wave too long, perhaps, but it is hard to know when to stop. All ongoing media productions (e.g. TV shows) suffer from the same problem and question of when to keep going and when to move on.

comment 2y ago · link · parent

> OK, well thanks for the confirmation.

Glad we both recognize that short stories are effectively worthless. Even the most recognized short story I know of sold for, according to your figures, basically nothing. Why are we trying to keep that under a super important lock and key again?

> Hey! Me too! We do have something in common after all!!

I know. You already told us in the previous comment that you were amused by it. Thanks for telling us again, I guess.

comment 2y ago · link · parent

> the U.S model of copyright is not the only one in the world and many other places do not believe the purpose of copyright is to foster human progress.

In democratic places, copyright is extended for the benefit of the population at large. That does not necessarily mean fostering human progress, but it does mean something that benefits the population as a whole. Copyright can be taken away if the people at large don't see some kind benefit.

> I'm thinking you probably don't know anything about the pricing of short stories?

If exchanged for $1 per copy, you have a theoretical ~$8 billion dollar market. $65k is chump change in comparison. Hell, make it 1¢ – that's still $80 million. If you have not captured anywhere close to those numbers, you have either failed to do your work justice in distribution or it is actually worthless. Either way, in that state what is the benefit to you holding it back?

> Let's say you sell to the New Yorker http://quick-brown-fox-canada.blogspot.com/2015/02/the-new-y... so you earn about 7,500 for the short story.

But in that case you can sell the copyright, so they would inherit the copyright cost. Whether or not they see $65k worth of copyright value is up to them. It would no longer be your burden if you return to your minimum wage job after the sale.

> I really find it amusing that HN of all places really wants to limit how people can make money on what is an entrepreneurial activity

I find it amusing that someone, on HN of all places, falls down to basic logic. An idea posted on an internet forum does not imply one's wants or desires.

Moreover, for practical purposes, why would you even talk about what you actually want? The thing you have chosen as your want is where you will have already put in the most thought effort. What more are you going to learn once you have settled on something? The things you don't want are going to provide a much more interesting discussion and opportunities to learn.

comment 2y ago · link · parent

> OR the work is a short story in which case it will not ever earn anywhere near 65K unless movie rights to the short story are sold.

Right, so where's the social value in it? The work has proven to be of little value. What's in it for the people who extend copyright to keep giving it to you even though they don't really care for what you have to offer?

Moreover, while your entire story has proved a complete and utter failure, what if just one page of your story has tremendous value for the next author who knows how to add a more compelling page 2? Why do we want to hold back that human progress so you can sit on something that doesn't even make you any money?

1
767778
256