Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by joeblubaugh

5 days ago

In fact it was “the Java way” for many years and “useless getters” was always a big complaint about Java.

2 comments

joeblubaugh

Reply

oefrha  5 days ago

Hey it's better in Go. In Java it's getFoo(). In Go it's just Foo(). Saves three bytes, and three keystrokes if you program by hand and don't autocomplete!

gf000  5 days ago

I do agree to a certain degree, but with getters/setters you could properly hide/set to read-only fields.

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities