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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Thou Shalt Not Use Struct

4 点作者 fastier大约 9 年前

1 comment

sparkie大约 9 年前
Title should really be: Thou shalt not use a struct whose members are defined in a header file.<p>Because the rest of the post drags on about encapsulation with the implicit assumption that use of private and public in classes is the only way to acheive it. What makes this assumption awkward is that the C++ class style actively encourages certain kinds of coupling which the article is crusading against, and the best means of encapsulation we have: using only opaque types in header files, is omitted.