frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Everyone Post Your Uptime

1•skor•43s ago•0 comments

Nvidia's New DLSS 5 Brings Photo-Realistic Lighting to RTX 50-Series

https://www.digitalfoundry.net/features/nvidias-new-dlss-5-brings-photo-realistic-lighting-to-rtx...
1•mariuz•1m ago•0 comments

Civilization and Its Discontents (1930)

https://gutenberg.org/cache/epub/78221/pg78221-images.html
1•petethomas•8m ago•0 comments

Busdayaxis: Matplotlib scale collapsing weekends and off-hours on datetime axis

https://github.com/saemeon/busdayaxis
1•saemeon•8m ago•0 comments

40k-line AI platform built solo with Rails, self-hosted GPU, and an agent

https://austn.net/blog/building-an-ai-native-web-platform
1•frogr•10m ago•1 comments

China is running multiple AI races

https://www.brookings.edu/articles/china-is-running-multiple-ai-races/
2•hunglee2•13m ago•0 comments

Velvet-auth – Production-ready auth plugin for Elysia and Bun

https://github.com/raloonsoc/velvet-auth
1•raloonsoc•20m ago•0 comments

C++ Algorithms Library

https://en.cppreference.com/w/cpp/algorithm.html
1•tosh•22m ago•0 comments

Ask HN: We need to learn algorithm when there are Claude Code etc.

4•JasonHEIN•24m ago•0 comments

Slope Rider

https://slopeonline.online/slope-rider
1•charelie142•28m ago•1 comments

Clawforge SaaS Starter: OpenClaw and Nvidia Starter for Local AI SaaS Workflows

https://github.com/autopilotaitech/clawforge-saas-starter
2•autopilotaitech•31m ago•0 comments

Ask HN: Is it time for "organic" coding?

3•lexi-k•40m ago•4 comments

Using AI a man developed a custom mRNA cancer vaccine for his dying dog

https://fortune.com/2026/03/15/australian-tech-entrepreneur-ai-cancer-vaccine-dog-rosie-unsw-mrna/
2•aureliusm•41m ago•0 comments

HitPaw VikPea

https://www.hitpaw.com/vikpea-video-enhancer.html
1•HitPaw•41m ago•0 comments

Show HN: I Built StatusDrop

https://statusdrop.dev
1•razvanmac•41m ago•0 comments

Folgpris.no (followprice) – A way to track any price from any store

https://folgpris.no/
2•falense•42m ago•1 comments

Mistral AI partners with Nvidia to accelerate open frontier models

https://mistral.ai/news/mistral-ai-and-nvidia-partner-to-accelerate-open-frontier-models
1•tosh•44m ago•0 comments

Clawdoc – Find out where your OpenClaw agents went wrong and get recommendations

https://github.com/ashishjaingithub/clawdoc
2•jainashish•45m ago•0 comments

Out-of-Context Reasoning in LLMs: A short primer and reading list

https://outofcontextreasoning.com/
1•Anon84•46m ago•0 comments

Orc – multi-agent orchestration framework

https://github.com/PietroPasotti/orc
1•ppasotti•49m ago•0 comments

Peter Thiel's Antichrist lectures in Rome spark questions in Italian parliament

https://www.euractiv.com/news/peter-thiels-antichrist-lectures-in-rome-spark-questions-in-italian...
4•vrganj•53m ago•0 comments

From black boxes to black holes

https://www.hypertesto.me/en/blog/2026/03/from-black-boxes-to-black-holes
1•sebtron•55m ago•0 comments

Bit Blit

https://en.wikipedia.org/wiki/Bit_blit
1•tosh•55m ago•0 comments

US health care spending is not an outlier

https://randomcriticalanalysis.com/2016/09/25/high-us-health-care-spending-is-quite-well-explaine...
1•MrBuddyCasino•55m ago•0 comments

Show HN: Create your own online community

https://kraa.io/kraa/trees
1•levmiseri•1h ago•0 comments

Encyclopedia Britannica sues OpenAI over AI training

https://www.reuters.com/legal/litigation/encyclopedia-britannica-sues-openai-over-ai-training-202...
6•1vuio0pswjnm7•1h ago•0 comments

Engine‑Lang: A New Experimental Programming Language

https://github.com/annuaicoder/Engine-Lang
1•User49•1h ago•0 comments

SymbolicAI: A Neuro-Symbolic Perspective on Large Language Models

https://extensityai.gitbook.io/symbolicai
1•sigalor•1h ago•0 comments

Show HN: Smartipedia - Wikipedia for Agents

https://smartipedia.com/
1•sksareen1•1h ago•1 comments

PWAs Without the Browser?

https://kver.ca/2026/03/strand-slipshod-vibe-coded-pwas-for-the-desktop/
1•MarcellusDrum•1h 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.