frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Bru: Send and Read SMS from the Browser

https://sverre.me/projects/bru/
1•Curiositry•1m ago•0 comments

Perfect-er Freehand

1•shove•1m ago•0 comments

BlazeZip – A fast, parallel, ZIP archiver for Windows, with a benchmark suite

https://github.com/marksmayo/blazezip
1•beatthatflight•12m ago•0 comments

Mano-P: Setting Up an On-Device GUI Agent Without Cloud Dependencies

https://github.com/Mininglamp-AI/Mano-P
1•ElenaDaibunny•13m ago•0 comments

Coinbase Built, Evaluated, and Post-Trained a Fraud Agent on Qwen3.5-9B

https://www.coinbase.com/en-gb/blog/part-one-how-coinbase-built-evaluated-and-post-trained-a-frau...
2•7777777phil•15m ago•0 comments

Ask HN: Is AI-written code less secure if you don't use Daybreak (or similar)

1•throwaway893257•17m ago•0 comments

New York City's iconic horse-drawn carriages expected to take their last trot

https://www.cnn.com/2026/10/13/us/nyc-horse-carriage-ban
2•1659447091•19m ago•0 comments

Multipartite entanglement in heterogeneous systems (2016)

https://arxiv.org/abs/1602.08064
1•peter_d_sherman•21m ago•0 comments

Wikipedia Philosophy Phenomenon

https://en.wikipedia.org/wiki/Wikipedia_philosophy_phenomenon
6•o4c•26m ago•0 comments

Memory and dreaming: how Devin learns from working with you

https://devin.ai/blog/memory-and-dreaming
1•gmays•27m ago•0 comments

Play Tic-Tac-Toe with Knuth

https://research.swtch.com/tictactoe
1•xk3•28m ago•0 comments

Things I wish I had known about kickscooters

https://maxmautner.com/2026/10/12/kickscooter.html
3•mslate•29m ago•5 comments

Strafe: A new open-source, E2E Encrypted, and federated alternative to Discord

https://strafe.chat/
1•brydencalaway•33m ago•0 comments

WebDAV-rfc4918 – WebDAV client for Python with an fsspec back end

https://github.com/manfred-kaiser/webdav-rfc4918
1•manfred-kaiser•36m ago•1 comments

Webpage Copy-Protection is Impossible (and that's great)

https://danq.me/2026/10/13/webpage-copy-protection-is-impossible-and-thats-great/
5•HotGarbage•39m ago•0 comments

Entangled Photons Produced On-Chip (2023)

https://spectrum.ieee.org/quantum-entanglement
3•peter_d_sherman•40m ago•0 comments

Full list of uncensored AI chatbots

https://nonrestrictive.chat/
1•Loyae•42m ago•0 comments

The Most Remote Place on Earth Has Space Junk and a Sea Monster

https://www.atlasobscura.com/articles/strange-maps-point-nemo
1•bcaulfield•46m ago•0 comments

Is 'Attention' the Essence of Intelligence?

https://www.quantamagazine.org/is-attention-the-essence-of-intelligence-20261012/
8•bcaulfield•50m ago•0 comments

British Gaming Legends: Stories from an Iconic Era – The Retro Hour EP547

https://theretrohour.com/british-gaming-legends-stories-from-an-iconic-era-the-retro-hour-ep547/
2•doener•51m ago•0 comments

The Collider Dividend

https://cerncourier.com/the-collider-dividend/
2•EA-3167•52m ago•0 comments

The Heroes of Pea Island Life-Saving Station [video]

https://www.youtube.com/watch?v=OlZnHLmJAXA
3•sbuttgereit•54m ago•0 comments

Five agents running on GPT-6.1 Sol clear WoW's Ragefire Chasm in 24h

https://agent-wow.sh/five-agents-running-on-gpt-61-sol-clear-world-of-warcrafts-ragefire-chasm-in...
1•soheilpro•57m ago•0 comments

Anthropic 2026 AUP Update

https://www.anthropic.com/news/2026-usage-policy-update
8•jamiesonbecker•1h ago•0 comments

Show HN: GenClass, A 10 MB in-browser model that catches bugs that never throw

https://www.npmjs.com/package/@genclass/runtime
2•Karanvir1729•1h ago•0 comments

Show HN: Evaluate and improve your agent steering

2•sid_ships•1h ago•1 comments

Show HN: Ins Autopilot – a local-first Instagram workflow extension

https://insautopilot.com/
2•ryancole11•1h ago•0 comments

Sprout – A modern, RP2350-powered motherboard for iPods

https://www.crowdsupply.com/certain-things/sprout-pi-mainboard
3•rickcarlino•1h ago•0 comments

To Keep Human Judgment, We Need AI Courts

https://paxmachina.ai/to-keep-human-judgment-we-need-ai-courts
4•paulpauper•1h ago•0 comments

OpenAI Employee Uses "Unnamed Chatbot" to Spy on OpenAI, Gets Arrested by FBI

https://decodingvibes.com/blog/openai-employee-uses-unnamed-chatbot-to-spy-on-openai-gets-arreste...
5•altmanaltman•1h 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.