HNHacker News
TopNewBestAskShowJobs

randomdata

8,634 karma · joined June 23, 2011

submissionscomments
randomdata··on Rewrite it in Rails
What do you mean? The N+1 problem lies on the theoretically correct solution. That is using the database properly.

It is just not tenable where latency poses a practical constraint under an implementation that is not theoretically sound. There are plenty of hacks to work around it, though, so it is not really a problem in practice. To call those hacks to work around a system with shortcomings "using the database properly" is a bit of a stretch, though.

Just so we're clear, the use of JOIN, IN, etc. are not hacks in and of themselves. They serve a purpose even where latency doesn't exist. But when applied to solving the N+1 problem, their use is a hack. Again, one that gets the job done and solves the problem – hacks aren't bad, but is not theoretically sound. If you did not have latency constraints to contend with, you would not prefer it.

The better question is: Why use a database that sucks? Latency periods are small enough in SQLite, for example, that you don't have to worry about the N+1 problem in any real-world situation. It doesn't have to be a problem in need of hacks.

randomdata··on Trump wins presidency for second time
> So, if you ignore what a word means, and redefine it, yes

Go on. What does the word mean?

It is oft associated with "member of the Communist Party", of which Harris clearly is not. Perhaps that is what you are thinking of? But that usage is like calling a member of the Democratic Party a liberal – something that is also often done. But to be a liberal does not automatically make you a member of the Democratic Party, even if members of the Democratic Party are often liberal.

> but that's neither the main goal, nor the means.

What is the main goal, then?

The means is undefined. Different communists have different ideas about how to achieve post-scarcity. The Communist Party has a particular stance about that, certainly, but as before, while members of the Communist Party may be communist, not all communists are members of the Communist Party.

randomdata··on Writing secure Go code
> Some errors should be ignored and some shouldn’t.

Assuming the function author followed Go conventions, you never need to consider the error for the sake of using the function. Granted, there are some bad developers out there who will do something strange that will come to bite you, but that is not limited to errors (or any particular language).

You may still need the error for your own application requirements, but application requirements are pretty hard to forget. At very least, you are going to notice that your application is missing a whole entire feature as soon as you start using it.

randomdata··on Only 5.3% of US welders are women. After years as a professor, I became one
I provably can. I just did it. You didn't think this through, did you?
randomdata··on Only 5.3% of US welders are women. After years as a professor, I became one
> I think in part it's with how women versus men are socialized here.

Indeed. Women are socialized to seek men of higher status as a partner. Thus men feel the need to seek higher status to become an attractive mate. And so men "infiltrate" any position that offers a chance at higher status (at least where high pay stands in as a proxy). Likewise, men are socialized to seek women with beauty rather than status, so there is little imperative for women to seek professions of status, but do benefit from careers that will preserve their beauty – so something like welding in a harsh environment that is hard on one's health is not a top choice.

That said, the social norms do seem to be changing. It appears the younger generations aren't coupling up so much anymore, and if that trend continues attracting a mate may no longer be a consideration.

randomdata··on Trump wins presidency for second time
Right, which is in line with the approximately one year lag I spoke of. Thanks for validating my earlier comment.
randomdata··on Former President Trump has won the presidency
> Uh. More like immediately people complained;

Did they? You seem to only be able to go back to 2021, whereas I was seeing substantial gains in the price of food I was selling on the farm as early as 2019, thanks to another devastating (albeit less so) crop failure.

It is not like the price was $x one day and then $x*2 the next. It ramped up over time. Just like the price of groceries did, albeit on a later timeline.

randomdata··on Trump wins presidency for second time
> If half of America has really been brainwashed into thinking Harris is a communist

Well, are they wrong? Once you get past the stupid rehtoric associated with the word, the goal of communists is to usher in an age of post-scarcity.

The United States is clearly leading that charge. Food production is the closest thing we have to post-scarcity, and that's almost entirely thanks to the efforts of US innovation. I even dare say that US innovation in general is doing more for bringing us closer to post-scarcity than anything else seen in the world. Harris seems/seemed on board to see that continue.

Trump may be too. He appears to also stand behind American innovation. Although, perhaps to the determinant of innovation elsewhere, which does set him apart from Harris, and, to be fair, you might argue that leaves him unaligned with the communist intention.

randomdata··on Former President Trump has won the presidency
When you consider the slow reaction of the economy, the money supply and inflation do track fairly well. It is not like if the money supply goes up today that inflation will also go up today. If the money supply goes up today, you wouldn't expect to see to see an inflation reaction for quite some time.

Hell, look at how long it took grocery stores to react to the aforementioned food crisis. Us on the farm saw the price of food we were selling double (or even more) from the price norm early in the crisis, but it took another year or so before the consumers of that food started complaining about how much grocery stores were charging. Things happen very slowly.

Indeed, the money supply has been stable for a while, only veering of track for a short time, but inflation is also now stabilizing and only veered off track for a short time.

randomdata··on Trump wins presidency for second time
> The current inflation isn't caused by money printing.

I'm not sure that is fair. Nothing is ever caused by just one thing, of course, but it is unlikely that money printed and given to average Joes was not a significant contributor. COVID relief saw money flow into the hands of regular people, which was quite unlike 2008.

2008 was different as it only went into the hands of the rich. You can print money endlessly and give it all to Jeff Bezos and inflation will never occur. It's just another number in his bank account, so to speak. But if you give it to poor people on the street, soon they are going to start buying things with it, increasing competition for goods and services and thus driving up prices.

Although I would say the biggest factor was the devastating crop failure in 2020 with a dash of COVID problems on top, followed by the EU shutting down their fertilizer plants in 2021, and then Russia invading Ukraine in 2022 which both complicated access to Ukraine food production as well as denying trade with Russian fertilizer. This left food stocks in a precarious situation and thus sent the price of food to the moon. Everyone else followed as best they could to ensure they could continue to eat. Now that we're getting our food house back in order, the inflation panic has started to subside in kind.

randomdata··on Trump wins presidency for second time
From my outsider (non-American) male perspective, I never heard anything from the Democrats. Somehow I ended up hearing a whole lot from the Republicans, without looking for it (or wanting it!). Whatever they did, they seemed to do a better job getting into the channels where men are found. So while I expect the Democrats haven't criticized men, I can understand how it is easy to buy into the rumours when that is all you have to go on.
randomdata··on Trump wins presidency for second time
Is the destruction a problem? When a viable third-party rises up, you will again return to a two party system, that is true. But it will be with the new party that you want, not the old party that wasn't cutting it.
randomdata··on Writing secure Go code
> my question is "why do you need to set up the third party linters when they're so critical to the correctness of your program" really.

No doubt the same reason it is also critical in Haskell (see comment about isLoggedIn function): Developers not knowing what they are doing.

If you work within the idioms and generally accepted programming practices this isn't a problem. It only becomes a problem when you get a developer who wants to "go their own way" without understanding why the norms exist. The linter is a crutch to support their "bad habits".

randomdata··on Why software only moves forward
The proper abstraction is that which can easily be thrown away. I've not found that to be too difficult to figure out. Maybe when I was new to development – that was too long ago to remember – but once you have experience, at least.

It can become extremely difficult to figure out if you mar yourself with someone else's framework. That is quite true. But is also what the parent said.

randomdata··on Writing secure Go code
> I don't know what the syntax should look like.

I'm not sure the syntax is all that significant. There have been numerous proposals, but the syntax was never the reason for rejection. It is that the entire concept is unusable in the state that it is understood.

That's not to say the problems can't be solved, but nobody has yet.

> It's very common to have a chain of these kinds of calls making up the body of a function.

Yes, like in Rust, for example. But it also has defined traits and other features on top of the chaining to deal with the same problems Go would suffer from it had such syntax. Theoretically Go could introduce the same, but it remains unclear how to do that in a way that makes sense in the Go language.

Again, there is probably a solution out there, but nobody has come up with it yet. Surprisingly, these kind of things aren't sent down from the heavens by a magical deity. It takes human effort, which isn't there because they are busy ranting on HN.

> It seems like "return err" is very useful for this pattern

Where would you find it useful (memes aside)?

randomdata··on Rewrite it in Rails
Now there is a familiar tune!

> Few people know Ruby and if you ask a company whether they want to hire PHP or Ruby guys, PHP wins because there's just more people who know it.

https://board.phpbuilder.com/d/10312349-php-frameworks-which... (First example I found, but was a common trope back in the early days of Rails)

randomdata··on Writing secure Go code
But isn't the idiomatic Go solution something like this?

    func checkPermissions(success func())
Like anything, you can still screw it up if you try hard enough, but it should nudge most in the right direction. The talk of error handling seems like a distraction or a case of someone confusingly trying to write code in another language using Go syntax.

Obviously you are not forced to think of the user when designing an API, but you don't have to be mindful of the user in any language. Not even Haskell can save a developer who doesn't care, as noted in an earlier comment.

randomdata··on New York Times Tech Guild goes on strike
> You have to go really high up the chain in those offshored manufacturing jobs before you see anyone actually interacting with an employee in the US.

And how are those not the same jobs...?

randomdata··on Rewrite it in Rails
Because of the high latency between messages? After all, eliminate the latency and the N+1 problem goes away.
randomdata··on Writing secure Go code
That's because nobody has yet solved the side effect problem of the sugar.

All the proposals that have ever been given have ultimately boiled down to essentially `return err`, which, while suitable for meme comments on an internet forum, cannot be used in a real production application for many obvious (and some not immediately obvious) reasons.

At least under the direction of rsc (the new leadership is still settling into the role so that is less clear), the will to add such sugar was there if a good solution was found. But the solution has yet to be found.

randomdata··on Writing secure Go code
> "I forgot to check the error code"

How is it that people "forget to check errors" but not other types, even though they are all just 1s and 0s? Or, to put it another way, why do programmers forget how to program as soon as they see the word "error"?

It seems to be a real phenomenon, but I can't make sense of how it can happen. It is not some subtle thing like misspelling a word in a string constant. You are leaving out entire functionality from your application. It is almost on the order of forgetting to add the main function.

randomdata··on New York Times Tech Guild goes on strike
> WFH is one more right in that list

Yet, strangely, your list doesn't contain any rights. Employers absolutely can ask you to work 80 hours per week / six days per week if they so choose (with assumptions about you being an average US resident; obviously jurisdictions can vary). You have the right to a higher rate of pay after a certain number of hours (with some exceptions) if you accept, but that's something quite different.

> WFH is one more right in that list

While rights can have exceptions, when those excepted are greater in numbers than than those eligible... Good luck! The right to higher pay if you work on location seems more politically tenable, but isn't that already priced in anyway?

randomdata··on New York Times Tech Guild goes on strike
We have a reliable way to do it: The same way the researchers did when they showed that performance is the most important factor for organizational success. If your knowledge workers measure the same way the workers did in that research, you're golden.

Unless you question the validity of the research? But if that's the case, why did you mention it as being significant in the first place?

randomdata··on New York Times Tech Guild goes on strike
> All companies are more powerful than individual workers

Nonsense. Maybe once a business reaches a certain level of power that becomes true, but as a small business owner, the individual workers who work for me have way more power than I do.

> Unions look out for workers. That's their priority. They should not cater to the business.

A worker union is just a collective of workers who have agreed to associate. It would be unusual for workers to look out for anything other than themselves (humans are selfish), but theoretically nothing says they can't cater to the business instead. It depends on what they want.

randomdata··on New York Times Tech Guild goes on strike
> There are already places with Internet access that can work for cheaper than people that live in the NY area.

Hell, even in the NY area. Median household in the Bronx is only $37,397, meaning that half of the households are living there for less than that. And that's household income, which is usually about 1.5-2x above individual income. That's a huge margin against what these workers are being paid.

But people don't sell things based on cost. Hell, a lot of people lose money when they sell things. Around 10% of the US population have a negative income in a given year! People instead charge as much as they can (or think they can, at least) get.

And anyone who is worth hiring offshore can get just as much as a local (within some reasonable margin; there can be frictional costs to offshore hiring that won't change the cost to the employer, but will reduce what makes it to the worker). You can sometimes get lucky and hire someone who doesn't understand their worth, both locally and offshore, but you can't count on that (and they aren't apt to stick around for long once they realize their worth). On balance, it costs the same no matter where you go.

randomdata··on Rewrite it in Rails
Does anything need to remain? That is where my confusion lies.
randomdata··on New York Times Tech Guild goes on strike
> you bear the consequences if the risk doesn't pan out your way.

Okay, but that's what they are doing. They can't work there anymore under the current situation, so they have accepted that their risk didn't bear fruit and are now no longer working for the NYT. Consequences bore.

They have graciously extended an opportunity to the NYT for it to reconsider the current state before the workers walk away for good. Accepting risk doesn't mean you can't still be cordial. At this point they are still willing to go back if the conditions allow them to. But if the NYT in the end says "no, we don't need you anymore, it is time for us to close up shop", so be it.

randomdata··on Rewrite it in Rails
> I stand by my comment that AR is a big part of why Rails is such a massive success.

I think most would agree. It is the "doesn't make much sense" part that we're discussing, though. How does it not make sense when you seem to have the same opinion of it? It seems, as an onlooker, that it makes perfect sense to you.

randomdata··on New York Times Tech Guild goes on strike
> Other researchers have also discovered that the performance of an individual knowledge worker is the most important factor for organisational success...

Great, which means we have a way to measure individual performance with respect to what matters (organizational success). So what's the problem?

randomdata··on Rewrite it in Rails
Wouldn't you say you are a bonafide activerecord hater because of those same issues? I don't expect you hate it because your lost love interest shares the AR initials.

ActiveRecord can both offer fast development and create issues (especially those that only come to bite you later). It exists in a multi-faceted environment. Tradeoffs, as always.

← PreviousPage 5 of 34Next →