frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Local storage for coding agents resolves amnesia

https://github.com/mobydeck/pantry
1•arthurpro•36s ago•0 comments

Ask HN: In the Age of AI, How Do I Grow as a Software Engineer?

1•mc-0•2m ago•0 comments

Show HN: Remote Coding Agent

https://github.com/tacogips/QraftBox
1•tacogips•2m ago•0 comments

Deaths in Ice Custody Texas

https://www.texastribune.org/2026/02/19/ice-detention-deaths-texas-east-montana-dilley-campos/
1•marysminefnuf•2m ago•0 comments

Claude Code in the cloud as an API (persistent workspace and scheduled jobs)

https://computer-agents.com
1•janlucasandmann•5m ago•1 comments

Beyond Slop – Why generative AI is stuck on content production, not expression

https://www.joelsimon.net/beyond-slop
2•joelS•5m ago•0 comments

Show HN: Ghostty-based terminal with vertical tabs and notifications

https://github.com/manaflow-ai/cmux
3•lawrencechen•7m ago•0 comments

Show HN: YAML SSH Task Runner

https://github.com/mikemasam/nyatictl
2•mikemasam•8m ago•0 comments

Show HN: StillOnAir – Turn YouTube into programmable, linear TV for free

https://www.stillonair.com/
2•nanamichael•8m ago•0 comments

In contrast with Trump's America, Europe's 100 gigawatt clean energy hub

https://www.cnn.com/2026/02/19/climate/trump-wind-europe-clean-energy-independence
3•asplake•9m ago•1 comments

ASCIIQuarium

https://robobunny.com/projects/asciiquarium/html/
1•threekindwords•9m ago•0 comments

Canada If Day, WW2, when "German" troops invaded Winnipeg

https://bsky.app/profile/cdnhistoryehx.bsky.social/post/3mf7y6sjumi2q
1•vinnyglennon•10m ago•0 comments

Cortex 1.6: Learning from the Way Things Unfold

https://sereact.ai/posts/cortex-1-6
1•pancakenetwork•10m ago•0 comments

Show HN: Skicamslive.com

https://skicamslive.com
1•mcoliver•11m ago•0 comments

Building an Agent SaaS with Cloudflare Containers

https://alec.is/posts/building-an-agent-saas-with-cloudflare-containers/
1•arm32•11m ago•0 comments

Show HN: Fn-p to Picture-in-Picture any macOS window

https://lowtechguys.com/pipiri/
1•alin23•12m ago•0 comments

Weather Intelligence for Smarter Sailing

https://incusgrid.com
1•cburgdorf•12m ago•0 comments

Taalas Hardcore Llama – the fastest inference on the planet

https://chatjimmy.ai
1•ljubisa_bajic•13m ago•1 comments

Apple Watch or Don't Bother

https://fireborn.mataroa.blog/blog/apple-watch-or-dont-bother/
1•samtheDamned•16m ago•0 comments

A psychedelic medicine performs well against depression

https://www.economist.com/science-and-technology/2026/02/19/a-psychedelic-medicine-performs-well-...
2•vinni2•16m ago•0 comments

The Beige Plague

https://journal.erratalabs.org/the-beige-plague
1•mldev_exe•16m ago•0 comments

Show HN: Receiver – Internet radio for GNOME with 30K pre-verified stations

https://github.com/meehow/receiver
1•meehow•17m ago•0 comments

Show HN: Hi.new – DMs for agents (open-source)

https://www.hi.new/
2•elieskilled•17m ago•0 comments

Ask HN: An approachable book on programming concepts/computer basics for a teen?

1•jamesgill•18m ago•2 comments

Malaysian Farmers Made a Fortune on Durian. Now It Is Piling Up

https://www.nytimes.com/2026/02/10/world/asia/durian-malaysia-china-demand.html
3•bookofjoe•18m ago•1 comments

'You can't just remove the cloud': US sprinting's reckoning before LA 2028

https://www.theguardian.com/sport/2026/jan/23/marvin-bracy-williams-doping-us-sprinting-paranoia
1•PaulHoule•19m ago•0 comments

Conductor removing support for Claude subscription authentication

https://twitter.com/charlieholtz/status/2024585923619590497
1•jrsj•20m ago•0 comments

A review of tumor-treating electric fields (TTFields): clinical advancements

https://pmc.ncbi.nlm.nih.gov/articles/PMC10476910/
1•CGMthrowaway•21m ago•0 comments

What's next for Chinese open-source AI

https://www.technologyreview.com/2026/02/12/1132811/whats-next-for-chinese-open-source-ai/
1•calcifer•25m ago•0 comments

Show HN: CursorLens – Open-source screen recorder/editor for product demos

https://github.com/blueberrycongee/CursorLens
1•blueberrycongee•25m ago•0 comments
Open in hackernews

Ask HN: Java why put string in a constant?

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