frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

15 months of building an OSS Azure emulator with and without AI

https://topaz.thecloudtheory.com/blog/15-months-building-oss-with-and-without-ai/
1•kamilmrzyglod•1m ago•0 comments

Run your own self-hosted LLMs with Docker Compose

https://totaldebug.uk/posts/self-hosted-llms-ollama-open-webui-docker-compose/
1•marksie1988•3m ago•0 comments

WannaCry cluster from 2017 still spreading in 2026 – 269 samples in 72h

https://sshlab.eu/blog/a-wannacry-cluster-from-2017-still-active-in-2026-b5bdaad3
1•dblanko•7m ago•0 comments

The space bit of SpaceX is worth $8 a share, says Morgan Stanley

https://www.ft.com/content/09a62ed4-16af-433c-adb7-c877d1975388
2•iamflimflam1•8m ago•0 comments

Ask HN: Is there anything good in the existence of LLMs?

1•sirnicolaz•9m ago•0 comments

Zero-Trust Workload Identity in Kubernetes with Spiffe, Spire, and Cilium

https://www.freecodecamp.org/news/implement-zero-trust-workload-identity-in-kubernetes-with-spiff...
1•enz•10m ago•0 comments

Browser extension to filter out all unknown brands from Amazon search results

https://chromewebstore.google.com/detail/amazonbrandfilter/mhfjchmiaocbleapojmgnmjfcmanihio
2•alecco•17m ago•1 comments

Beyond Refusal: Aligned vs. Abliterated LLMs for Vulnerability Analysis

https://arxiv.org/abs/2607.05842
1•sbulaev•18m ago•0 comments

Moraine: Unified Agent Tracing

https://github.com/eric-tramel/moraine
1•handfuloflight•20m ago•0 comments

The social physics of conversation: Communication patterns matter

https://andiroberts.com/citizenship/the-social-physics-of-conversation-citizenship-leadership
1•kiyanwang•20m ago•0 comments

The hard part wasn't the code. The hard part was the thinking that produced it

https://medium.com/@mjmoughtin/the-reframe-2f2a74aa4b93
1•raychis•21m ago•1 comments

The Download: your stake in OpenAI, and the Treasury's AI warning

https://www.technologyreview.com/2026/07/07/1140197/the-download-your-openai-stake-treasury-ai-wa...
1•joozio•21m ago•0 comments

Zebra-Rs Rust Version of GNU Zebra, Quagga, FRR

https://zebra.rs
1•kishiguro•22m ago•0 comments

Leave a failing test before you go on vacation

https://lukapeharda.com/article/leave-a-failing-test-before-you-go-on-vacation/
1•srijan4•23m ago•0 comments

Show HN: Plugin to Connect Pi to Signal

https://github.com/aalzubidy/pi-signal
1•sub-e12•25m ago•0 comments

Badger: Low-level SQLite file format visualizer

https://github.com/nikitazigman/badger
1•thunderbong•26m ago•0 comments

Microsoft Laid Off a 37-Year Vet

https://twitter.com/layoffai/status/2074629736140075212
3•taubek•31m ago•0 comments

The Four Core Areas of Responsibility for an Engineering Manager

https://softwareleads.substack.com/p/the-four-pillars-of-engineering-management
1•kiyanwang•32m ago•0 comments

Show HN: Jot, a menu bar app that catches a thought before it's gone

https://jot.arunbrahma.com
1•masterbrewer•33m ago•0 comments

Highlite – Make any website your virtual whiteboard

https://get-highlite.app
1•ryoann•34m ago•0 comments

Not all model upgrades are upgrades

https://developer.microsoft.com/blog/not-all-model-upgrades-are-upgrades
1•waldekm•35m ago•0 comments

Turn a €5 ESP32-S3 Board into a Browser-Based Workbench for Hardware Hacking

https://www.hackster.io/geo-tp/turn-a-5-esp32-s3-board-into-a-browser-based-workbench-b528dd
1•geotp•36m ago•0 comments

OpenAI to unveil GPT-5.6 on Thursday after delaying launch

https://www.reuters.com/technology/openai-gets-us-approval-broad-gpt-56-rollout-axios-reports-202...
1•adithyaharish•37m ago•0 comments

B2B Payment Platforms for Global Businesses in 2026: A Comparative Guide

https://www.xtransfer.com/blog/b2b-payment-platforms-global-business
1•pingx•37m ago•0 comments

Omp

https://omp.sh/
1•217•37m ago•2 comments

Nextdocs.io – AI Slide Generation

https://www.nextdocs.io
1•galacticdessert•39m ago•0 comments

My Name Is SiMON

https://github.com/ProphetGang/formal_symbol_language
1•ProphetGang•44m ago•1 comments

Vagrant-tart: Vagrant plugin for Tart; run macOS VMs on M-series using Vagrant

https://github.com/letiemble/vagrant-tart
1•gurjeet•50m ago•0 comments

From Quantum Relative Entropy to the Semiclassical Einstein Equations

https://journals.aps.org/prl/pdf/10.1103/lmq8-nsty
1•sonicrocketman•50m ago•0 comments

Notes and reading materials on finite topological spaces

https://math.uchicago.edu/~may/finite
2•gone35•54m 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.