TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Which tricks do you use to write less code?

2 pointsby jordiburgosabout 1 year ago
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

h2odragonabout 1 year ago
two or three letter variable names. If your scope has more than 17k variables you&#x27;re doing something badly wrong anyway.