HNHacker News
TopNewBestAskShowJobs

JamesBarney

11,106 karma · joined July 16, 2014

submissionscomments
JamesBarney··on How I write code using Cursor
I've spent soo much time in my life reviewing bad or mediocre code from mediocre devs and 95% of the time the code sonnet 3.5 generates is at least as correct and 99% of the time more legible than what a mediocre dev generates.

It's well commented, the naming is great it rarely tries to get overly clever, it usually does some amount of error handling, it'll at least try to read the documentation, it finds most of the edge cases.

That's a fair bit above a mediocre dev.

JamesBarney··on How I write code using Cursor
Google used to be better but so was stack overflow. Now a lot of the answers are out-dated. And even more importantly they got rid of any questions where the answer was even a little bit subjective. Unfortunately for users that's almost all the most useful answers.
JamesBarney··on How I write code using Cursor
I'm using an expansive definition of boiler plate to be sure. But like boiler plate most unit tests require a little bit of thought and then a good amount of typing, doing things like setting up the data to test, mocking up methods, writing out assertions to test all your edge cases.

I've found sonnet and o1 to be pretty good at this. Better than writing the actual code because while modifying a system requires a lot of context of the overall application and domain, unit testing a method usually doesn't.

JamesBarney··on How I write code using Cursor
I've spent a good amount of time in my career reading high quality code and slop. The difference is not some level of intelligence that sonnet does not possess. It's a well thought out design, good naming, and rigor. Sonnet is as good if not better than the average dev at most of this and with a some good prompting and a little editing can write code as good as most high quality open source projects.

Which is usually far higher than most commerical apps the vast majority of us devs work on.

JamesBarney··on How I write code using Cursor
Disagree.

I still spend a good amount of time on boilerplate. Stuff that's not thinking hard about the problem I'm trying to solve. Stuff like units tests, error logging, naming classes, methods and variables. Claude is really pretty good at this, not as good as the best code I've read in my career but definitely better than average.

When I review sonnets code the code is more likely to be correct than if I review my own. If I make a mistake I'll read what I intended to write, and not what I actually wrote. Where as when I review sonnets there's 2 passes so the chance an error slips through is smaller.

JamesBarney··on Shaken Baby Syndrome Has Been Discredited. Why Is Roberson Still on Death Row?
The title isn't clear but the article is.

Shaken baby syndrome has not been debunked but the forensic science that concluded that shaking a baby was the only/most likely cause of those symptoms is what changed. It's now known there are other possible causes for those symptoms and abuse is less likely than some of those other symptoms.

JamesBarney··on The Rise and Fall of IQ: The Cognitive Divide
Something called g. Which is basically rounds to our intuition of how smart you are. It is one the best predictors of job performance (up there with a work sample test), income, reaction time, how much schooling you'll get, how likely you are to commit crime, how long you'll live.

Imagine it like this, if we give someone a history test, a math test, a physics test, and english test. We'll notice how good you are at any given tests predicts how good you are at other tests. Even though math and history don't have any real overlap in terms of skills. They also found that doing well on some of these tests will better predict how well you'll do at others. For instance math and physics are typically more g-loaded so if someone does well on a math or physics test they are more likely to do well on an english test than the reverse. We call this quality of that predicts how well you're going to do at intellectual tasks g. And then we built a test to try to measure G and that's an IQ test, with IQ being the measurement of g.

JamesBarney··on The Rise and Fall of IQ: The Cognitive Divide
That's possible. I'd be surprised though if enough people were studying and practicing IQ tests to drive this difference. Practice has some benefits but are fairly limited for IQ tests. And I doubt a high enough portion of the population was practicing IQ tests regularly enough to move the needle this much.
JamesBarney··on The Rise and Fall of IQ: The Cognitive Divide
Isn't a good measurement by what measure?

There's been 1000's of studies on it. It might be one of the most robust findings in all of psychology and psychometrics (Big 5 is in the same ballpark). You can predict all sorts of things from it. If IQ is a bad measurement, than there are no good measurements in psychology.

JamesBarney··on Computer use, a new Claude 3.5 Sonnet, and Claude 3.5 Haiku
Sonnet is better for most things. But I do prefer Opus's writing style to Sonnet.
JamesBarney··on How long til we're all on Ozempic?
Yeah the problem with providing a study is that proving a negative is so hard. Everyone assumes there exists a successful RCT with a 5-10 year time horizon for weight loss via lifestyle interventions. And there just isn't one, and the only way to know that is to search for one.
JamesBarney··on How long til we're all on Ozempic?
Sure of the almost 8 billion people in the world there are plenty who have successfully lost and kept off weight.

But if you want to see if there is a reproduceable lifestyle intervention that treats obesity successfully in the long term you can look here. After a few hours of searching you will probably find the same thing I and almost all obesity researchers have concluded. There isn't one.

https://pubmed.ncbi.nlm.nih.gov/

JamesBarney··on How long til we're all on Ozempic?
Fighting the symptoms of what?

Taking ozempic will definitely keep people from gaining weight and will help them lose weight.

JamesBarney··on How long til we're all on Ozempic?
How much less likely do you think someone with high self control is to not be obese?

12%. Which shows that your intuitions about obesity and the causes are probably wrong.

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3717171/

JamesBarney··on How long til we're all on Ozempic?
> Right, so we doom some portion of the population to forever take a pill from big pharma? How is that acceptable with anyone

This is literally how almost all medicine works that treats a chronic condition.

