8,634 karma · joined Jun 23, 2011 (15y ago) · 7,679 submissions
comment 3y ago · link · parent
Amazon does appear to be comparable to FedEx, UPS, etc. Fact of the matter is that driving is just plain dangerous. Trucking is indeed considered one of the most dangerous jobs in America, and I'm sure that surprises nobody.
So Sanders isn't exactly wrong to say so, but the presentation seems a little misleading or disingenuous. What should Amazon do with that wealth to make the roads safer, exactly? Transportation is under purview of the government.
comment 3y ago · link · parent
comment 3y ago · link · parent
I expect you won't see results on Google, save for when you explicitly ask for the site, because there isn't much in the way of reputation. You are highly unlikely to see my personal blog, which is just plain old boring as it gets HTML, come up in search results for the same reason.
comment 3y ago · link · parent
Yeah. Of all the comments I have made, I least expected it to be that one. As it was a complete Reddit ban, not just a subreddit ban, it is possible that it was just Huffman doing his usual round of trolling and not really about the comment at all. I had participated in a discussion about the API changes earlier the same day said comment was made, so I was "on the radar".
Either way it was pretty funny.
comment 3y ago · link · parent
If you need to draw lines between two things, 'script' and 'program' may be tools you can use to communicate that. Or maybe not. Indeed, there is a lot of guess work involved in communication, and it can take some trial and error to find the right tools to accurately reach the intended audience.
comment 3y ago · link · parent
I also made some silly quips about spez in the same timeframe. It is possible he was salty about it and arbitrarily chose a comment to reference in the banning, not being the true reason. It certainly would not be out of character.
comment 3y ago · link · parent
Does that meaningfully differ from "some laughs when you strike the ban hammer"? One may not physically laugh out loud, but no doubt the appeal of which you speak stems from pleasurable emotions that stem from the entertainment in experiencing those things.
It is understandable why some people would be drawn to those incentives, but I am not sure those incentives align with good faith participation. Power and influence is best experienced when used in bad faith. When only used in good faith, one will not even recognize that they have it.
In the old owner/operator forum days there were other incentives to be a good faith mod. Financial gain being one possible incentive. But in the case of Reddit, they take all of those parts for themselves, leaving just the scraps for any would-be mods. As such, the earlier "reddit has some of the worst mods I’ve ever seen in any capacity" assertion is not surprising. There is nothing to attract "good" mods.
comment 3y ago · link · parent
While that is a fair statement, I've been reading a lot of Typescript code lately and it seems in 99% of cases the selected solution is to use top level functions and globals to avoid the nesting hell class introduces, albeit introducing the global hell in the process. In practice, 'just use a class' doesn't overcome the human element.
Javascript was on the right track originally, but then veered off into the weeds for some reason. I appreciate you pointing out how it can be done. Although the solution is very much second class citizen, sadly. This certainly isn't going to wean developers away from global hell. Hopefully Javascript/Typescript can make some strides in improving this going forward.
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
No. The discussion opened to say that Result is better than the pattern used in Go. In other words, dependent state is better than independent state. I said that dependent state puts the producer in control, while independent state puts the consumer in control and that there are pluses and minuses to each approach, with neither being better, just different tradeoffs.
We continued to discuss that control and how Result, exceptions, and the (T, error) pattern play into that. Somewhere in the middle was a regularly scheduled Rust advertisement, but following that returned to the same topic. A topic that is not, and never has been, about type systems. And it isn't even about any particular programming language, even if Go was used to call out a pattern that the original commenter didn't have a better name for.
> If your producer does not match that, you are not forced by the language to use Result.
So, in other words: Dependent state puts the producer in control, while independent state puts the consumer in control and that there are pluses and minuses to each approach, with neither being better, just different tradeoffs...?
It is curious how the word Go causes minds to shut down.
comment 3y ago · link · parent
No. There is no discussion about type systems taking place here at all. The discussion is about patterns where the producer or the consumer is in control. Specifically, Result puts the producer in control. Idiomatic Go (T, error) sees the consumer in control.
There is likely no language in existence that prevents you from choosing. You can write code where the producer is in control in Go, and you can write code where the consumer is in control in every other. These are not features of a language, although language idioms do often push developers one way or the other.
comment 3y ago · link · parent
This is simply not true. Go preaches that values should always be useful. Given a return signature (T, error), the value of type T can be used irrespective of what is contained in the value of type error. They are independent states.
> The only difference is that Go provides a value for "file" when there is an error.
Yes, that is ultimately the difference. Result takes what are independent states and tries to make them dependent. Result<T, error> assumes that if there is a value of type error then the caller would not make use of the value of type T.
Often they will be dependent for all practical purposes. It is not an unreasonable assumption to assume that they are, especially if you know the caller. However, Go believes you cannot make that assumption. That you have to let the caller determine what it finds useful, not what you think it might find useful. Ease of code reusability is clearly a design goal of Go, so the idea that you can't get to know your callers and how they will use your function isn't unwarranted.
Tradeoffs, as always.
comment 3y ago · link · parent
But doesn't know how the return values will be used by the caller. What is perhaps lost in this is where Go says that values should always be useful?
> If you have a function that can return both an object and an error, there still should be a way to represent that (exactly the current way).
Exactly the current way is what is said to be deficient, though. A function of this type is naturally going to return a file every time because a file is always useful, even when there is failure. Whereas Result assumes that you won't find the file useful when there is failure.
If you know the callers you can discuss if the file will ever be useful to the callers who use it under failure condition. Always useful does not mean always used. But Go, no doubt of a product of Google's organizational structure, believes that you cannot get to know your callers. You have to give them what you've got and let them decide what and what isn't important to their specific needs.
Tradeoffs, as always.
comment 3y ago · link · parent
By day I work with a team in a language that sees errors ride on the exception handling system. Staying within the original example, I see code like this all the time (too often, even, but that's another topic for another day):
try {
file = getFile()
} catch(/* ... */) {
fileUnavailable()
}
Here, the assumption of getFile that the caller wanted an error was incorrect. A Result-using language would end up in a similar place.Idiomatic Go says leave it to the caller. Like above, when only wants to know if there is "file or no file" without concern for why there is no file, then:
file, _ := getFile() // The second return argument is an error.
if file == nil {
fileUnavailable()
}
I doubt either way makes much difference in this contrived example, but the difference shows up when it extends out into real code. There are plusses and minuses to each way of seeing the world. Tradeoffs, as always.comment 3y ago · link · parent
I can't help but feel there is an even greater generalization here. The error problem you speak of actually applies to every type. To zoom in on errors alone may be missing the forest for the trees. It seems what is special is the need to handle values returned by a function, which includes, but is not limited to, error values. It is something 100% of Go users will have to do almost every time they call a function. Even those which do not return errors.
> Swift and Rust have a perfect error handling mechanism.
Within their respective languages they may be a good fit, but those languages are producer centric. Go is consumer centric. That leaves an impedance mismatch. I do think there is something better out there for Go, but I'm not sure that is where we are going to find it.
comment 3y ago · link · parent
As with everything, there is a time and a place, but if you understand the tradeoffs to recognize that time and place you won't be soliciting random advice from the internet, and thus won't hear the 'good'.
I get the impression that the JavaScript world largely doesn't care much for testing, though.
comment 3y ago · link · parent
It appears all this does is avoids needing to manually call close (or equivalent)? While that is a nice addition, helping to avoid the situation where you forget, why does globals become the alternative? Isn't simply calling close manually the best option at the moment?
comment 3y ago · link · parent
Not really. The canonical example of tech that does benefit from the network effect is the telephone. The more people on the telephone network, the more useful it becomes. A phone network that silently replaces each node with LLM agents would soon become apparent as when you catch up with the people you thought you were calling in the flesh, discrepancies will start to emerge.
But Reddit (and HN for that matter) tries to hide the existence of people. While I assume you are human, I don't really know. I don't know your name. I don't know what you look like. I don't know where you live. I know nothing. And, frankly, I don't need to because you are not part of the experience. That you are (probably) human is just an implementation detail. Whether you are human or an LLM is completely immaterial. What human participation there might be when using a forum is done so in solitude. It is not a social experience.