Hacker Newsnew | past | comments | ask | show | jobs | submit | awkwardpotato's commentslogin

per Lorenzo Franceschi-Bicchierai

> In some cases, Patel appears to have sent emails from his former Justice Department email address in 2014 to his Gmail account. TechCrunch found that the emails sent from Patel’s DOJ account also appeared to be authentic.


What's the matter with this? It's a clean builder pattern, the response is returned directly from send. I've certainly seen uglier Java

Just my opinion of course, but:

> What's the matter with this?

To me what makes this very "Java" is the arguments being passed, and all the OOP stuff that isn't providing any benefit and isn't really modeling real-world-ish objects (which IMHO is where OOP shines). .version(Version.HTTP_1_1) and .followRedirects(Redirect.NORMAL) I can sort of accept, but it requires knowing what class and value to pass, which is lookups/documentation reference. These are spread out over a bunch of classes. But we start getting so "Java" with the next ones. .connectTimeout(Duration.ofSeconds(20)) (why can't I just pass 20 or 20_000 or something? Do we really need another class and method here?) .proxy(ProxySelector.of(new InetSocketAddress("proxy.example.com", 80))), geez that's complex. .authenticator(Authenticator.getDefault()), why not just pass bearer token or something? Now I have to look up this Authenticator class, initialize it, figure out where it's getting the credentials, how it's inserting them, how I put the credentials in the right place, etc. The important details are hidden/obscured behind needless abstraction layers IMHO.

I think Java is a good language, but most modern Java patterns can get ludicrous with the abstractions. When I was writing lots of Java, I was constantly setting up an ncat listener to hit so I could see what it's actually writing, and then have to hunt down where a certain thing is being done and figuring out the right way to get it to behave correctly. Contrast with a typical Typescript HTTP request and you can mostly tell just from reading the snippet what the actual HTTP request is going to look like.


> but it requires knowing what class and value to pass

Unless you use a text editor without any coding capabilities, your IDE should show you which values you can pass. The alternative is to have more methods, I guess?

> why can't I just pass 20 or 20_000 or something

20 what? Milliseconds? Seconds? Minutes? While I wouldn't write the full Duration.ofSeconds(20) (you can save the "Duration."), I don't understand how one could prefer a version that makes you guess the unit.

> proxy(ProxySelector.of(new InetSocketAddress("proxy.example.com", 80))), geez that's complex

Yes it is, can't add anything here. There's a tradeoff between "do the simple thing" and "make all things possible", and Java chooses the second here.

> .authenticator(Authenticator.getDefault()), why not just pass bearer token or something?

Because this Authenticator is meant for prompting a user interactively. I concur that this is very confusing, but if you want a Bearer token, just set the header.


Fair points.

> Unless you use a text editor without any coding capabilities, your IDE should show you which values you can pass. The alternative is to have more methods, I guess?

Fair enough, as much as I don't like it, in Java world it's safe to assume everyone is using an IDE. And when your language is (essentially) dependent on an IDE, this becomes a non-issue (actually I might argue it's even a nice feature since it's very type safe).

> 20 what? Milliseconds? Seconds? Minutes? While I wouldn't write the full Duration.ofSeconds(20) (you can save the "Duration."), I don't understand how one could prefer a version that makes you guess the unit.

I would assume milliseconds and would probably have it in the method name, like timeoutMs(...) or something. I will say it's very readable, but if I was writing it I'd find it annoying. But optimizing for readability is a reasonable decision, especially since 80% of coding is reading rather than writing (on average).


> why can't I just pass 20 or 20_000 or something? Do we really need another class and method here?

If you've ever dealt with time, you'll be grateful it's a duration and not some random int.


The boilerplate of not having sane defaults. .NET is much simpler:

    using HttpClient client = new();
    HttpResponseMessage response = await client.GetAsync("https://...");
    if (response.StatusCode is HttpStatusCode.OK)
    {
        string s = await response.Content.ReadAsStringAsync();
        // ...
    }

That's just an example. It does have defaults: https://docs.oracle.com/en/java/javase/11/docs/api/java.net.... (search for "If this method is not invoked")

Yeah, so much simpler,

"Common IHttpClientFactory usage issues"

https://learn.microsoft.com/en-us/dotnet/core/extensions/htt...

"Guidelines for using HttpClient"

https://learn.microsoft.com/en-us/dotnet/fundamentals/networ...

And this doesn't account for all gotchas as per .NET version, than only us old timers remember to cross check.


I didn't mention IHttpClientFactory - just HttpClient. I will concede that ASP manages to be confusing quite often. As for the latter, guidelines are not requirements anymore than "RTFM" is; You can use HttpClient without reading the guidelines and be just fine.

For various outcomes of fine, depending on .NET version, given that not everyone is on very latest.

Yeah this is all over Rust codebases too for good reason. The argument is that default params obfuscate behaviour and passing in a struct (in Rust) with defaults kneecaps your ability to validate parameters at compile time.

It does have defaults, the above example manually sets everything to show people reading the docs what that looks like.

> What's the matter with this? It's a clean builder pattern

I feel like you answered yourself. Java makes you do this by not supporting proper keyword arguments.


Standard appeal to accomplishment, past success does not guarantee future success... especially on this joke comment


> Why would you want an iPad?

At this point, there are more people taking notes on an iPad + Apple Pencil than on physical notebooks in my lectures


good info



FYI, powering off your iPhone does not prevent it from being tracked. It continues to broadcast a low-power Bluetooth signal other Apple devices will relay to iCloud.

"Participating in the Find My network lets you locate this iPhone even when it's offline, in power reserve mode, and after power off"

Settings > Apple Account > Find My > Find My iPhone


VR on Linux is probably going to be the main reason the Steam Frame is going to be a day one pre-order for me


Certainly mine!


Do you check these sources? I find Gemini and, especially, Google Search AI to regularly cite sources that does not say what it claims to says. For example, (not an actual example but along these lines), "Can Google Sheets do x feature" and it replies "Yup" and links to an Excel YouTube tutorial as its source


I ask ChatGPT and Grok questions about Latin and Greek all the time, and they'll brazenly invent sources, quoting them in Greek or Latin. As an example (an actual example), I asked ChatGPT to round up all the poetry that, like Catullus' sparrow and Statius' parrot, dealt with birds. It hallucinated a bird poem by Callimachus that it claimed was the prototype and gave me not only an English translation but a Greek original—that never existed. It just plain lied. I have zero faith in any fact about the ancient world that comes from an LLM.

On the other hand, LLMs do a great job translating between languages, which is probably why they can vibe code. They catch some grammar errors, too, although not all of them, and even some stylistic errors, so it's useful to run Greek compositions through them. Ask it about linguistic questions ("Which Greek verbs other than ἀφίημι violate Grassman's law?"), though, and it will spew a bunch of irrelevant examples that don't pertain, because it doesn't actually understand what it's doing, just predicting tokens.


What doesn’t help the community is that “hallucinate”, “cite sources” still doesn’t capture what the LLM is doing. LLMs were pre-trained to do one thing, trained to do another and maybe fine-tuned for yet another thing. Do they hallucinate? From our perspective they do because we know true and false but from the tool’s perspective, it’s “just interpolating the text crammed inside of it”.


I find the more helpful understanding boils down to "all responses from an LLM are a hallucination, some are useful"


The sources look good on the one I posted to me.


Carmack also used to have some really insightful articles on AltDevBlog. I recently read his one on functional programming and thought it was very well thought out.

This site had nice re-uploads for the some of the articles. You can maybe google around and find more

[0] http://sevangelatos.com/tag/john-carmack/


Intuit spent $3.8 million on lobbying against Direct File in 2023, HR Block another $3 million. In total, the tax prep industry has spent $93 million lobbying against the Free File program since 2003 (through 2023, couldn't find a more recent source).

https://www.opensecrets.org/news/2024/02/turbotax-maker-intu...


It's sad to see how little money needs to be spent to make the lives of millions of tax payers more miserable.


Just goes to show how cheap our politicians really are. In both heart and bank.


Not "our politicians", republicans

Democrats keep trying to make taxes in America better, including prominent democrats literally calling for the investigation of Intuit's bribery here.

Then people elect republicans.


Independent analysis of official state reports contradicts you. It’s easier to look at states than to analyze which federal rep submitted which amendment or rider

https://www.investors.com/politics/editorials/worst-run-stat...


That's $3 million of direct, fully disclosed funding. There are many other ways of bribing officials, and it gets easier every day.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: