frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

I run a 9-model LLM council to write a financial newsletter. What breaks

https://marketdaily.ai/blog/eng-llm-council-judge-en-202608
1•delvinchang•40s ago•0 comments

Attachment style quiz – find out your attachment

https://tally.so/r/0QP0lj
1•ElysiumAbove•1m ago•0 comments

Becoming Bridge Builders

1•Revdrbkeithhane•2m ago•0 comments

Offline Bootloader Unlock for Xiaomi 8Elite 8G3 8G2 8sGen4 8sGen3, MTK 9400/9500

https://xdaforums.com/t/guide-breakthrough-free-offline-bootloader-unlock-for-cn-xiaomi-redmi-8el...
1•Markoff•4m ago•0 comments

Show HN: Sift – Fast local file organizer CLI with 1-click transaction undo

https://github.com/taevel02/Sift
1•taevel02•6m ago•0 comments

Open-Source Licensing 101

https://alavi.me/blog/opensource-licensing-101/
1•yolkedgeek•6m ago•0 comments

Translating anything into a number using math

https://blog.naxn.shop/ever-thought-about-how-you-can-translate-anything-into-a-number-using-math
1•codecnomad•7m ago•0 comments

Emacs for NvChads

https://qlain.online/blog/emacs-for-nvchads.html
1•etoql•8m ago•0 comments

Show HN: Job Seeker – AI agent skills for job searching

https://github.com/galiprandi/job-seeker
1•galiprandi•9m ago•0 comments

Mea Culpa – Dark Hours

https://blog.terrygodier.com/2026/08/09/mea-culpa-dark-hours.html
1•satvikpendem•9m ago•0 comments

Murder Stone

https://en.wikipedia.org/wiki/Murder_stone
1•jimnotgym•13m ago•1 comments

Exercise is good for you. But what's the right amount?

https://iterator.news/p/exercise-is-good-for-you-but-whats-the-right-amount
2•bucket2015•13m ago•2 comments

Let's build a digital clock (Video, Ben Eater)

https://www.youtube.com/watch?v=3XDH-fZKnQk
1•JKCalhoun•18m ago•0 comments

A unique palaeolithic human ichnological record from Italy (Bàsura Cave)

https://elifesciences.org/articles/45204
1•Tomte•20m ago•0 comments

Amazon Builder's Library – An overlooked goldmine of System Design knowledge

https://sumitgouthaman.com/posts/amazon-builders-library/
1•equinumerous•20m ago•0 comments

RIP Your Backlog

https://randsinrepose.com/archives/r-i-p-your-backlog/
1•mooreds•22m ago•0 comments

Testing is underway on vaccines to intercept brewing colon cancer

https://www.cnn.com/2026/08/09/health/colon-cancer-vaccine-lynch-syndrome
3•mooreds•23m ago•0 comments

Ask HN: What assisted driving car is best for elderly drivers?

2•yubblegum•23m ago•0 comments

The "Data Quality/Engineering" Angle

https://kylesinvestigation.com/
1•mkyle71•23m ago•0 comments

Uncontacted Indigenous Peoples: at the edge of survival (2025) [pdf]

https://assets.survivalinternational.org/documents/2788/original-b24f435d70d2e27876b53452d615b1a4...
2•mooreds•24m ago•0 comments

Show HN: YC Startup School, but AI-Native

https://foundera.app/
2•toyji•25m ago•0 comments

Gemini 3 Pro can generate normal maps

https://geosona.com/software/2026/08/09/gemini-normal-maps/
1•gste•25m ago•2 comments

Israeli startup was linked to rogue AI hacks at OpenAI, Anthropic and Meta

https://www.cnbc.com/2026/08/09/israeli-startup-irregular-linked-to-ai-hacks-openai-anthropic-met...
15•cramer4next•26m ago•5 comments

The Wild West of Private Schools That Collect Taxpayer Dollars

https://www.propublica.org/article/private-schools-vouchers-growth-florida-arizona-west-virginia
2•ceejayoz•30m ago•0 comments

Show HN: Amapola – financial models you can draw and play

https://thepatternbridge.com/amapola/
1•GabrielSilver•31m ago•0 comments

Auto mode is now the default in Claude Code for Pro, Max, and Team plans

https://simonwillison.net/2026/Aug/8/auto-mode/
2•ilamont•32m ago•1 comments

Trump Crypto Took $100M from a Businessman with Red Flags

https://www.nytimes.com/2026/08/09/us/politics/bobby-zhou-trump-crypto.html
1•hrldcpr•33m ago•0 comments

Show HN: FolderForge, open-source native macOS folder icon designer

https://github.com/KeplSiv/FolderForge
2•keplsiv•37m ago•0 comments

Amazon circumvents Gilroy community vote for AI data center

https://www.tomshardware.com/tech-industry/data-centers/amazon-secretly-circumvents-community-vot...
19•mikhael•38m ago•6 comments

Claude Code in 9 lines Python

https://www.reddit.com/r/LocalLLaMA/comments/1viwlgj/comment/p2mn1xt/
2•tosh•40m 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.