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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Which tricks do you use to write less code?

2 点作者 jordiburgos大约 1 年前
I found some &quot;tricks&quot; to write less code, hence less code to maintain if there are any changes. Also less code with bugs just by changing the inputs.<p>For example, OpenAPI spec file + OpenAPI generator (https:&#x2F;&#x2F;github.com&#x2F;OpenAPITools&#x2F;openapi-generator). Any changes in the OpenAPI spec are reflected in the final code with a build step.<p>Another example: MapStruct (https:&#x2F;&#x2F;mapstruct.org&#x2F;) to avoid passing data from Entity classes to DTO and back. Saves looots of boilerplate code.<p>I don&#x27;t have much to say for frontend as I am mainly working on backend. So good to know your stuff.<p>Which are your tricks?

1 comment

h2odragon大约 1 年前
two or three letter variable names. If your scope has more than 17k variables you&#x27;re doing something badly wrong anyway.