frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

ZkFuzz Foundation and Framework for Effective Fuzzing of Zero-Knowledge Circuits

https://www.computer.org/csdl/proceedings-article/sp/2026/606500a901/2bojvL4Zswo
1•syumei•57s ago•0 comments

Visibility Culling

https://www.4rknova.com//blog/2017/01/01/visibility-culling
1•ibobev•6m ago•0 comments

Figure AI sued by whistleblower who stated robots could 'fracture a human skull'

https://www.cnbc.com/2025/11/21/figure-ai-sued.html
1•cyrusradfar•6m ago•0 comments

CS Sriwijaya Air

1•Hendrawanli•9m ago•5 comments

Lucas Chess, 57 Chess Engines to Play from the Start

https://lucaschess.pythonanywhere.com/
1•turrini•10m ago•0 comments

Editing a young-earth creationist book with ChatGPT-5

https://geoff1111.github.io/
1•Egret•11m ago•0 comments

'Invisible' microplastics spread in skies as global pollutant

https://www.asahi.com/ajw/articles/16137995
4•devonnull•12m ago•0 comments

China has brought millions out of poverty. The US has not – by choice

https://www.theguardian.com/us-news/2025/nov/23/china-us-poverty-income-inequality
4•bookofjoe•14m ago•0 comments

Show HN: Now everyone can write JavaScript API in Rust

https://shyam20001.github.io/rsjs/
1•StellaMary•14m ago•1 comments

Show HN: Aestheai – Text-to-UI Generator Powered by Gemini 3 (Export to Lovable)

https://www.aestheteai.design/
1•adamfils•15m ago•0 comments

Writing Hack: Write It Just Like That

https://psychotechnology.substack.com/p/writing-hack-write-it-just-like-that
2•paulpauper•16m ago•0 comments

Some Thoughts on Cultural Christianity

https://logos.substack.com/p/some-thoughts-on-cultural-christianity
1•paulpauper•16m ago•0 comments

IDE Is Dead? New AI Software Stack: Context, Trust, and Subagents

https://www.turingpost.com/p/aisoftwarestack
1•kseniase•17m ago•0 comments

Reward Hacking

https://www.anthropic.com/research/emergent-misalignment-reward-hacking
1•paulpauper•17m ago•0 comments

Finalists for the 2025 App Store Awards

https://www.apple.com/newsroom/2025/11/apple-announces-finalists-for-the-2025-app-store-awards/
1•andsoitis•19m ago•0 comments

Different Models, Same Slop?

https://www.jerpint.io/blog/different-models-same-slop/
1•jerpint•21m ago•1 comments

Show HN: PR Guard – A GitHub Action to ensure authors understand their PRs

https://github.com/YM2132/PR_guard
1•Two_hands•23m ago•0 comments

Doge 'doesn't exist' with eight months left on its charter

https://www.reuters.com/world/us/doge-doesnt-exist-with-eight-months-left-its-charter-2025-11-23/
6•the_mitsuhiko•25m ago•0 comments

How to Disable USB Attached Storage (UAS)

https://leo.leung.xyz/wiki/How_to_disable_USB_Attached_Storage_(UAS)
1•transpute•28m ago•0 comments

I automated multi-deadline tracking with Excel and Outlook

1•registrytracker•30m ago•0 comments

Supertonic: Ultra-lightweight on-device TTS model open source by Supertone

https://huggingface.co/spaces/Supertone/supertonic
1•wansookim•36m ago•0 comments

Generalizing Printf in C

https://webb.is-a.dev/articles/generalizedprintf/
1•oliverkwebb•36m ago•0 comments

ISPs more likely to throttle netizens who connect through CG-NAT: Cloudflare

https://www.theregister.com/2025/11/03/cloudflare_cgnat_bias_research/
16•throw0101a•37m ago•1 comments

Concerns about the legitimacy and integrity of Nucleus Genomics

https://totalhealthoptimization.com/2025/11/21/concerns-about-the-legitimacy-and-integrity-of-nuc...
1•salkahfi•46m ago•0 comments

Review of "Age of Disclosure"

https://www.jasoncolavito.com/blog/review-of-age-of-disclosure-an-ancient-aliens-episode-with-bet...
4•mathgenius•47m ago•0 comments

The fall of Labubus and the mush of modern internet trends

https://www.michigandaily.com/arts/digital-culture/the-fall-of-labubus-and-the-mush-of-modern-int...
4•gnabgib•48m ago•0 comments

Show HN: AI Live Log Bridge- Feeds Cursor/Claude Terminal+browser Logs via MCP

https://github.com/Ami3466/ai-live-log-bridge
1•ami3466•50m ago•0 comments

Discover Model Context Protocol Servers

https://registry.modelcontextprotocol.io/
1•mooreds•56m ago•0 comments

The Hot Market for Jobs No One Wants [video]

https://www.youtube.com/watch?v=tokvTu0zNAo
1•mooreds•57m ago•1 comments

Dingo: A Meta-Language for Go

https://github.com/MadAppGang/dingo
3•thunderbong•57m ago•0 comments
Open in hackernews

Ask HN: Java why put string in a constant?

1•ramsicandra•6mo 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•6mo 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•6mo 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.