frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Show HN: CubeLV – AI that designs your automation before building it

https://app.cubelv.com
1•qqrun•46s ago•0 comments

UK's Rudest Street Names

https://digitaleditions.telegraph.co.uk/data/2565/reader/reader.html?#!preferred/0/package/2565/p...
2•librasteve•10m ago•0 comments

When AI Acts, Who Remembers What Happened?(cogextai.com)

1•cogext•12m ago•0 comments

The Year of Internal Tools

https://www.geocod.io/code-and-coordinates/2026-09-23-the-year-of-internal-tools
2•thecodemonkey•17m ago•0 comments

Nuros – AI study tools from notes, PDFs, videos, and links

https://nuros.app/
3•AntoineValton•17m ago•0 comments

Show HN: Air-gapped file encryption as self-decrypting HTML page

https://cms-sfx-demo.apeleg.com/
2•emurlin•17m ago•0 comments

Flatpark: A more inclusive Flatpak app store for Linux, alternative to Flathub)

https://flatpark.org/apps/
3•grigio•21m ago•0 comments

Meta Launches $1,299 VR Headset That Look Like Glasses

https://www.bloomberg.com/news/articles/2026-09-23/meta-launches-1-299-vr-headset-that-look-like-...
3•tosh•22m ago•2 comments

Italian parliament backs Meloni's plan to restart nuclear power

https://www.reuters.com/world/italian-parliament-backs-melonis-plan-restart-nuclear-power-2026-09...
2•mpweiher•23m ago•1 comments

Wealth Taxes Could Kill Privately-Owned Companies

https://www.palladiummag.com/2026/09/22/wealth-taxes-could-kill-privately-owned-companies/
3•pr337h4m•27m ago•1 comments

Google Private AI Compute with server-side memory

https://deepmind.google/blog/advancing-private-ai-compute-with-secure-server-side-memory/
2•cagz•27m ago•0 comments

Meta VR Glasses Announced, 100 grams, OLED, $1300

https://www.uploadvr.com/meta-vr-glasses-officially-announced-connect-2026/
3•cubefox•31m ago•0 comments

Six Ways to Integrate Jev

https://vercel.com/i/jev-integrations
2•flashbrew•31m ago•0 comments

GPT-6 Sol vs. Luna

https://vercel.com/i/gpt-6-sol-vs-luna
2•flashbrew•32m ago•0 comments

Ex-cop turned CEO sold U.S. agencies forensics software built in Russia

https://www.justice.gov/usao-cdca/pr/tech-ceo-russian-national-arrested-complaint-alleging-they-h...
3•Scrounger•32m ago•1 comments

Bitflix – MCP Apps Example Application for Video

https://github.com/bitmovin/bitflix-mcp-apps-example
2•tosh•32m ago•0 comments

New Meta VR Glasses

https://www.meta.com/fr/en/vr-glasses/
1•redox_•33m ago•0 comments

IT mistake erases 11 years of viewing history for hospitals' maternity records

https://arstechnica.com/information-technology/2026/09/it-mistake-erases-11-years-of-viewing-hist...
3•joozio•37m ago•1 comments

Initial DIY Cleanroom Experimentation

https://www.jefftk.com/p/initial-diy-cleanroom-experimentation
2•luu•37m ago•0 comments

Show HN: A modern favicon generator designed for clean UI and quality icon set

https://favicon.kumardeepak.com
1•kumardeepakcom•37m ago•0 comments

Show HN: Carosello. A faster image/video viewer for Linux in Rust and gtk4

https://github.com/grigio/carosello
2•grigio•39m ago•0 comments

How tech workers are feeling in 2026: a workforce splitting in two

https://www.lennysnewsletter.com/p/how-tech-workers-are-feeling-in-2026
2•fagnerbrack•39m ago•0 comments

Rat King

https://en.wikipedia.org/wiki/Rat_king
2•Eridanus2•40m ago•0 comments

Super Resolution and Frame Generation on Snapdragon Mobile Platforms

https://www.qualcomm.com/developer/blog/2026/09/introducing-adreno-neural-fusion-sdk-for-snapdrag...
1•Re-Tails•44m ago•1 comments

Contrastive Language Model (CLM): An Ultra-Fast System One Model

https://twitter.com/jackyk02/status/2102905335925424285
1•piyushsthr•45m ago•0 comments

It took 20 yrs to start regulating social media – will AI controls come sooner?

https://www.rnz.co.nz/news/business/1557652/it-took-20-years-to-start-regulating-social-media-wil...
4•billybuckwheat•46m ago•2 comments

TabVault – Open-source tab manager with atomic crash recovery

https://github.com/jarvissing/tabvault
1•jarvissing•48m ago•1 comments

Tales from the Software Factory: The Cron and the VM

https://blog.exe.dev/cron-vs-vm
1•vinhnx•55m ago•0 comments

I built a language model out of cellular automata

https://ssenthilnathan3.github.io/blog/cellular-automata-language-model/
2•nathaah3•57m ago•1 comments

Update: Source Download – Inspect, grab assets, screenshot and record video/GIF

https://chromewebstore.google.com/detail/source-download/nockdgincmpfojabnhbofkddgcmnodpd
1•2rundev•58m 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.