frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

OpenAI pays $3.2M to settle claims it discriminated against US workers

https://www.theguardian.com/us-news/2026/aug/04/openai-worker-discrimination-claims-settlement
1•igortru•38s ago•0 comments

Draw.io MCP

https://github.com/jgraph/drawio-mcp
1•saikatsg•41s ago•0 comments

OpenAI and Anthropic models 'went rogue' during UK cybersecurity test

https://www.theguardian.com/technology/2026/aug/05/openai-anthropic-models-went-rogue-cybersecuri...
1•ablation•1m ago•0 comments

AI's Arctic Land Grab

https://www.arctictoday.com/ai-arctic-land-grab/
1•NishanStepak•2m ago•1 comments

Why smarter AI models could drive up compute prices 10x

https://www.dwarkesh.com/p/why-compute-might-get-10x-more-expensive-video
1•mefengl•3m ago•1 comments

Callosium, one shared memory for every AI, in plain Markdown files

https://github.com/callosium/callosium
1•amk96•5m ago•0 comments

Pentect: Let agents use secrets without seeing them

https://pentect.dev/start/what-is-pentect/
1•kozika•6m ago•0 comments

My thoughts on the foreign policy AI evaluation gap

https://www.karlsnotes.com/my-thoughts-on-the-foreign-policy-ai-evaluation-gap/
1•valkrieco•9m ago•0 comments

AI-generated stories rated better quality than human-written ones, study finds

https://www.theguardian.com/technology/2026/aug/05/ai-generated-stories-rated-better-quality-than...
2•amichail•10m ago•0 comments

Offline-First Data Architecture for a National Postal Service

https://necromant2005.github.io/dev/offline-first-data-architecture-for-a-national-postal-service/
1•rmykhajliw•12m ago•0 comments

Technology executives shouldn't give up control

https://kimchi.dev/blog/technology-executives-shouldnt-give-up-control
1•BlackPlot•13m ago•0 comments

Tech giant Palantir accused of 'agressive tax avoidance' at Europe's expense

https://www.ftm.eu/articles/us-tech-giant-palantir-tax-avoidance-europe
2•robtherobber•14m ago•0 comments

Four Days After a Pay Complaint, Cobot Fired Its Only Woman in Sales

https://runtimewire.com/article/exclusive-four-days-after-a-pay-complaint-cobot-fired-its-only-wo...
1•ryanmerket•17m ago•0 comments

An Exegesis of the Visionary Autobiography of a Fourteenth-Century French Monk

https://www.psupress.org/books/titles/978-0-271-06650-9.html?srsltid=AfmBOorGIOS9Y77k3J_CX6UWqfZl...
1•Bluestein•17m ago•0 comments

Out-of-control SpaceX rocket believed to have smashed into the Moon

https://www.independent.co.uk/space/spacex-rocket-moon-crash-falcon-9-b3027645.html
1•emot•18m ago•0 comments

Helsinki Hacker News Meetup

https://calpaterson.com/helsinki-hn.html
3•calpaterson•19m ago•1 comments

Nixpkgs has a due-process problem

https://domenkozar.com/2026/08/04/nixpkgs-has-a-due-process-problem/
1•ai_critic•21m ago•0 comments

Kernel Fusion in Nvidia CUDA: Optimizing Memory Traffic and Launch Overhead

https://developer.nvidia.com/blog/kernel-fusion-in-nvidia-cuda-optimizing-memory-traffic-and-laun...
1•fzimmermann89•21m ago•0 comments

Show HN: Bitbead – Photo to printable bead pattern, in the browser

https://www.bitbead.app/en
1•shouqing_qiao•21m ago•0 comments

Hoodik: A lightweight, self-hosted, end-to-end encrypted cloud storage server

https://github.com/hudikhq/hoodik
3•taubek•24m ago•0 comments

AI artefacts are the new Access databases

https://sjg.io/writing/your-next-access-database-problem-is-an-ai-agent/
1•simonjgreen•28m ago•0 comments

Trump's Push for More A.I. Data Centers Will Mean Major Air Pollution

https://www.nytimes.com/2026/08/05/climate/data-centers-pollution-trump-ai-energy.html
2•quapster•28m ago•0 comments

Under the Hood of Codex Security

https://twitter.com/GustavHartz/status/2084926544800035266
3•GustavHartz•30m ago•1 comments

Building a Rust Inference Engine That Matches Llama.cpp

https://www.fratepietro.com/2026/ferrox-rust-gguf-inference-engine/
2•antonellof•35m ago•0 comments

Remover – AI tool to remove unwanted objects from videos

https://remover.work
1•lisaluan•35m ago•0 comments

GitHub Account Breach Fuels Shai-Hulud NPM Supply Chain Attack

https://www.esecurityplanet.com/threats/github-account-breach-fuels-shai-hulud-npm-supply-chain-a...
2•doodlebugging•39m ago•1 comments

Hackers' AI chat logs reveal evolving tactics

https://www.axios.com/2026/08/04/exclusive-hackers-ai-chat-logs-reveal-evolving-tactics
3•laacz•41m ago•0 comments

Show HN: I created a new Deep Learning Framework

https://picodl.vercel.app
1•alight•42m ago•0 comments

US Military GPS jamming operations cause civilian aircraft crash and wildfires

https://apnews.com/article/new-mexico-plane-crash-medevac-ntsb-gps-d95ba57711f926082d7f11d2c20f0f0d
6•ambigious7777•45m ago•0 comments

The workers caught in the AI transition

https://www.bbc.com/news/articles/cgr7nxve05go
1•geox•45m ago•0 comments
Open in hackernews

Ask HN: Java why put string in a constant?

1•ramsicandra•1y ago
I'm relatively new to Java. I often notice a pattern where there is a list of constant which value are equal to the name.

  class Constant {
    public static final String ALBUM = "album";
    public static final String NAME = "_name";
    public static final String DISPLAY_NAME = "display-name";
    public static final String SERVICE_NAME_METRIC_NAME_PREFIX = "service_name.metric_name";
  }

Here is a public example of this practice I could find: https://developer.android.com/reference/android/provider/MediaStore.MediaColumns

I could understand that this might help in 2 ways refactoring and typo. This reduces chance of typo because you'll get compile error instead of run-time error if you typo a constant. This might also help in refactoring if you ever wants to change the value. but if may use this android public API example, I don't think it's wise to change a field name ever. If it's decommissioned, it's good to keep it so we don't re-use the field. If it's a new better field available, I think it should have a different name. I maybe making a straw man argument here. Let me know. If it's an internal API where such refactoring might make sense -- I still kind of think internal API should also be backward compatible, replacing a string are not a complicated operation in my opinion.

I see that this practice has a cost. One being that in every class that use this API. You need to add an import. It's also often the const is only used once from my experience.

  import static com.example.MediaFields.NAME;
  import static com.example.MediaFields.DISPLAY_NAME;

  String value = json.getString(NAME);
  String value2 = json.getString(DISPLAY_NAME);
vs

  String value = json.getString("name");
  String value2 = json.getString("display_name");
You write 1 line for declaration plus 2 lines for each class using this API. This is not a big deal in terms of LoC and I'm not an LoC police. However, my sense is the cost outweigh the benefit.

What do you think?

Comments

lanna•1y ago
You just made TWO typos: "display-name" vs "display_name" and "_name" vs "name", automatically counter-argumenting your point.

It is also for documentation. With the declared constants, we know all possible values. With plain strings, how am I supposed to know which values to use?

The benefits far outweigh the marginal cost.

ramsicandra•1y ago
The -, _, and leading _ are just variations of white space / separator I have encountered. I think it's possible to document all the allowable values in the Javadoc section of the function that takes in string as their argument.

In the specific android example, I would put it here. Under projection params where it takes in all the Images.Media.* string consts.

https://developer.android.com/reference/android/content/Cont...

Though, if it's a practice of Java Engineer to document allowable enum like string as a constant, then I can say that's a valid argument.