frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

OCR'ing 100k pages with open-source VLMs on Modal

https://www.redspring.xyz/blog/vlm-ocr-bench/
1•patrickdevivo•1m ago•0 comments

Elevator Saga: The elevator programming game

https://play.elevatorsaga.com/
1•mooreds•1m ago•0 comments

Show HN: Full featured language that compiles to binary

https://github.com/code-by-sia/xi
1•sia_xi•1m ago•0 comments

SignalFire's State of Talent Report – 2026

https://www.signalfire.com/blog/signalfire-state-of-talent-report-2026
1•yumraj•2m ago•0 comments

YouTube Content Creators Are Winning the AI Search Game, Jellyfish Data Finds

https://www.adweek.com/media/youtube-content-creators-are-winning-the-ai-search-game-jellyfish-da...
1•thm•3m ago•0 comments

Whistleblower Sarah Wynn-Williams sues Meta over attempts to 'silence' her

https://www.theguardian.com/technology/2026/jun/25/whistleblower-sarah-wynn-williams-sues-meta-at...
2•thm•3m ago•0 comments

C# Techniques Pros Use Without Thinking

https://medium.com/c-sharp-programming/7-csharp-techniques-pros-use-without-thinking-2026-609e377...
1•sukhpinder0804•3m ago•0 comments

Show HN: Calculate salary after tax and cost of living in Germany

https://net-salary.com/
1•sia_xi•4m ago•0 comments

Ask HN: What is one thing about AI that annoys you the most?

1•akashwadhwani35•5m ago•0 comments

Show HN: I made a social media scheduler with API for AI Agents

https://schedpilot.com/
1•schedpilot•8m ago•0 comments

The Century of the Maxxer

https://samkriss.substack.com/p/the-century-of-the-maxxer
1•mooreds•9m ago•0 comments

Show HN: No chair fixed my back, so we built one that won't let you sit still

https://www.movably.com/how-it-works
1•chaibiker•10m ago•1 comments

AI transformation is a systems problem: a conversation with Justin Reock, DX

https://www.augmentcode.com/blog/ai-transformation-is-a-systems-problem
2•mooreds•10m ago•0 comments

Routing for serverless servers with Pingora, Envoy, and Spanner

https://modal.com/blog/serverless-servers
6•charles_irl•10m ago•0 comments

Data Benchmarks and Limitations [video]

https://www.youtube.com/watch?v=UwqyN-6tPKo
1•haritha1313•12m ago•0 comments

Joel Greenblatt, the Activist

https://mylesmarino.com/posts/greenblatt-activist
1•tjwds•13m ago•0 comments

U.S. pedestrians are dead due to SUV/truck hood and pillar designs

https://www.seattlebikeblog.com/2026/06/22/nyt-investigation-thousands-of-u-s-pedestrians-are-dea...
3•jbmchuck•14m ago•0 comments

Apple Raises Refurbished Mac and iPad Prices After New Product Hikes

https://www.macrumors.com/2026/06/25/apple-raises-refurbished-mac-ipad-prices/
2•latexr•15m ago•0 comments

Russia Breaks into Human Rights Activist's Phone with Cellebrite

https://citizenlab.ca/research/russia-breaks-into-human-rights-activists-phone-with-cellebrite/
2•EmbarrassedHelp•15m ago•0 comments

Artists, Organizers and Creators This platforom is for you

https://www.bookeeni.com/
2•zdig•15m ago•0 comments

Fighting for the Higher Self

http://www.garlikov.com/higherself.html
1•thunderbong•16m ago•0 comments

Anthropic/Alibaba, Instagram Betting, FIFA

https://marginpoints.substack.com/p/anthropicalibaba-instagram-betting
1•historian1066•17m ago•0 comments

I compared every Apollo alternative built for local business outreach

https://www.leadlu.com/blog/best-apollo-alternative-small-business
1•im_dil•18m ago•0 comments

Larry Sanger Said Wikipedia Punishes Dissent. Then It Banned Him

https://reclaimthenet.org/larry-sanger-said-wikipedia-punishes-dissent-then-it-banned-him
2•anonymousiam•19m ago•0 comments

Show HN: Ex-Amazon, got burned out, left my job, and now building Zenvesto

https://zenvesto.com/
1•zenvesto•19m ago•0 comments

Portal in a Browser

http://yikes.pw/portal/
1•throwaway2027•20m ago•0 comments

Show HN: What Would Jesus Say?

https://what-would-jesus-say.outlookzen.com
1•whack•20m ago•0 comments

Epic Games boss calls Steam AI disclosures "irresponsible of Valve"

https://www.gamesradar.com/games/epic-games-boss-calls-steam-ai-disclosures-really-irresponsible-...
1•anonymousab•23m ago•1 comments

Detailed Ultrasound Images of the Brain

https://alephneuro.com/blog/ultrasound-brain
2•vvvhuang•23m ago•0 comments

Bungie Hit with Widespread Layoffs

https://www.forbes.com/sites/paultassi/2026/06/25/bungie-hit-with-widespread-layoffs-as-destiny-2...
3•aliasxneo•23m 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.