A lot of things can be said about CL, but elegant is not one of them. Battle tested and practical, but also full of warts when you look under the shining armour.
> There's no portion of the code that does warmups.
This isn't true - Benchmark.js will repeatedly rerun benchmarks until it gathers statistically meaningful results.
> There's no portion of code that "blackholes" the results to keep the JIT from optimizing away the code under benchmark.
True, and there's actually nothing benchmark.js can do to ensure that doesn't happen in the general case but when this does happen the results are usually pretty obvious - we'd see billions of ops/sec. Incidentally the left-pad benchmarks do not suffer from this issue.
I think we should demand more. We are being presented science right? We should be able to recognise that this article and the videos, etc are just presenting a claim. They are not providing any evidence. This is just a story.
I'm saying, if someone writes an article and it is published, should we believe it?
You're saying that I should use tools to replicate the experiment. Great - this is what we should do before we accept something as true. Otherwise, we are in the realms of 'belief'.
So, do you believe this story? And did you do due diligence, and confirm with the tools that it is true? Or did you skip that bit and believe it despite the fact that NO evidence is presented at all? Be honest when you answer please!
Stepping back a bit, I'm not saying anything so drastic. I certainly don't see why I'm being downvoted. I'm really talking about applying the scientific method personally. I'm saying don't accept articles, videos by default, without even critically reading what is being presented. I really think its pretty obvious stuff, tbh!
This should be the answer, even if there is a more accepted term already in use. The etymology is undeniable and it very effectively describes the concept in question without it possibly making references to any other adjacent concepts.
Go's error handling really reminds me of errbacks in node (callback function with a possible error as first argument), with many of the same pitfalls. I wonder why so many people defend Go's choices here in comparison?
Go is aiming to be a slightly better C. If you look at it from a C programmer's perspective then Go streamlines the typical C control flow of error values by letting you return a value and an error code.
"errbacks" definitely have benefits since having the error parameter forces you to think "where should I handle this error". With exceptions, people often get sloppy and let them be thrown and handled wherever, often at the wrong place.
Now it does make code more verbose since 90% of the time, the answer to "where should I handle this error" is "not right here" and with go/errbacks, you have to be explicit in that case while it is the default for exceptions.
The benchmarks in that library are misleading - by wrapping the resolve in the promise example in a process.nextTick you're actually making the engine enqueue 2 microtasks, as promises are always guaranteed to be async. If you remove the process.nextTick the results are reversed, I get:
- 63ms (async)
- 100ms (casync)
so it's almost twice as slow as native async await in this example.
The main reason for this library has to do with simplification more than performance but just for the sake of argument, in my little benchmark, the point was to make the asynchronous operation identical in both tests. You can use promises without any asynchronous operation inside but what's the point? That's not how they're used most of the time. And sure promises may add a second microtask around the asynchronous code (casync does too in some cases) but that is to their detriment performance wise (and do promises really add a second microtask when the code inside is already asynchronous?).
Also note that async has the benefit of language level integration and optimization. It gets to use v8 c++ functions like "EnqueueMicrotask" instead of process.nextTick. If casync had access to all this, it would likely run even faster.
I agree with the article. First I had to get used to it, and now I like it. 1) It forces a programmer to think about all possible errors right when calling a method, and handle them, and 2) reading other people code is easier - I see right away which errors can happen exactly and how they were handled.
I code in Go about 50% of my time, while the other 50% is Python. There, the code looks more elegant at the first sight, and yes, is not so-called "polluted" with error handling, but it takes more time to understand what it precisely does in all possible cases. Overall, I really started to prefer the Go, more explicit, way.
This is pure fantasy, who would spend $250m to acquire a stolen painting that they cannot resell? If it really is rich people buying them the purchase price is going to be a fraction of a percent of the amount you're talking about.
When your net worth is in the hundreds of billions, you can spend a couple hundred million to impress your "friends," and many billionaires do. Yeah, it's disgusting, but that's only because the modern global economy allows such disgusting levels of wealth.
The number of people with net worth in the hundreds of billion right now is... 1. The second-richest person is Bill Gates, at only $96.5 billion. By #10, we're at $50 billion. Fewer than 200 people are worth $10 billion. Granted, this only includes people with known net worths, but by the time you're hitting tens of billions, it's hard to hide that much wealth.
It really makes a huge impact on this conversation to say "billions" and "2.5M" and "200k," so thanks for pointing all of this stuff out. Leave it to HN to get buried in a pedantic technicality that has no effect on the points being made.
The "modern global economy" allows it? I suggest you look up the wealth (adjusted for inflation) of many, many historical business and political figures. Extreme wealth for a few is nothing new and if anything modern global economics and markets have done a massive leveling up of standards of living for many more people who aren't incredibly rich.
That aside, how should something like your subjective notion of "disgusting" levels of wealth guide how much of what they earned people should be able to keep?
Seems like you took my statement "the modern global economy allows it," and inferred that I meant every system other than the modern one does not allow it. Of course not. Of course there are many systems that existed in the past that also allowed for gross levels of wealth disparity, but did I ever claim otherwise?
> massive leveling up of standards of living
For who? Impoverished workers in China and India? How have American labourers benefitted from globalism and Keynesian economics? They haven't, at least not in the last 50 years.
> That aside, how should something like your subjective notion of "disgusting" levels of wealth guide how much of what they earned people should be able to keep?
I think you're just pretending you're naive, but you can feel free to look up many of the proposed solutions. UBI, wealth tax, limits on how much money can be passed through inheritance, etc. There are many solutions that have been _proposed_, but the problem is that with massive wealth comes massive power, and the individuals who possess disgusting levels of wealth will never let these solutions come to be.
> what they earned
Jeff Bezos has not earned 100 billion dollars. You could probably convince me that he's earned at least 1 billion dollars, but there is absolutely no way one man can generate that much wealth in one lifetime. He has stolen his wealth through asymmetrical agreements with powerless individuals, who chose to work for him rather than starve due to a lack of accessible jobs.
We've created a system that makes individuals dependent on large corporations for healthcare and rent, and then we wonder why poor individuals can't start businesses or change jobs freely (hint hint, it's due to food security and access to healthcare). If I point a gun at you and take your money, I haven't earned anything, have I? But if I starve you out, and tell you you can't see a doctor, then I can rob you of the value of your ideas and labor. For some reason our system allows that.
Bezos got a $300k interest-free loan from his mother to start his business. Are you telling me he earned that? No, it was given to him by birthright, and it's a luxury the vast majority of people don't have.
Bezos did not earn 100 billion dollars, he stole it.
Bezos doesn’t even have $100B, so the premise of your argument is nonsense.
Owning shares of something isn’t the same as liquid cash. And valuing 1 share at the most recent market closing price the same as a founder liquidating their whole investment is also nonsense.
FYI, all those worlds richest lists are clickbait.
> Bezos doesn’t even have $100B, so the premise of your argument is nonsense.
Oh, so that's how you're going to handwave this argument today. Got it, I wouldn't have bothered writing all of that up if I knew you were just going to stick your head in the sand.
Here's what happens when your boy Bezos gets too much power:
There need to be more checks and balances on individuals who possess this much power, or they need not be allowed to attain so much power in the first place. Your technicalities do nothing to fix this problem which affect tens of thousands of workers in this country, who are being forced to expose themselves to a deadly virus (or go hungry) so Bezos can buy another mansion and bang some more models. But I don't care that much, I suppose. If it isn't done democratically it won't be long before heads are rolling.