Is Dry Code Still Relevant Today? | HackerNoon

  • 📰 hackernoon
  • ⏱ Reading Time:
  • 43 sec. here
  • 2 min. at publisher
  • 📊 Quality Score:
  • News: 20%
  • Publisher: 51%

United States Headlines News

United States Latest News,United States Headlines

- codequality cleancode

the same. A great example would be a math function like. That function should work for every case where you need to calculate a logarithm - each calculation of a log isIf two different projects share the same logic, it can often make sense to centralize it in a library package. While this is often a great idea, it can add overhead and can end up being more trouble than it’s worth.

For example, even if the abstraction makes sense, you’re definitely adding at least the following complexity to the project:Requires multi-project updates in order to get a new change to a specific dependentGets harder to make “breaking” changes to the libraries’ core functions - requires a higher standard of code quality and architectureWhen debugging or reading code, it would be easiest if the flow of logic started at the top of a file and flowed in a linear path.

Pure functions are easy to write good unit tests for - if your abstraction is easily testable it’s more likely to be a good abstraction.Take a look at the following example:This is a great function! It’s very simple, and obviously can be used to calculate the area of any shape. Here’s a bad example:Special cases are bad news - I’m trying to be too abstract.

 

Thank you for your comment. Your comment will be published after being reviewed.
Please try again later.
We have summarized this news so that you can read it quickly. If you are interested in the news, you can read the full text here. Read more:

 /  🏆 532. in US

United States Latest News, United States Headlines

Similar News:You can also read news stories similar to this one that we have collected from other news sources.

The Noonification: The Lord of Space (10/15/2022) | HackerNoon10/15/2022: Top 5 stories on the Hackernoon homepage! - noonification hackernoonnewsletter
Source: hackernoon - 🏆 532. / 51 Read more »

Introducing the Brand New Stats Page on HackerNoon | HackerNoonIn this blog, we’re going to take a quick look at all the stats we provide to writers on HackerNoon to help them supercharge their writing. - hackernoonproduct storystats
Source: hackernoon - 🏆 532. / 51 Read more »

The Future of Software Engineering: Is Low-Code / No-Code the Answer? | HackerNoonLow-code is transforming how software developers build and deploy web applications. How will this impact the future of software engineering? - lowcode softwaredevelopment
Source: hackernoon - 🏆 532. / 51 Read more »

Gaussian Co-Ordinates | HackerNoonRelativity: The Special and General Theory by Albert Einstein is part of HackerNoon’s Book Blog Post series. - science physics
Source: hackernoon - 🏆 532. / 51 Read more »

D.C.-area forecast: Very nice today, and probably passable for SundayMost or all of the daytime period this weekend is dry. Today's a stunner.
Source: postlocal - 🏆 327. / 59 Read more »

The Palmer Method of Business Writing: Lesson 39, 40, 41, 42, AND 43 | HackerNoonAt least five lessons at this point should be devoted to reviewing all the lessons that have gone before. - selfteaching educational
Source: hackernoon - 🏆 532. / 51 Read more »