frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Claude is down – Jan 14th 2026

1•rubymamis•1m ago•0 comments

Matthew McConaughey Trademarks Himself to Fight AI Misuse

https://www.wsj.com/tech/ai/matthew-mcconaughey-trademarks-himself-to-fight-ai-misuse-8ffe76a9
1•impish9208•1m ago•1 comments

The Six Patterns That Cover Everything

https://github.com/siy/coding-technology/blob/main/articles/six-patterns-that-cover-everything.md
1•siy•1m ago•1 comments

China's customs agents told Nvidia's H200 chips are not permitted

https://www.reuters.com/world/china/chinas-customs-agents-told-nvidias-h200-chips-are-not-permitt...
1•zerosizedweasle•2m ago•0 comments

All you need is Wide Events, not "Metrics, Logs and Traces" (2024)

https://isburmistrov.substack.com/p/all-you-need-is-wide-events-not-metrics
1•tosh•2m ago•0 comments

Marine Snow

https://en.wikipedia.org/wiki/Marine_snow
1•thunderbong•3m ago•0 comments

Ask HN: Personal website featured on HN, list of restaurants in NYC

1•laffOr•4m ago•0 comments

Netflix 'plans to switch to all-cash offer to seal $83B Warner Bros deal'

https://www.theguardian.com/film/2026/jan/14/netflix-plans-to-switch-to-all-cash-offer-to-seal-wa...
1•beardyw•7m ago•0 comments

Software Development and Modeling in the Age of Artificial Intelligence

https://download.ssrn.com/2025/12/9/5881104.pdf?response-content-disposition=inline&X-Amz-Securit...
1•ahoibakk•7m ago•0 comments

Senate passes a bill that would let nonconsensual deepfake victims sue

https://www.theverge.com/news/861531/defiance-act-senate-passage-deepfakes-grok
1•smurda•10m ago•0 comments

Does anyone know who currently owns Graphic (formerly Autodesk Graphic)?

https://graphic.com
1•mattkevan•11m ago•1 comments

Debunking the 'Three Pillars of Observability' Myth (2021)

https://softwareengineeringdaily.com/2021/02/04/debunking-the-three-pillars-of-observability-myth/
1•tosh•12m ago•0 comments

How to write a good spec for AI agents

https://addyosmani.com/blog/good-spec/
2•cdrnsf•12m ago•0 comments

How to get banned from Facebook in one simple step

https://nibblestew.blogspot.com/2026/01/how-to-get-banned-from-facebook-in-one.html
1•ibobev•14m ago•0 comments

You Need a Kitchen Slide Rule

https://entropicthoughts.com/kitchen-slide-rule
1•ibobev•15m ago•0 comments

Show HN: DailySpace, Android app for exploring space photos and rocket launches

https://play.google.com/store/apps/details?id=com.daily.space&hl=en_US
3•DailySpace•15m ago•3 comments

Parallel Primitives for Multi-Agent Workflows

https://fergusfinn.com/blog/parallel-primitives-blog/
1•mezark•16m ago•0 comments

No Bloom? No Problem: Glowing Stuff Without Post Effects

https://www.patreon.com/posts/no-bloom-no-post-53965598
1•ibobev•16m ago•0 comments

Servo 2025 Stats

https://blogs.igalia.com/mrego/servo-2025-stats/
7•todsacerdoti•16m ago•0 comments

Event Sourcing with GenesisDB CE Now Available on Uberspace

https://lab.uberspace.de/guide_genesis-db/
1•patriceckhart•18m ago•0 comments

Unemployed almost a year after graduating MIT – a rant

3•TimGubth•21m ago•2 comments

Build Your OT Toolbox: It's Dangerous to Go Alone, So Take These Tools

https://www.emberot.com/resources/blog/build-your-ot-toolbox/
1•TheWiggles•22m ago•0 comments

Ask HN: Did Glassdoor figure out your identity?

1•penguin_booze•24m ago•0 comments

Show HN: Hirebetter.io – AI tools to reduce manual recruiter work

https://hirebetter.io
1•tomgreef•25m ago•0 comments

Show HN: Anti for You

https://github.com/da-x/anti-for-you
1•da-x•26m ago•0 comments

Donald Trump, Would-Be Price Controller

https://paulkrugman.substack.com/p/donald-trump-would-be-price-controller
3•rbanffy•28m ago•0 comments

Lies, Damned Lies and Proofs: Formal Methods Are Not Slopless

https://www.lesswrong.com/posts/rhAPh3YzhPoBNpgHg/lies-damned-lies-and-proofs-formal-methods-are-...
3•OgsyedIE•30m ago•0 comments

Show HN: Plane Clock – Displays plane corresponding to hour

https://antoinemopa.github.io/plane_clock/
1•antoineMoPa•32m ago•0 comments

EBPF.party

https://ebpf.party
4•todsacerdoti•35m ago•0 comments

Show HN: Burnboard – Track and compare your AI coding assistant usage

https://burnboard.dev
1•davekiss•36m ago•0 comments
Open in hackernews

Ask HN: Java why put string in a constant?

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