TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Go'ing Insane Part Two: Partial Privacy

4 点作者 figbert超过 3 年前

1 comment

tored超过 3 年前
The capitalization of the first character for a symbol to denote public is a truly a weird design choice.<p>If the makers of golang wanted to avoid the complexity of <i>public</i>, <i>protected</i> and <i>private</i>, especially if you consider C++ where you can change those access modifiers depending how you inherit, it is an understandable decision, but then I would have rather just ignored access modifiers all together and kept everything as public regardless, like many languages do. That would avoided the atrocious json hack completely.<p>I think this goes back to what this critical article about go concluded, that Simple is a lie.<p><a href="https:&#x2F;&#x2F;fasterthanli.me&#x2F;articles&#x2F;i-want-off-mr-golangs-wild-ride" rel="nofollow">https:&#x2F;&#x2F;fasterthanli.me&#x2F;articles&#x2F;i-want-off-mr-golangs-wild-...</a><p>&quot;when you make something simple, you move complexity elsewhere.&quot;<p>If I were a golanger another thing I would have disliked is definitely the internal folder for packages, having folders to have magic capabilities is something I truly dislike. First you need be aware when reading the source file where it is located, second when creating such folder you have to be sure to create it with the correct name, these things has tendency to be hard to detect during code review.<p>MVC frameworks likes to do this, put the controller in the correct folder and give it a correct name and name your method with get, hard to debug if you misspell any of it. Or database migrations, put them in a folder in a consecutive order, so to detect if new migrations have slipped in between the one you are working on you need to diff on folder sorting. Just horrible.