> Perhaps Ozempic prescriptions should come with prescribed exercise with check-in and monitoring, or something.

Why?

JamesBarney··on How long til we're all on Ozempic?
> Why would you want to continue using a drug for the rest of your life?

It's better than being obese. This is true of most drugs for chronic conditions. very few of them are curative, almost all of them treat the condition.

> Longterm glp-1 agonist research doesn't agree with this.

Sorry I wasn't clear, I meant with continued treatment you don't rebound.

> Yes, a pill for this, a pill for that... and there's no chance we'll discover these drugs have negative effects when used by a person for 50 years.

They might have negative side effects but obesity has very large negative side effects. I would be incredibly surprised if any of these drugs that have been used in diabetes treatment for a long time have anywhere close to the negative side effects of obesity.

JamesBarney··on How long til we're all on Ozempic?
Sorry I meant with continued use of the treatment you don't regain the weight. I agree if you stop taking the medication your weight will rebound.
JamesBarney··on How long til we're all on Ozempic?
Set-point theory is pretty much settled medical fact. The mechanism involves leptin, and you can easily see processes that defend bodyweight change in both directions. Though it will more aggressively defend weight loss than weight gain.

In addition prey animals will defend against weight gain more aggressively than non-prey animals. Which makes sense from an evolutionary standpoint. If a lion gets fat he doesn't have nearly as much to worry about than if a gazelle gets fat.

JamesBarney··on How long til we're all on Ozempic?
> It's possible that after after a long enough time at a healthy weight your body's natural weight set-point will regulate itself back down. But this process take years.

I've spent a fair amount of time pursuing obesity research and I've never seen that. The closest I've seen is researchers or studies mentioning "Maybe the set-point resets are x years" but never seen any direct evidence of this.

JamesBarney··on How long til we're all on Ozempic?
Neurologically addiction works very differently than obesity and research says longterm sobriety is far easier to maintain than long term weight loss.
JamesBarney··on How long til we're all on Ozempic?
>If you do not change your lifestyle, for real and not just superficially, then you will relapse with a vengeance.

Longterm glp-1 agonist research doesn't agree with this.

> but you have to continue that lifestyle after stopping the drug.

Why stop the drug?

>Will Ozempic users have developed the personal discipline to prevent themselves from relapse without the drug - or will they forever be on a the yo-yo of weight gain/loss?

A small % of people are able to achieve significant weight loss with diet and exercise. And an even smaller % of that group are able to maintain it for the long term. We've been trying to solve obesity this way for a 50 years and have bubkis to show for it. If someone has high cholesterol we give them a statin, if they have high blood sugar we give them diabetes. Now if they're overweight we give them ozempic.

JamesBarney··on Research in psychology: are we learning anything?
Can you give some examples?
JamesBarney··on John Carmack on inlined code (2014)
My go to heuristic for how to break up code is white board or draw up in lucidchart your solution to explain it to another dev. If your methods don't match the whiteboard refactor.
JamesBarney··on AI won't replace human devs anytime soon
99% of coding is doing something that's been done a million times and gluing it together in a novel way.
JamesBarney··on Lead drinking-water pipes must be replaced nationwide, EPA says
Any source for this? Most of the research I've seen with regards to lead and IQ is correlational and could be confounded by intelligence being correlated with income which is associated with living in places with less lead exposure.

https://x.com/Noahpinion/status/1825584397363589312

Basically the IQ gap between the lead exposed and non exposed has stayed the same even though the amount of lead in the bloodstream has dropped by orders of magnitude. So either the first part of lead exposure is 100x more damaging then the 100th part of lead exposure (which animal models do not bear out) or a lot of the lead exposure IQ research is confounded.

JamesBarney··on End of the road for Google Drive in Transmit
> It raises the bar for low effort hackers and improves security.

There are meaningful ways you can improve the security of your app. There are ways to make sure your app passes CASA. I found very little if any overlap between those two when going through the process.

JamesBarney··on End of the road for Google Drive in Transmit
When we filled ours out for a CRM they wanted a video of the CRM. So we showed them a video (from dev with fake data). We appealed the process explaining that Mickey Mouse is a not a real person. They rejected that appeal. So after going back and forth for a week or two we uploaded a video with basically everything but the navmenu blurred out and they finally approved it.

The entire process was awful.

JamesBarney··on California first state to ban 'sell by' 'best before' label to reduce food waste
Food waste isn't a problem. If the US threw out 20% less food all the same countries would struggle with food security and hunger. If the US consumed less food, less would be grown. It wouldn't change the price of rice or wheat in India.

Almost all the food imported from the US to India for instance is consumed by the middle class such as tree nuts (almonds) and are not staple foods consumed by those struggling to eat. There isn't that much rice or wheat that's imported. In addition India has lots of tariffs to drive up the price of imported food from the US to protect local farmers. None of the cause of food insecurity is Susie throwing out a mayonnaise container that might be perfectly fine but past the best by date.

JamesBarney··on The profit-obsessed monster destroying American emergency rooms
In what sense does the Netherlands or Switzerland have public healthcare?
JamesBarney··on The profit-obsessed monster destroying American emergency rooms
Medicare for everyone fixes the under and uninsured problem. It doesn't fix the cost problem, only moves it from paying private insurance companies to the government. It's true Medicare pays less per procedure but that is not because those procedures are more efficient it's because relies on pricing power. Many hospitals would go out of business or have to layoff a significant amount of their staff if they were exclusively paid Medicare rates.
← PreviousPage 5 of 34Next →